Fix of the food not giving morale bug

Users who are viewing this thread

Aljola

Recruit
pesja said:
Okay this wasnt fixed in the latest version, so is there anything i can do? im running an army of 100 + so the food bonus on morale is pretty essential.. any txt files or anything that can be editet?

I run my game without modifications/edits of any kind.  I don't have that issue with food and morale.

However, one thought that comes to mind is if you have rotten beef in your inventory, maybe that's why the no food penalty is showing???
I wouldn't eat any food near rotten beef because of the flies and maggots in the vicinity.  It's just a thought...
 

Red River

Sergeant Knight
Sepher said:
Also, why is it that when you win a battle the opposing side never has any food? Are the looters the only ones that eat anything in all of calradia?!
I think at this point I spend more money on food for the army than on their wages!

good point. only in my game even looters have no food....

also food bonuses matter only when your actual morale is higher than the modfiers. it's then subtracted and ya get the recent events #. with a morale below 99 try to add more food variety and notice how the total won't change. what will change is the recent events. it will decrease :smile:
 

The Mercenary

Grandmaster Knight
Ringwraith #5 said:
Or perhaps it's due to the fact that you can undress girls (up to a point anyway, we need a Better Bodies mod for M&B :razz:).

Of course you'd want it, you guy-playing-a-girl.
 

Olorin

Sergeant
Pii100 said:
Ringwraith #5 said:
I think he means the booze. That no longer gives any bonuses at all and isn't even consumed.
I think mod makers fix that soon. Someone had a theory of having them not consumable to lower the age rating of game, or something to make it more suitable for younger folks.

that someone was me :razz:

i cant say thats why ^ ^ just what i think
 

pesja

Sergeant Knight at Arms
jordan said:
pesja said:
No obviously im the only one having this problem..

Check out these screens








You get my drift? If im not constantly fighting im dropping morale.. I know its a fighting game, but common
I've bought food to increase morale, and, if I'm remembering correctly, the increase did not occur until the next day.  Just prior to your screenies, did you run out of food and then buy a bunch?

Its been like that since day one


Aljola said:
pesja said:
Okay this wasnt fixed in the latest version, so is there anything i can do? im running an army of 100 + so the food bonus on morale is pretty essential.. any txt files or anything that can be editet?

I run my game without modifications/edits of any kind.  I don't have that issue with food and morale.

However, one thought that comes to mind is if you have rotten beef in your inventory, maybe that's why the no food penalty is showing???
I wouldn't eat any food near rotten beef because of the flies and maggots in the vicinity.  It's just a thought...

Look at the screens.. I have more than just beef
 

rageshrub

Knight at Arms
M&B
So have you or haven't you tried with a fresh install? You could just install a new copy into another folder and see if it works. Also, try with a new game. If that all fails, reformat.
 

pesja

Sergeant Knight at Arms
rageshrub said:
So have you or haven't you tried with a fresh install? You could just install a new copy into another folder and see if it works. Also, try with a new game. If that all fails, reformat.

I just tried to start a new game again. It worked all fine now.. damn it i hate starting new  games when im in the middle of something..
 

Ruthven

Baron
WBM&BVC
gyrobot said:
The reasoning for that is so the Soldiers wont consume the ale/wine supplies for the transport missions.
aactually, in the module system for 960 there are quest ale and quest wine or something, so I expect it would be like that in 1.0. that means normal ale and wine could be consumable.
 

TheMageLord

The Handyman Can
Knight at Arms
M&BWB
I just had this happen to my games, so I looked into it and found the problem. I'm not sure what exactly causes it, but what happens is all the food items lose their morale modifiers - if you look at the food item it will say +0 morale (as your screenshot shows). The way the morale script determines that you have no food is that you have 0 morale bonus, so 0 morale bonus food does not count as food in morale terms (so you'll get a whopping -30 on top of the missing bonus).

Heres a fix for it.

Open up scripts.txt and search for get_player_party_morale_values.
The standard morale script looks like this:
get_player_party_morale_values -1
44 1650 2 1224979098644774912 648518346341351424 2133 2 1224979098644774913 0 6 3 1224979098644774914 1 1224979098644774912 1652 3 1224979098644774915 648518346341351424 1224979098644774914 4 0 1507 1 1224979098644774915 2105 2 1224979098644774913 3 5 0 1653 3 1224979098644774916 648518346341351424 1224979098644774914 2105 2 1224979098644774913 1224979098644774916 3 0 3 0 2133 2 144115188075856312 1224979098644774913 2170 3 1224979098644774917 1369094286720630785 360287970189639680 2122 3 144115188075856313 1224979098644774917 7 2133 2 1224979098644774918 144115188075856313 2106 2 1224979098644774918 144115188075856312 2105 2 1224979098644774918 50 2133 2 144115188075856314 0 6 3 1224979098644774919 288230376151711814 288230376151711826 1 3 936748722493063328 1224979098644774919 41 527 3 1224979098644774920 1224979098644774919 1 2105 2 144115188075856314 1224979098644774920 3 0 2105 2 1224979098644774918 144115188075856314 4 0 31 2 144115188075856314 0 2133 2 144115188075856315 30 2106 2 1224979098644774918 144115188075856315 5 0 2133 2 144115188075856315 0 3 0 2133 2 144115188075856316 0 4 0 32 2 144115188075856031 0 1 1 936748722493063285 2133 2 1224979098644774921 72057594037927936 2122 3 144115188075856316 144115188075856031 10 2108 2 144115188075856316 1224979098644774921 2112 3 144115188075856316 1 31 2106 2 1224979098644774918 144115188075856316 3 0 2112 3 1224979098644774918 0 100 2133 2 72057594037927936 1224979098644774918

