How to advance turn counter outside of battle scene

SO I am making a battle system, and I cannot figure out how to implement turns into it (it is made using events and my own plugin)

However, I cannot figure out how for the life of me how to make it so states will go away per certain amount of turns in my battle system.

3e68b862c5e40dafa39fb0f98ed0a3c1.png


What I want to do is with each turn of my battle system states will go away using this thing:
d127889748e09bdf10257c5ae0039caf.png


How do I do that? (I have looked through the rpg_managers, rpg_objects, and rpg_scenes and I couldn't figure it out.)
I think this option can only be used in a Scene_Battle. Your battle happens in the scene_map?
If so, the only way i can think do that is with variables and switchs.
I think this option can only be used in a Scene_Battle. Your battle happens in the scene_map?
If so, the only way i can think do that is with variables and switchs.
Do you know of a way to make it so that the state goes away with a variable? (and before you say "use a conditional branch and remove state" that is going to be hugely impractical...)
there is no other way than to do it manually. you need something to count your turns (for example a parallel process or your main battle loop or a few other options depending on how your battle logic works), and compare that turn number with the number of turns for the state and then remove it by event command.

It doesn't matter if you consider this "impractical" - that is the ONLY way to do this, even the existing battlesystem does it that way - you just don't see it because it's in the javascript code.
there is no other way than to do it manually. you need something to count your turns (for example a parallel process or your main battle loop or a few other options depending on how your battle logic works), and compare that turn number with the number of turns for the state and then remove it by event command.

It doesn't matter if you consider this "impractical" - that is the ONLY way to do this, even the existing battlesystem does it that way - you just don't see it because it's in the javascript code.
ebc084619a8fff77b874226e80d283cc.png

I did find this however in my search, could this possibly be edited or something?

(edit: how the battle logic works is an event runs before every turn checking who is down, updating windows, and figuring out which turn is next)

Edit 2: So what I am thinking about doing is creating an object whenever a state is given to one of the actors, it'll have how long it will last and something will count how many turns it has been and remove states that have expired as it seems this function does.
and that is exactly what I described above - that function is called once per loop, the "autoremovaltiming" is a variable that has the turn number when the state should be removed and "timing" is the current turn count, to be removed when the if-function (the conditional branch) finds that both numbers are identical.

And the critical part is not this function with the conditional branch (and nothing else), it is how to do the counting and when to call the conditional branch to check.

And with that we're back at the beginning - your battlesystem needs to have turns created before anyone can tell you how to check for them.
So you need to define your battle mechanic - what is a turn, what can happen in a turn, how can the player end a turn and so on.
If you can give us those details about your battle logic, then we can help you further.
and that is exactly what I described above - that function is called once per loop, the "autoremovaltiming" is a variable that has the turn number when the state should be removed and "timing" is the current turn count, to be removed when the if-function (the conditional branch) finds that both numbers are identical.

And the critical part is not this function with the conditional branch (and nothing else), it is how to do the counting and when to call the conditional branch to check.

And with that we're back at the beginning - your battlesystem needs to have turns created before anyone can tell you how to check for them.
So you need to define your battle mechanic - what is a turn, what can happen in a turn, how can the player end a turn and so on.
If you can give us those details about your battle logic, then we can help you further.
A turn in my battle is once per each member of battle doing something, however a turn when regarding the stats would be once the max amount of members in the battle (2-6 depending on the members in battle which is easy to find with just a check of how long the party is as the enemies of the battle system are actually actors shoved into your party so that the states can be seen and you can use items on them)

9e0636e1f7425076a62f0608d2d4119b.png

  1. sets up the battle, it runs at the start of every battle and just does whatever is needed at the start
  2. sets up the turns, it checks to see if a member of battle is knocked out, if the battle has been won or lost, and says which turn is next. it runs every turn
  3. player's turn handler
  4. ally 1's turn handler
  5. ally 2's turn handler
  6. enemy 1's turn handler
  7. enemy 2's turn handler
  8. enemy 3's turn handler
  9. this even runs when the battle is won or lost, it gives a reward for winning, or a punishment for losing.
allies and enemies are all controlled by AI, they have skills they can do and all that basic stuff (the AI is actually something I am proud of, it finds a list of it's options of things it can attack, figures out what the worst option for it to attack and removes that from the list of options and picks from the remainders (unless there is only one option then it just has to pick that one)

In a turn (3-8) a member of battle may end up getting a state inflicted on them.

(here is a simplified flowchart of what happens: https://docs.google.com/drawings/d/1YycwR5fdZG_pgfEOl7nx3CcSBjmDmTfwh_O5JsPOiVo/edit?usp=sharing )
So this is what I am planning on doing and so far I think that it will work just fine and isn't a huge mess of code:
982bc9a5aff6228d1142fbbe4ed20619.png

c900035e0292152b4e5271cbec632dda.png


this function will be run each time a state is added and once a turn, that way it will update them based on the turn in battle, basically what I did was I made a function that would create an object to store the needed information about the state that is in play, it gets shoved into a list of states and once per turn it checks to see if anything needs to be added or taken away. this is actually much cleaner than I thought it would end up being.

(sorry If I double posted, I couldn't remember if it was 12 hours or 24)
not sure if you already know
but mog hunter chronoengine will be good for study
because it make mapbase turn battle too
https://atelierrgss.wordpress.com/rmv-chrono-engine/

Original thread: https://forums.rpgmakerweb.com/threads/how-to-advance-turn-counter-outside-of-battle-scene.106728/