War damage is not correctly applied from any action done by the player.

Users who are viewing this thread

TheMageLord

The Handyman Can
Knight at Arms
I was playing around with the module system and noticed an oversight. The battle_political_consequences script grabs the faction of the party associated. This works fine for the NPC parties, but it causes problems for the player. The faction of the player party is always player_faction, so this check causes war damage in the name of the player faction (which I don't think is used anywhere) instead of the faction the player is in. It needs to grab the global variable players_kingdom for anything associated with the player's faction.

What this effectively does is make any war damage done by a player (defeating an enemy party, taking a castle, pillaging a village, etc) not count toward the war damage in the various scripts. This is probably a big reason people are having so much trouble making peace, since the faction doesn't consider the damage done even after the player wipes out every army they have.

A quick fix is to just toss in:
(try_begin),
    (eq, ":winner_faction", "fac_player_faction"),
    (assign, ":winner_faction", "$players_kingdom"),
(try_end),

everywhere that it sets the :winner_faction variable (two places, for some reason - not sure why it has the second place when the variable is set in the start of the script).

This faction confusion may be causing problems in other scripts too, I haven't searched.
 
TheMageLord said:
(try_begin),
    (eq, ":winner_faction", "fac_player_faction"),
    (assign, ":winner_faction", "$players_kingdom"),
(try_end),

Awesome. I was wondering why it was almost impossible to make peace with an enemy king even with 99 rtr and a faction down to their last castle. Question though, since I'm ignorant about programming, would I just insert (eq, ":winner_faction", "fac_player_faction"), (assign, ":winner_faction", "$players_kingdom"), between the existing (try_begin) and (try_end), or would I insert the entire block? Or would I need it to replace anything in the script? I'd like to give this a shot, but don't want to change to code in 20 different places to find out I caused a CTD.
 
I have the same problem but I have no idea how to change it the way you do. All I get when I open the script file is a bunch of numbers.

Help would be appreciated  :smile:
 
-Storm said:
I have the same problem but I have no idea how to change it the way you do. All I get when I open the script file is a bunch of numbers.

Help would be appreciated  :smile:

http://forums.taleworlds.com/index.php/topic,111706.0.html
 
-Storm said:
nood said:
http://forums.taleworlds.com/index.php/topic,111706.0.html

I've downloaded that now, but I'm not really sure what you want me to do with it?

Well, I'd quite like rideable camels or perhaps some more hats.
Thanks.

It's the module system, instructions, etc are in the mod board: http://forums.taleworlds.com/index.php/board,64.0.html
 
All I want is to add the OP fix (the quote) to the script.txt file, but I'm unsure where to place it.

(try_begin),
    (eq, ":winner_faction", "fac_player_faction"),
    (assign, ":winner_faction", "$players_kingdom"),
(try_end),
 
nood said:
Well, I'd quite like rideable camels or perhaps some more hats.
Thanks.

It's the module system, instructions, etc are in the mod board: http://forums.taleworlds.com/index.php/board,64.0.html

Why do you have to be an A$$hole when someone just wants help with something counter-intuitive to most computer users? He asked a fairly specific question (eventually) and was polite. If you don't know the answer, don't respond. Your unhelpful rudeness doesn't educate people on what YOU feel they should already know, you retard. If its a stupid question or unanswerable, it'll sink to the back of the board never to bother your delicate brain ever again. Yet if you reply like a jacka$$, then it forces people like me to try and demonstrate how your social upbringing has failed you. Maybe it was school? Parents? Someone taught you that you can talk to people like that. Thanks for helping improve the Warband community through snarky, immature behaviour. All of us rookies who are interested in learning more about modding and game design have been extolled and edified by your comments in this thread.
 
-Storm said:
All I want is to add the OP fix (the quote) to the script.txt file, but I'm unsure where to place it.

(try_begin),
    (eq, ":winner_faction", "fac_player_faction"),
    (assign, ":winner_faction", "$players_kingdom"),
(try_end),

I am no expert these days in programming, though I wrote several games in machine code for the old Spectrum and the BBC, and later in an easier format for use with assemblers, but it goes something like this, though someone with more knowledge can correct me.

Unfortunately it's not as easy as finding the script to alter and entering the text as shown, ( it lives in the module folder, native in this case, but it could be litus or whatever module you have loaded, and is a text document called "scripts").
You cannot just enter the text as shown, it needs to be converted with a program you can download, might be the one mentioned, I do not know, but either way unless you become familiar with the software involved, it will not be easy.
I think the TheMajeLord was passing the comment to the Devs, or those who can code, in which case someone might post the actual text needed to enter manually into the script, and not in it's "basic" form which is what is shown. A bit like the registry in your computer operating systems you might have seen.
If this is wrong then can someone please clarify.  :smile:
 
To apply the fix, you first need to setup the module system, which is explained here; open the "module_scripts.py" file and make a search for
"battle_political_consequences"
which you should find on line 38,238; then make another search for
(store_faction_of_party, ":winner_faction"
which you should find two in that section, on lines 38,250 and 38,289. You need to add TheMageLord's code after each of the two lines found, to look like this:
(store_faction_of_party, ":winner_faction", ":winner_party"),
(try_begin),
    (eq, ":winner_faction", "fac_player_faction"),
    (assign, ":winner_faction", "$players_kingdom"),
(try_end),
And then you need to build the module as specified in the previous link - either point export_dir in module_info.py at ".../Modules/Native" or run it on a copy of that folder and start new save games. Bear in mind that this will overwrite any tweaks you have made manually or with tools like TweakMB.

Or, you could just wait until the next version is released, the bug report is marked "Fixed-Needs confirm" :wink:
 
Thanks for the answers guys. Silly of me not to realize nood was just trolling.

Trying to install that Python thing made my pc crash, so I think I'll hold of my empire-building plans until the next patch  :mrgreen:
 
TheMageLord said:

So I just put
(try_begin),
    (eq, ":winner_faction", "fac_player_faction"),
    (assign, ":winner_faction", "$players_kingdom"),
(try_end),
at both places it mentions :winner_faction in module_scripts and this problem is solved? Cool. :smile:

You seem to have knack for solving problems others didn't even notice yet, nice work!
 
Back
Top Bottom