You need to add in this:
507 3 288230376151711814 1 5 507 3 288230376151711815 1 5 507 3 288230376151711816 1 7 507 3 288230376151711817 1 6 507 3 288230376151711818 1 4 507 3 288230376151711819 1 5 507 3 288230376151711820 1 5 507 3 288230376151711821 1 6 507 3 288230376151711822 1 10 507 3 288230376151711824 1 4 507 3 288230376151711823 1 5 507 3 288230376151711825 1 8

right after the blue highlighted number (30). And then you need to add 12 to the highlighted red number, so that it is 56 (this is so that it can read the 12 extra lines that you just pasted in).

So your morale script should look like this (lines added in blue):
get_player_party_morale_values -1
56 1650 2 1224979098644774912 648518346341351424 2133 2 1224979098644774913 0 6 3 1224979098644774914 1 1224979098644774912 1652 3 1224979098644774915 648518346341351424 1224979098644774914 4 0 1507 1 1224979098644774915 2105 2 1224979098644774913 3 5 0 1653 3 1224979098644774916 648518346341351424 1224979098644774914 2105 2 1224979098644774913 1224979098644774916 3 0 3 0 2133 2 144115188075856312 1224979098644774913 2170 3 1224979098644774917 1369094286720630785 360287970189639680 2122 3 144115188075856313 1224979098644774917 7 2133 2 1224979098644774918 144115188075856313 2106 2 1224979098644774918 144115188075856312 2105 2 1224979098644774918 50 2133 2 144115188075856314 0 6 3 1224979098644774919 288230376151711814 288230376151711826 1 3 936748722493063328 1224979098644774919 41 527 3 1224979098644774920 1224979098644774919 1 2105 2 144115188075856314 1224979098644774920 3 0 2105 2 1224979098644774918 144115188075856314 4 0 31 2 144115188075856314 0 2133 2 144115188075856315 30 507 3 288230376151711814 1 5 507 3 288230376151711815 1 5 507 3 288230376151711816 1 7 507 3 288230376151711817 1 6 507 3 288230376151711818 1 4 507 3 288230376151711819 1 5 507 3 288230376151711820 1 5 507 3 288230376151711821 1 6 507 3 288230376151711822 1 10 507 3 288230376151711824 1 4 507 3 288230376151711823 1 5 507 3 288230376151711825 1 8 2106 2 1224979098644774918 144115188075856315 5 0 2133 2 144115188075856315 0 3 0 2133 2 144115188075856316 0 4 0 32 2 144115188075856031 0 1 1 936748722493063285 2133 2 1224979098644774921 72057594037927936 2122 3 144115188075856316 144115188075856031 10 2108 2 144115188075856316 1224979098644774921 2112 3 144115188075856316 1 31 2106 2 1224979098644774918 144115188075856316 3 0 2112 3 1224979098644774918 0 100 2133 2 72057594037927936 1224979098644774918

What all those numbers do is set the morale bonus on the 12 food types back to what they're supposed to be. The place that you pasted it in is right where it's applying the 30 morale penalty, so it will only set it all again when you're either experiencing the bug or genuinely out of food. I don't think setting it every time you actually run out of food would hurt anything, but you could change it back after the bug is corrected if you wanted to.

After you make the change, just open your morale menu. The first time you open it it will display the -30 still, but the bonuses will have been set back correctly. Open it again and you'll see the correct morale bonus and everything will be fine.

It fixed my game, hopefully it fixes yours.

Link to other tweaks.
 

TheMageLord

The Handyman Can
Knight at Arms
M&BWB
It has nothing to do with cow meat, things simply lose their bonus. I have never ever had cow meat long enough to spoil, and the bug randomly hit me. Cow meat spoilage doesn't do anything to the bonus of foods, either - it simply gets set as not edible once it has a spoiled tag. Test it and see if you like, buy cow meat and wait for a while. It will spoil, leaving you with a message saying the party has no food. Buying food (even without getting rid of the spoiled meat) allows you to eat again just fine.

You don't actually get a "The party has no food!" because you DO have food, the food just doesn't have a bonus. And for the morale script, it only reads the bonuses - not the amount. So when you have 0 bonus food it says you have no food and applies the penalty, due to the way the script is set up. The part where it actually consumes food doesn't use the bonus, thus it still works.
 
So how about the weird non-consumable and bonusless wine and ale, can you fix that too? Please, please, pretty please with sugar on top? :grin:
 

TheMageLord

