Pre-made (Yanfly's) Action Sequence Sharing and Discussions

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
1,816
Reaction score
936
First Language
English
Primarily Uses
RMMV
Hmm...so I need to have 'end' in several places? I thought end was only used at the very end of the statement.
It is, but you have multiple statements. You don't need it before an "else," but you do need it before doing another "if" unless that's supposed to be nested inside the first condition.
Code:
//This changes the animation if it's critical
     if target.result().critical
     animation 98: target
     jump target: 100, 60
     end
You don't want this (and every place like this), because you have an "else" for this condition.
//Skill hits twice at this mastery level
Right here is where you have an error, because if you were following your indentation and your "ends," all of the code after this is still inside your first condition of skill mastery level >=1.
//This is the single hit version if it's mastery level zero
Which means this is going to have unexpected behavior, because you didn't have the correct number of "ends" from the beginning, so you're saying
"if skill mastery is greater than 1, and now if skill mastery is <= 0," which will never evaluate to true.

So, again, the correct format is:
Code:
if
    stuff
end
or
Code:
if
    stuff
else if
    other stuff
else if
    other different stuff
else
    yet more stuff
end

Similarly,
Code:
if
    stuff
    if (still needs the first if to be true to see this!)
        other stuff
    end
end
 

Yuuzal

Villager
Member
Joined
Oct 26, 2020
Messages
7
Reaction score
3
First Language
English
Primarily Uses
RMMV
Okay, I think I’m tracking now. The format is “If….else…end”. I thought it was like “if….end….else….end”. So if I’m using “end”, it’s being used to conclude the preceding “if” statement. Thanks for your help, it was probably time to learn this properly anyways.
 

Novam4a1

Veteran
Veteran
Joined
Nov 2, 2020
Messages
35
Reaction score
7
First Language
English
Primarily Uses
RMMZ
Having an issue with an Action Sequence of mine, looking for some help.

1) an ability of mine checks for if an enemy is affected by a state, then it does something extra by using Conditional Branch: If BattleManager._target.isStateAffected(stateid). This works if my target is affected by the state and the ability I use is a single target ability targetting that enemy (works as intended).

2) an ability of mine checks for if an enemy is affected by a state, then it does something extra by using Conditional Branch: IF BattleManager._target.isStateAffected(stateid). If there are 2 enemies and BOTH enemies have the state and I use an AOE ability, then it works as intended.

3) an ability of mine checks for if an enemy is affected by a state, then it does something extra by using Conditional Branch: If BattleManager._target.isStateAffected(stateid). If there are 2 enemies and ONLY ONE enemy has the state and I do an AOE ability, it doesn't work as intended.

Is there a way to make all 3 of these scenarios work in a single action sequence using single target and/or aoe ability if not all enemies are affected with the state?
Would I still use the script BattleManager._target.isStateAffected(stateid)

EDIT: Solved by using Conditional branches for each enemy index number (start at 0 for first enemy, 1 for second, etc.)

$gameTroop.aliveMembers()[enemyindex#].isStateAffected(stateID)
 
Last edited:

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,823
Reaction score
1,729
First Language
English
Primarily Uses
RMMV
Having an issue with an Action Sequence of mine, looking for some help.

1) an ability of mine checks for if an enemy is affected by a state, then it does something extra by using Conditional Branch: If BattleManager._target.isStateAffected(stateid). This works if my target is affected by the state and the ability I use is a single target ability targetting that enemy (works as intended).

2) an ability of mine checks for if an enemy is affected by a state, then it does something extra by using Conditional Branch: IF BattleManager._target.isStateAffected(stateid). If there are 2 enemies and BOTH enemies have the state and I use an AOE ability, then it works as intended.

3) an ability of mine checks for if an enemy is affected by a state, then it does something extra by using Conditional Branch: If BattleManager._target.isStateAffected(stateid). If there are 2 enemies and ONLY ONE enemy has the state and I do an AOE ability, it doesn't work as intended.

Is there a way to make all 3 of these scenarios work in a single action sequence using single target and/or aoe ability if not all enemies are affected with the state?
Would I still use the script BattleManager._target.isStateAffected(stateid)

EDIT: Solved by using Conditional branches for each enemy index number (start at 0 for first enemy, 1 for second, etc.)

