I have a simple interaction with food items. Eat a usable item, gain a state that lasts for 3000 steps. Yet, it seems like no matter what it always removes after 200 steps (I have a step counter to tell) and even when lasting multiple turns, if the battle lasts 1 turn it auto removes as well. Any ideas on what's going on?
State auto removal too quick?
RPG Maker VXAce SupportDo you have any scripts currently installed?
I'd like to see how you setup your state in your database though. Maybe you clicked something that you should not
I unchecked the "remove after battle" to fix that one. But my states still auto remove after 150 steps or less. : /
Here is the thing. You checked both remove on turn end, and remove by walking. The default game script treat one turn as 20 steps. In battle, you passed a turn means 20 steps. In map, you stepped in a tile 20 times means one turn. Wondering why the stats only last for one turn in battle, and why it's not 3000 steps?
Reason? The default was designed like this so that the DoT type of states also affect the player on map. Like when you're poisoned, and poison last for 5 turns. You will get hurt every 20 step for 5 times.
Now, what you wanna do? You can remove the turn end removal so it will be permanent in battle. So it will only removed when you're walking on map. Or you want something else? I might edit how the default script works for it
Reason? The default was designed like this so that the DoT type of states also affect the player on map. Like when you're poisoned, and poison last for 5 turns. You will get hurt every 20 step for 5 times.
Now, what you wanna do? You can remove the turn end removal so it will be permanent in battle. So it will only removed when you're walking on map. Or you want something else? I might edit how the default script works for it
If there is any possible way I could somehow have both restrictions work independently of each other while still being applicable to the same state I would be very grateful. Having the buffs last an entire battle would be a bit broken and make other items and some mechanics pointless. Even just changing how many steps = 1 turn would help.
Removing the turn end on map function would works for you. Do note that DoT state type may cease to work in map as well. Try this to put in your script list and see if it solves your problem
Code:
class Game_Actor
def turn_end_on_map
end
end
That does fix the initial problem, but your theory was correct. It stops DoT's from working on the map. If there's any fix for that or like I suggested earlier, a way to manipulate how many steps equalize 1 turn in battle that would be amazing. But if not thank you anyways. This did help me.
Problem with manipulate how many steps is equal as one turn is that it won't work for individual state. You changed it, everything changed. Anyway, I tried to come up with more versatile option. Now you need to include the state ID that you wish the turn count left won't go down while you're walking on the map.
It's untested though
Code:
class Game_Battler
MapState = [20] # <-- Put state id here. For multiple states id, use comma
def update_state_turns
states.each do |state|
next if MapState.include?(state.id) && !$game_party.in_battle
@state_turns[state.id] -= 1 if @state_turns[state.id] > 0
end
end
end
Honestly, I'd suggest you use a different calculation. 3000 steps is an entire 140 x 140 dungeon for me. Do you really need the player to keep it that long? I'd say just figure out how many rounds in battle you want it to last, figure out how many steps is the average fight, then do 20 * the number of rounds in battle + steps between fights * number of battles you want it to last, and use that for the number of steps figure.
Also note that if you have a CTB or ATB system the turns in battle count is going to be off as well, as those count turns differently.
Also note that if you have a CTB or ATB system the turns in battle count is going to be off as well, as those count turns differently.
Thank you so much. It works like a charm. DoT's now work correctly as well. And yes, I did lower the step count. Thank you so much for taking the time to help me.
Original thread: https://forums.rpgmakerweb.com/threads/state-auto-removal-too-quick.88325/