The Handyman Can
Knight at Arms
M&BWB
Well, making wine and ale consumable would only require you to adjust the 3 scripts and 1 trigger that reference food to include ale and wine, but the consequence would be that you could feed your army on nothing BUT wine or ale - because it wouldn't distinguish between normal food and it. The morale script used to distinguish between ale/wine and other foods, applying the -30 penalty if you only had ale or wine, but it has been changed in 1.003. In 1.003 it just checks for food bonuses, and if you made it accept ale/wine bonuses then it would also accept ale/wine as food when checking for no food.

Considering the high weight of ale/wine and the low bonus it gives (5 for wine, 4 for ale), it might not be worthwhile to carry it anyway - when you could just carry butter/honey instead.

If you want to make the change anyway, go into scripts.txt and search for
288230376151711814 288230376151711826
The first number being fish, the second being wine. This is the range used to see if the item is food. It's actually counting greater than or equal to the first and less than the second, so to get it accepting ale/wine we need to change the second one to the item after ale - spice. Which is just +2 in the order of items, so just change the 26 at the end to 28. You need to change this in all 3 instances of it in the scripts file (first instance is setting the item's text bonus to display, second is calculating it into morale bonus, third is actually consuming it) and then open up simple_triggers.txt and search for the same line - you'll only find one instance, and this is the part that actually triggers the eating of food, or gives you the "No food" message.

Like I said, this just makes it act as any other food - you can live off wine/ale alone with this change.

You can also edit the morale bonus it gives you, if you want - since most other stuff has been increased. Just search for
507 3 288230376151711826 1 5 507 3 288230376151711827 1 4
in the scripts.txt file - it will be near the top. The 5 and 4 are the morale bonuses of wine and ale, respectively.

And while I'm on that, if you get the food bug the wine/ale would be reset to 0 too - so you would need to add in those two lines to the ones added in the fix for the food bug - just stick them at the end of the other stuff you pasted in, and add an extra 2 to the number at the top.

Link to other tweaks.
 

Zandman

Sergeant at Arms
Like I said, this just makes it act as any other food - you can live off wine/ale alone with this change.

Is it possible to find and list the codes for spices, salt and grain, e.g.?
I'd love to be able to add spice as an edible item in times of need - say it has a very high morale boost, but is consumed really fast (if it's possible to set consumption rates independently for each item).
It would be a nice alternative to paying my troops for their happiness, which I thought would be the most logical thing to implement: Increasing wages instead of making them happy by sending them into battle... which is just insane.
 

pesja

Sergeant Knight at Arms
yeah salt and spices should def had morale boost from the start.. Imagine eating food without salt while your marching around for some months... I bet no one here has even gone a full day without any salt at all
 

TheMageLord

The Handyman Can
Knight at Arms
M&BWB
Spice is 288230376151711828, salt is 288230376151711829, wheat is 288230376151711830, flour is 288230376151711831 and so on down the items list. If you wanted to make all four of those consumable you'd need to set the range to
288230376151711814 288230376151711832
Which is a range greater than or equal to 288230376151711814 (fish) and less than 288230376151711832 (iron), so 'food' would include everything in that range.

By default they have no morale value, though - you'd have to go into the scripts to game_start and set a value for that by adding
507 3 288230376151711828 1 # 507 3 288230376151711829 1 # 507 3 288230376151711830 1 # 507 3 288230376151711831 1 #
right after where ale is set (507 3 288230376151711827 1 4). Make sure to change the #s to the morale bonus you want them to give. Also make sure to go up to the beginning of game_start of the file and add some to the 1074 at the top. If you add all 4 lines you need to add 4 to the number, so 1078. (thats the # of lines in the script, so you have to increase it since you're adding lines to set the food values)

And then to make the items actually have an amount, like other food items, you have to go into item_kinds.txt and find salt and spice.

Just find
itm_spice Spice Spice 1  spice_sack 0  65547 0 880 0 40.000000 25 0 0 0 0 0 0 0 0 0 0 0
0
and change the 0's to the number you want. This is the amount, so if you wanted them consumed quickly set it low - like 10. They are VERY heavy for food, though - so if you set the amount low you may want to set a lower weight (otherwise at 10 your men are effectively consuming 4 weight worth of spice every time they eat a unit, whereas for dried meat every unit is only 0.3 weight). The weight is in red. At that cost, though - you might just want to make them consumed slower. Even a luxury item like honey is only ~4.5 per unit in cost, so even if you increased the units to 100 it would make it about 8.8 per unit in cost - more than any other food.

Do the same for salt. Wheat and flour already have the units amount set, but you could change the weight if you like.

If you wanted to be funny, you could set ANYTHING consumeable. Up the number by 2 more, add in the extra lines, and you can eat iron and oil. Mmm, iron.
 

Zandman

Sergeant at Arms
If you wanted to be funny, you could set ANYTHING consumeable. Up the number by 2 more, add in the extra lines, and you can eat iron and oil. Mmm, iron.

Thanks a lot, MageLord - you're a peach.
Mmm... peach. That would go great with my iron.
 
Top Bottom