Progressing states outside of battle

Solr

Living Weapon
Veteran
Joined
Apr 20, 2019
Messages
44
Reaction score
7
First Language
English
Primarily Uses
RMVXA
Basically I'm looking for the most efficient way to create states that turn into other states after walking a certain number of steps.
The idea is that a character would be blinded or poisoned or whatever during a battle, and if that state isn't treated (removed) with a healing item/skill after a certain number of steps, that state will transform into another state (which no healing item/skill will exist in the game to remove). Like poison that if not treated right away, it progresses into stronger poison which can no longer be treated with an antidote. The only way a player would be able to remove the progressed poison would be by visiting a hospital, an expensive and inconvenient static location.

I know that state progression scripts exist, but I don't believe any script that progresses states based on steps taken exists. I am just hoping someone can point me in the right direction, thank you in advance.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,002
Reaction score
11,318
First Language
English
Primarily Uses
RMVXA
If you want to do this without scripts, then the steps needed are:
  1. Check at battle end if poison state present
  2. If poison state present, set a variable to the step counter
  3. When step counter reaches original count plus x, check if poison state is still present (the player may have healed up) remove poison state and inflict new state.
  4. Turn off the checking event.
To do the battle end check, the simplest way is:
  1. Make a switch "After battle"
  2. Make a common event, set to parallel process and conditioned by that switch "After Battle"
  3. Inside the common event, check and change whatever you want (conditional branch "actor has state" etc) including turning ON a switch named e.g. Poison Present.
  4. At the end of the common event, the very last command, has to be "control switch After Battle OFF".
  5. In every troop (or if using base troop events then in that troop only) place a troop event that on turn 0 control switch "After Battle" ON.
Unless you have scripts which change the engine, parallel processes won't work during battlescreen - which means the common event can only start after battle has ended, even if the switch was turned on at the beginning. And since the CE turns itself off, it will run exactly once after each battlescreen.

Okay, so now you have to check to see if you need to inflict the new state. The only way I can think of doing this off the top of my head is as follows:
  1. Each map where the player could have fought and been inflicted with poison (so no need to do this on e.g. town maps) has an event, set to parallel process and conditioned by the switch Poison Present being ON. That stops it running unnecessarily.
  2. That is the event which sets the step timer and does the necessary checking and inflicting.
  3. Make sure you have some 'wait' commands in there to prevent lag. It does not need to run the check 60 times a second, once a second is fine.
  4. If poison state has been healed, the event turns off the Poison Present switch.
  5. If it has not been healed, you still need to turn that switch off after inflicting the new state, as there is no need for the new state to be inflicted again; nor do you want a parallel process to run unnecessarily.
 

Solr

Living Weapon
Veteran
Joined
Apr 20, 2019
Messages
44
Reaction score
7
First Language
English
Primarily Uses
RMVXA
If you want to do this without scripts, then the steps needed are:
  1. Check at battle end if poison state present
  2. If poison state present, set a variable to the step counter
  3. When step counter reaches original count plus x, check if poison state is still present (the player may have healed up) remove poison state and inflict new state.
  4. Turn off the checking event.
To do the battle end check, the simplest way is:
  1. Make a switch "After battle"
  2. Make a common event, set to parallel process and conditioned by that switch "After Battle"
  3. Inside the common event, check and change whatever you want (conditional branch "actor has state" etc) including turning ON a switch named e.g. Poison Present.
  4. At the end of the common event, the very last command, has to be "control switch After Battle OFF".
  5. In every troop (or if using base troop events then in that troop only) place a troop event that on turn 0 control switch "After Battle" ON.
Unless you have scripts which change the engine, parallel processes won't work during battlescreen - which means the common event can only start after battle has ended, even if the switch was turned on at the beginning. And since the CE turns itself off, it will run exactly once after each battlescreen.

Okay, so now you have to check to see if you need to inflict the new state. The only way I can think of doing this off the top of my head is as follows:
  1. Each map where the player could have fought and been inflicted with poison (so no need to do this on e.g. town maps) has an event, set to parallel process and conditioned by the switch Poison Present being ON. That stops it running unnecessarily.
  2. That is the event which sets the step timer and does the necessary checking and inflicting.
  3. Make sure you have some 'wait' commands in there to prevent lag. It does not need to run the check 60 times a second, once a second is fine.
  4. If poison state has been healed, the event turns off the Poison Present switch.
  5. If it has not been healed, you still need to turn that switch off after inflicting the new state, as there is no need for the new state to be inflicted again; nor do you want a parallel process to run unnecessarily.
