Food Bug

Users who are viewing this thread

Iradil

Recruit
Hey there guys

Well here's the problem I've been playing a single player campaign for a while now and it was all going fine until my food stopped giving me a moral bonus, so now instead of bread giving me +3 to moral (or whatever the correct number is) it now gives me +0. This has crippled my game making it unplayable, as now my army is always unhappy no matter how many battles I fight.

I did a bit off searching around and found this topic (http://forums.taleworlds.com/index.php/topic,45864.60.html) which had exactly the same problem as me but in an older version of the Original Mount and Blade and had a fix that involved changing some of the numbers in the coding, but as the game has moved on quite a lot since then I wasn’t sure if this fix would still work.

So I was wondering if someone could help me figure out how to fix this or show me an existing fix

Thanks in advance

P.S. I’m playing version 1.132 of Warband
 
Considering that I do not have this problem in 1.132 and it reads a lot like wrongly set flags, I advise you to recompile your Native module using the module system (or to validate your game files, if you are a Steam user).
If that does not help, start a new game and see if there the modifiers apply correctly.
If that does help, just export your character from the corrupted save game.
If it does not, download the latest installer and reinstall from that file.

addendum:

If this has the same cause as what was presented in that other topic you mentioned, recompiling the Native module should do the trick. Once set up, this is a simple matter of marking a file and hitting "return", so it should be a more convenient thing to do than dabbling in the precompiled code.
 
I posted in another thread about possibly editing the wine and ale to make them consumable for Warband. If anyone has figured out how to edit scripts.txt to do such, I'd love to know.
 
You have to edit at least five different places in that file. And cannot even read what is written there.

Why not just change food_begin in module_constants.py to itp_wine and rebuild the module, being done with one entry and one execution of a shell script?

Sigh, I do know how to find out... but it is quite some work. Not worth it, to be honest.
You want a hint? I can give you a hint. Or two, even.

In simple_triggers.py, your line of interest starts with "14.0".
In scripts.txt, your lines of interest are preceded with "game_get_item_extra_text" (one value), "party_calculate_loot" (two values), "get_player_party_morale_values" (one value) and "consume_food" (one value).
There are two more occurences in "internal_politics_rate_feast_to_s9", but these must not be changed (wine and ale are in there already, as drinks).

Now, you might want to know, how to read all those numbers. Well, for that, you need to look into how these numbers are created from easily human readable script code. Afraid already?
Trace from those:

Code:
def save_scripts(variable_list,variable_uses,scripts,tag_uses,quick_strings):
  file = open(export_dir + "scripts.txt","w")
  file.write("scriptsfile version 1\n")
  file.write("%d\n"%len(scripts))
  temp_list = []
  list_type = type(temp_list)
  for i_script in xrange(len(scripts)):
    func = scripts[i_script]
    if (type(func[1]) == list_type):
      file.write("%s -1\n"%(convert_to_identifier(func[0])))
      save_statement_block(file,convert_to_identifier(func[0]), 0,func[1], variable_list,variable_uses,tag_uses,quick_strings)
    else:
      file.write("%s %f\n"%(convert_to_identifier(func[0]), func[1]))
      save_statement_block(file,convert_to_identifier(func[0]), 0,func[2], variable_list,variable_uses,tag_uses,quick_strings)
    file.write("\n")
  file.close()

Code:
def save_simple_triggers(variable_list,variable_uses,triggers,tag_uses,quick_strings):
  file = open(export_dir + "simple_triggers.txt","w")
  file.write("simple_triggers_file version 1\n")
  file.write("%d\n"%len(simple_triggers))
  for i in xrange(len(simple_triggers)):
    simple_trigger = simple_triggers[i]
    file.write("%f "%(simple_trigger[0]))
    save_statement_block(file,0, 1, simple_trigger[1]  , variable_list,variable_uses,tag_uses,quick_strings)
    file.write("\n")
  file.close()

... Now is the time to ironically wish you fun and good luck.
Told you, it would be too much work to be bothered with.
 
This is from M&B 1.011:
Code:
consume_food -1
 16 23 2 1224979098644774912 1 1540 2 1224979098644774913 360287970189639680 6 3 1224979098644774914 0 1224979098644774913 1541 3 1224979098644774915 360287970189639680 1224979098644774914 33 3 1224979098644774915 288230376151711814 288230376151711826 1542 3 1224979098644774916 360287970189639680 1224979098644774914 2147483679 2 1224979098644774916 41 547 3 1224979098644774915 0 0 507 3 1224979098644774915 0 1 2106 2 1224979098644774912 1 2147483678 2 1224979098644774912 0 2133 2 1224979098644774913 0 1537 3 1224979098644774917 360287970189639680 1224979098644774914 2106 2 1224979098644774917 1 1534 3 360287970189639680 1224979098644774914 1224979098644774917 3 0

Now, tell me you can read it. And find the occurence. It is much more easy, do you not think?

addendum:

Try these: http://www.filefront.com/17373445/modifiedScripts.zip/
Might not work, though, tell me and I will upload a complete module.
 
I also had the bug where all food gave zero morale, and my party had constant negative morale from having no food. It started appearing right after I upgraded from 1.131 to 1.132.

Reinstalling the game did nothing.

I downloaded the module stuff and python and recompiled the native mod. That fixed the food problems, but gave me a lot of other bugs in return, like empty stores, constant debug message spam and like ten other things.

I reinstalled the game again over the recompiled version, and that made most bugs dissapear, but not everything. I still have random morale gains/loss from time to time and no arena masters. There are probably even more things wrong, I only played for 15 minutes. The food works, but other stuff is now broken.

Is there a better solution/patch for this?

 
 
Alright, now I am baffled. Something must be changing your game files...

Try this:
Create a new Folder in Warband\Modules.
Copy all Subfolders of Warband\Modules\Native into the new folder.
Copy main.bmp from Warband\Modules\Native into the new folder.
Extract this archive into the new folder:
http://www.filefront.com/17377109/Native.rar/

Set all files in that folder to "read only".
Play the game with that module. Check for bugs. Report back.

... Something is quite strange there. I never had the food bug to begin with, but now this?
Oh. You do not have Windows Vista or 7, do you?
 
I'm using windows XP.

I made a test module according to your prescriptions and made a new character in it. I played for about 15 minutes and saw no bugs at all. The food worked and the arena masters were there as well. Could I rename this test mod to native and resume playing my old save in it?

In my old native version most bugs disappeared after reinstalling over the recompiled version. Two things I noticed that are still wrong is that there are no arena masters (tournaments work fine), and that the face of my character changed into something very different. The food does definitely work again.

While recompiling Native I did get some error messages. They seemed harmless, so I didn't mention them, but maybe you know if they indicate a problem. It was something about variables.txt not existing and needing to make that file, and some unused variables, mostly tutorial related. I recompiled it by changing the export dir in module_info to my Native module dir and just running the script, I didn't do anything else to the code.

 
I gave you nothing but my own Native content, so yes, it should work without flaw. Alas, that is what it should do from a fresh installation as well...
On more than the first thought though, if you saved when the arena masters were already gone, they will most likely not return.

Could you, mayhap, give me the text files in your Native folder as well, so that I can take a look?
I will not be able to see what is different, at least not in great detail, but there might come something of use out of this.
Also, I would like to know how the sliders of your characters face changed. Approximately assign numbers to their positions starting with zero farthest to the left and, say, ten at the right end.
... Some of these sliders are not saved in the face code, so it is natural that faces differ between exporting and importing characters - not within one and the same save game, mind you, but I will check if only these are affected or not.

... At last, this is how compiling a module is supposed to look like as of 1.132:
buildmodulebat.jpg
 
I did a diff between the two sets of text files, they were exactly identical. So the arena master problem is something that is damaged in the save game I guess. I don't have an old installation anymore where the food bug is present, so I can't compare those text files.

I can't say exactly how the sliders changed, since the first face was generated randomly and I don't remember how it was exactly. The most obvious changes: There used to be a ponytail and a beard, now he's completely bald and beardless. The bottom half of the face is also extremely weird and narrow, like all sliders from the bottom on are set (almost) completely to the left. I never imported or exported my character, I just opened the same save in diferent versions/installations.

The compilation warnings look exactly like I remember them, that seems ok.

Another bug in my save I just noticed is that the craftsmen in the businesses you can build like the wine press are bugged. They all have names like {!}Town 3 Merchant and {!}Town 16 Senechal. Some of them also removed their clothes and put them in their own inventories.
 
Back
Top Bottom