$gameTroop.aliveMembers()[enemyindex#].isStateAffected(stateID)
You know, a much simpler way to deal per-enemy conditional checks is to do something like this:
Code:
<Target Action>
  if (target.isStateAffected(12345))
    // stuff here
  end
</Target Action>
 

Miseryfactory77

Veteran
Veteran
Joined
Dec 2, 2015
Messages
88
Reaction score
3
Primarily Uses
You know, a much simpler way to deal per-enemy conditional checks is to do something like this:
Code:
<Target Action>
  if (target.isStateAffected(12345))
    // stuff here
  end
</Target Action>
I was gonna say that best me to it lol
 

Novam4a1

Veteran
Veteran
Joined
Nov 2, 2020
Messages
35
Reaction score
7
First Language
English
Primarily Uses
RMMZ
You know, a much simpler way to deal per-enemy conditional checks is to do something like this:
Code:
<Target Action>
  if (target.isStateAffected(12345))
    // stuff here
  end
</Target Action>
Thanks! I'm using MZ with VS plugins. Is this a notetag or would just be a script I plug in to the action sequence? Also, I'm not 100% sure how evade would work with aoe attacks. For instance I do an aoe fire attack that adds a state, but if one of the enemies evades the attack, I don't want them to get the state. Do you know how I could achieve this too?
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,823
Reaction score
1,729
First Language
English
Primarily Uses
RMMV
Thanks! I'm using MZ with VS plugins. Is this a notetag or would just be a script I plug in to the action sequence? Also, I'm not 100% sure how evade would work with aoe attacks. For instance I do an aoe fire attack that adds a state, but if one of the enemies evades the attack, I don't want them to get the state. Do you know how I could achieve this too?
Oh, with VS I have no idea because I don't use it. Those plugins use their own weird action sequence system through common events or something. It's completely different than the yanfly action sequence system.
 

Kcluuqczeas

Villager
Member
Joined
Mar 16, 2017
Messages
29
Reaction score
4
First Language
Spanish
Primarily Uses
RMMV
How can I make the damage of the skill show during the animation? Like, if I got an animation of an explosions that lasts for 20 frames, and I want the damage to appear right on the frame 10 bc it's the climax of the explosion, how do I do that? I've tried with wait animation and wait and I can't make it to work..
thanks!
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
1,816
Reaction score
936
First Language
English
Primarily Uses
RMMV
How can I make the damage of the skill show during the animation?
Edit: I forgot that the action sequences don't automatically wait for animations to complete. Ignore me :stickytongue:
 
Last edited:

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,823
Reaction score
1,729
First Language
English
Primarily Uses
RMMV
How can I make the damage of the skill show during the animation? Like, if I got an animation of an explosions that lasts for 20 frames, and I want the damage to appear right on the frame 10 bc it's the climax of the explosion, how do I do that? I've tried with wait animation and wait and I can't make it to work..
thanks!
something like

Code:
action animation: targets
wait: 10
action effect: targets

Note that "wait" is in rendering frames, which is faster than animation frames so you may need to make the number larger like 30 or something. Just keep playing with the timing until the numbers pop up when you want them to.
 

Latest Threads

Latest Profile Posts

Another comic with Backstage Malak...
If you want to ask him anything, you can ask on my DeviantArt page! I'm not sure if you're allowed to do it here.
Forum tip of the day ...
If you get a temporary suspension for being a jerk to people who are trying to help you, and arguing with mods and admins, don't go making new accounts. Chances are, if you p**s us off enough to suspend you for a week, we're not going to hesitate giving you a permanent ban when you give us a reason.
E_6fAErVkAQILXu.png
I'm so close to releasing my game on steam! :blush::blush::blush:
Us:
"This game is awesome! I wish there are more games like this in the future."
Also us:
"I hate how games stopped being original and start copying other successful games."
Should've done this a few days ago but...
PRI_200136808.jpg
Rest in Peace, Sir Clive Sinclair
1940 - 2021
Entrepreneur, Technologist, Father of the Modern British Computing Industry, and protagonist of Legend of ZUN.

Without you, England's games and tech industry wouldn't be where it is.

Forum statistics

Threads
115,292
Messages
1,088,691
Members
149,927
Latest member
antodi
Top