My project is starting to rely fairly heavily on states, but there are a lot of foundational things about them that I don't know, and that don't seem to be covered in the manual or online materials. Speaking just of the default battle system without any customized scripts...
1.) If you use a state-inducing move on an enemy (or visa versa) while an identical state is already in effect, what happens? Does it refresh the duration? Do nothing at all? Stack on top of the first for double the effect?
2.) Same as above, but if a different state is in effect. As an extension to this, can a single actor/enemy be affected by multiple states simultaneously?
3.) How exactly does state duration work? I thought it was self-explanatory, but I keep seeing one-turn states persist for a second turn. Particularly when adding a state through eventing at "end of turn".
4.) Do states behave differently when applied manually (through eventing) as opposed to being applied as the side-effect of a skill being used?
5.) Is there any kind of code, variable, etc. etc. that is capable of checking whether an actor/enemy is currently afflicted with a state? I'm not concerned over specific state vs any state, either check would work.
Thank you for any help with these questions. I hope they made sense. :blush:
The finer points of states?
● ARCHIVED · READ-ONLY
-
-
As I'm working a lot with states myself I did a lot of testing so:
1.) The duration gets refreshed when a state is already inflicted.
2.) Different states stack, so anyone in the battle can be affected by multiple states, unless you set up the states to not do so. (there is a checkbox for that)
3/4.) Don't know, never saw a state behaving like that but I haven't tested it with eventing either.
5.) You can check it with .state?(id) in damageformulars (and scriptcalls as well I guess?) where id is the state's id. Also it is possible with conditional branches to check wether a specific actor or enemy has a specific state on him. And last but not least you can also let enemies use different skills if they are affected by a specific state.
EDIT: Srsly Maliki we both replied the same time? xD -
I'll do my best to answer these. I have a few scripts in place that address these questions in the scope of my project and may not give the answer as it would apply in a vanilla project.
That said, if anyone else can elaborate on anything I get wrong, that would be great.
And so...
1. I believe when you have a state and someone tries to put the same state on the duration resets. Not sure of this cause I have a script which adds turns when this happens.
2. As long as the states are different (Different IDs in the database), they will act independently of each other. So if one actor is paralyzed and then they get a shadow hold (or whatever) that acts the same as Palszy, the actor will not move until BOTH states are removed.
3. I believe that in the default settings a state's turn count is reduced in the "end turn" after everyone that can act does.
If at that point the duration is 0, then the state is removed.
So the stun state which has a duration of 0 will only last the turn it is inflicted while something that has a duration of 1 will last till the end of the infliction and then till the end of the next turn.
4. Not at all. You set the behavior in the database. The manner by which you inflict them doesn't matter.
5. You can check for whether someone has a state in the damage formula.
Using a.state?(x) will check if the attacker has state x at the time of the attack.
Using b.!state?(x) will check if the defender or target does NOT have state x.
Hope this helps!
(Ninja'd...) -
Thanks a lot, you two! That information helps me greatly, especially the bit about "duration 1" states being able to last two turns - the turn inflicted and the following "1" turn. That explains some of what's been happening with my events. I'll give both the script calls and the eventing solution a try, for checking enemy states.
Question answered. :cutesmile: