How to advance turn counter outside of battle scene

Poppie360

chocobo wrangler
Veteran
Joined
Feb 28, 2018
Messages
180
Reaction score
54
First Language
English
Primarily Uses
RMMV
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.



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


How do I do that? (I have looked through the rpg_managers, rpg_objects, and rpg_scenes and I couldn't figure it out.)
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,695
Reaction score
1,113
First Language
Portuguese - Br
Primarily Uses
RMMZ
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.
 

Poppie360

chocobo wrangler
Veteran
Joined
Feb 28, 2018
Messages
180
Reaction score
54
First Language
English
Primarily Uses
RMMV
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...)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,668
First Language
German
Primarily Uses
RMMV
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.
 

Poppie360

chocobo wrangler
Veteran
Joined
Feb 28, 2018
Messages
180
Reaction score
54
First Language
English
Primarily Uses
RMMV
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.

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.
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,668
First Language
German
Primarily Uses
RMMV
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.
 

Poppie360

chocobo wrangler
Veteran
Joined
Feb 28, 2018
Messages
180
Reaction score
54
First Language
English
Primarily Uses
RMMV
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)


  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 )
 
Last edited:

Poppie360

chocobo wrangler
Veteran
Joined
Feb 28, 2018
Messages
180
Reaction score
54
First Language
English
Primarily Uses
RMMV
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:



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)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,975
Members
137,563
Latest member
cexojow
Top