State auto removal too quick?

coticka

Veteran
Veteran
Joined
May 30, 2015
Messages
74
Reaction score
10
First Language
English
Primarily Uses
RMMV
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?
 

Nightblade50

Developer of "Delta Origins"
Veteran
Joined
Nov 10, 2016
Messages
2,133
Reaction score
4,253
First Language
English, French
Primarily Uses
RMVXA
Do you have any scripts currently installed?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,594
Reaction score
6,525
First Language
Indonesian
Primarily Uses
RMVXA
I'd like to see how you setup your state in your database though. Maybe you clicked something that you should not
 

coticka

Veteran
Veteran
Joined
May 30, 2015
Messages
74
Reaction score
10
First Language
English
Primarily Uses
RMMV
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. : /
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,594
Reaction score
6,525
First Language
Indonesian
Primarily Uses
RMVXA
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
 

coticka

Veteran
Veteran
Joined
May 30, 2015
Messages
74
Reaction score
10
First Language
English
Primarily Uses
RMMV
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.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,594
Reaction score
6,525
First Language
Indonesian
Primarily Uses
RMVXA
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
 

coticka

Veteran
Veteran
Joined
May 30, 2015
Messages
74
Reaction score
10
First Language
English
Primarily Uses
RMMV
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.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,594
Reaction score
6,525
First Language
Indonesian
Primarily Uses
RMVXA
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.
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
It's untested though
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
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.
 

coticka

Veteran
Veteran
Joined
May 30, 2015
Messages
74
Reaction score
10
First Language
English
Primarily Uses
RMMV
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.
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
It's untested though
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:
attack on titan final season is airing tomorrow, I'm excited and scared at the same time!

Forum statistics

Threads
105,881
Messages
1,017,227
Members
137,607
Latest member
Maddo
Top