Bay 12 Games Forum
Dwarf Fortress => DF Modding => Utilities and 3rd Party Applications => Topic started by: samanato on December 03, 2014, 05:43:07 am
-
Hi all,
I wanted to use a script for a hard food industry mod, that forces rottable food items to rot anywhere, even a stockpile. Putnam gave me these three lines of code (just a single call if I read this right), which should make the rot timer on all rottable food items count down. For some reason it doesn't appear to work though. Normally unattended items rot in a fortnight, and ideally I would like it to happen in a month or less while stored, but even after three months of being stored in a stockpile all items are intact.
for _,item in ipairs(df.global.world.items.other.ANY_CAN_ROT) do
item:incrementRotTimer()
end
I named the script foodrot.lua and in the onLoad.init called "footrot enable". I'm not sure if the call is running too slowly (not incrementing through all items at once, as he suggested) or if it's not registering at all, maybe because of the item vector itself (also suggested), or some other problem?
-
Food rot timers are reset as long as they're sitting on a stockpile, so you'll need to use some other method.
-
Could you make extra vicious vermin?
-
Food rot timers are reset as long as they're sitting on a stockpile, so you'll need to use some other method.
Ah, too bad. If that doesn't work, I'm thinking of replacing the rot timer call with the wear timer, which if I remember does work in stockpiles. It would ideally take longer for food to "rot" in this manner, maybe reaching the x's at about 3 weeks & completely deteriorating after two(?) months. Not sure, how the variables for the wear timer call work though.
-
Food rot timers are reset as long as they're sitting on a stockpile, so you'll need to use some other method.
Is there a way to just set the rot timer directly, or better yet just flag something a rotten? I don't recall stockpiles having the magical ability to freshen already-rotten food.
-
Is there a way to just set the rot timer directly, or better yet just flag something a rotten? I don't recall stockpiles having the magical ability to freshen already-rotten food.
Testing with the lua printall, the rot-timer is just permanently stuck to 1 when it's in a stockpile.
It might be a better idea, to just directly switch the rotten flag on after the item passes a certain age. Would like to know too, if it's possible to modify the script to do this.
-
ptw
-
Necroing to let watchers know that someone has made a script that does this. http://www.bay12forums.com/smf/index.php?topic=150782.0
-
That's very neat, and yeah, it should be mentioned over here too.