MV Checking for a state within an Action Sequence (Yanfly Action Sequence Packs)

Hi guys,

Hope you are all well.

My question is pretty much what it says in the title. Is it possible to check if an actor is effected by certain state within an action sequence?

I know you can do things like this within the damage damage formular but would tis work with action sequences?


<damage formula>

if (a.isStateAffected(x)) {

value = a.atk + a.luk;
} else {
value = a.atk
}
</damage formula>

I am trying to change an actors opacity depending if he is currently affected by a state.

Any help is much appreciated,

Thank you
you can pretty much use that in an action sequence as is... just use

if (target.isStateAffected(x))
---whatever you're doing with the opacity---
end

or if it's the user, sub out target with user

Mind you tho... if you have states above the user/target's head, they tend to disappear with the user/target. so if that's fine then the above should work.
you can pretty much use that in an action sequence as is... just use

if (target.isStateAffected(x))
---whatever you're doing with the opacity---
end

or if it's the user, sub out target with user

Mind you tho... if you have states above the user/target's head, they tend to disappear with the user/target. so if that's fine then the above should work.

Hi @zerobeat032

Thx for your reply.
That's what I thought as well but I can't seem it to work... Or am I making a mistake with the code?
Please see the Action Sequence below how I have done it at the moment..


<setup action>
display action
motion SKILL: user
wait: 15
animation 195: user
wait for animation
opacity user: 0%
wait for opacity
immortal: targets, true
</setup action>

<target action>
camera focus: target
wait for camera
hide battle hud
zoom: 130%, 30
move user: targets, back, 30
wait for movement
face user: home

if (a.isStateAffected(x))
{
opacity user: 50%, 30
}
else
{
opacity user: 100%, 30
}


wait: 60
motion attack: user
wait: 10
action animation: target
wait: 2
action effect
wait: 12
move user: targets, front, 20
</target action>

<finish action>
zoom: 100%, 60
wait: 30
immortal: targets, false
clear battle log
show battle hud
perform finish
</finish action>
That's what I thought as well but I can't seem it to work... Or am I making a mistake with the code?
You...seem to have completely ignored what zerobeat said O__o

Your code still says a instead of user. It also is checking for state x, which will always fail as x is not the ID of any state in your database.

Thirdly, your syntax is entirely wrong for action sequences. According to the instructions in the Action Sequences plugin, the syntax for if/else is:
Code:
if condition
    commands
else
    commands
end

Braces are not recognized.
Hi @ATT_Turan
Thank you for your help.

In the game the code is checking for the state. I just put the "x" for demonstration.

But thank you for pointing out the other two things. I always believed that a=user...
I also didn't know the syntax for if /else in action sequences. Learned something, amazing!

It is working perfectly now thank you very much!

Original thread: https://forums.rpgmakerweb.com/threads/checking-for-a-state-within-an-action-sequence-yanfly-action-sequence-packs.149780/