Thanks for the advice. I actually had a loose idea of how to accomplish this with common events, but your idea is much more optimal. I guess I am really am going to have to common event this, but I've been trying to avoid it, because of how many characters are going to be playable in this game, and all that common event duplication can get very messy.
I say this because I recently created a common event for food item consumption trigger a giant common event increasing a variable called " x actor fullness" by a random integer within a range and causing various effects for each actor when their own fullness variable was above or below certain amounts. It got extremely messy very fast, and even though it worked, I had to get rid of the system because it was too hard to manage.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,002
Reaction score
11,318
First Language
English
Primarily Uses
RMVXA
If you are not already using it, I suggest you consider using Yanfly's Base Troop Events script (Github link, as always). That way you would only need to set the After Battle switch once instead of for every individual troop. I use this extensively, and it does streamline things a lot.

I see no reason why the common event for this should get too messy. I'm fairly sure that there is a script call that will determine if any member of the active party has a state. This would save you lots of conditionals to check each possible actor. Probably the best place to ask would be the Script Call Support Board thread.
 

Solr

Living Weapon
Veteran
Joined
Apr 20, 2019
Messages
44
Reaction score
7
First Language
English
Primarily Uses
RMVXA
If you are not already using it, I suggest you consider using Yanfly's Base Troop Events script (Github link, as always). That way you would only need to set the After Battle switch once instead of for every individual troop. I use this extensively, and it does streamline things a lot.

I see no reason why the common event for this should get too messy. I'm fairly sure that there is a script call that will determine if any member of the active party has a state. This would save you lots of conditionals to check each possible actor. Probably the best place to ask would be the Script Call Support Board thread.
Thanks for the information about the Base Troop Events, I'm checking it out right now and it looks very useful. But the thing is, a script call that checks if any member of the party has x state wouldn't help me in this situation. I would still need to create individual variables for each actor's step counter encase more than one actor is afflicted with the state, and individual conditional branches to apply the state to each actor should they get it. I'm a point right now where I am really considering if I want this feature because I remember the nightmare of my last experience creating effects for individual actors using a common event.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,002
Reaction score
11,318
First Language
English
Primarily Uses
RMVXA
You don't need individual variables of each actor's step counter because by definition all actors will have taken the same number of steps. Which is why the conditional branch just gives you 'Steps' as a variable and it's for the whole party. So that removes one layer of complexity. And the rest is, I think, just copy/paste.

Here is a screenshot of the way I would set it up (based on what I have understood you to say). Notice that you don't need the 'Else' option in any actor's check. Once I had done the first actor, I copy/pasted that check for every character, simply editing the name. The whole event, from start to finish, to 6 minutes for 5 actors.

1591853975974.png
 

Solr

Living Weapon
Veteran
Joined
Apr 20, 2019
Messages
44
Reaction score
7
First Language
English
Primarily Uses
RMVXA
You don't need individual variables of each actor's step counter because by definition all actors will have taken the same number of steps. Which is why the conditional branch just gives you 'Steps' as a variable and it's for the whole party. So that removes one layer of complexity. And the rest is, I think, just copy/paste.

Here is a screenshot of the way I would set it up (based on what I have understood you to say). Notice that you don't need the 'Else' option in any actor's check. Once I had done the first actor, I copy/pasted that check for every character, simply editing the name. The whole event, from start to finish, to 6 minutes for 5 actors.

View attachment 147264
Wait but what if one actor is afflicted, the player walks x number of steps, and another actor gets inflicted? Despite both actors getting afflicted with the poison at different times, would both states transform after the same number of steps?
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,002
Reaction score
11,318
First Language
English
Primarily Uses
RMVXA
You never specified that an actor could get infected with poison outside of battle - unless, of course, what you are saying is that your battles are so frequent that the player will get into another one before they have taken the number of steps needed to trigger the transformation. And as that battle will restart the whole process (switches, checks, setting the step counter etc.) the first character will restart the process as well, assuming that they both begin and end the battle with poison.

And as it is not possible (as far as I know) to set the steps to individual actors, rather than to the whole party, the answer to your question is 'yes'.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Not easy to find DS resources, is it? I need to make a good compilation thread linking to all the artists that do DS...
Spent a whole evening planning Stats, Animations, Abilities of 24 different weapons.. Only to realize I was just Bloating the Game. In the end i decided to stick with only 6.
Haven’t gotten over a mentor’s promotion. He deserves it, but he was the first person to be nice to me at work. It’s been hard for me to let him go.
So its confirmed MZ will have tile size locked at 48x48. So thats extremely lame. Still probably going to get it for the assets but Im gonna pout the whole time.
A friend used to ask why I don't colorize most of my drawings? The answer: I'm colorblind.

Forum statistics

Threads
99,341
Messages
964,300
Members
130,945
Latest member
studiojap
Top