Skychord

Generic
Member
Joined
Jan 5, 2019
Messages
11
Reaction score
13
First Language
Indonesia
Primarily Uses
RMMV
Creating Combination Moves (But only with Free YEP)



Hello everyone! When I was making my game (*cough* *cough* Fallen Hero's Journey), I decided that it would be cool to make Combination Moves! However, I was unable to find any team attacks/combination moves/cooperation skills plugin that's either not paid or compatible with Yanfly's plugins. And so, I decided to take the hard way out, making combination moves but only with YEP Free Plugin Packs.

Since I know that many people are also looking to implement Combination Moves in their game but are too poor to buy premium plugins or just don't use Victor's Engine, I figured, "Let's put this on MV Tutorial", so here it is!


Description:
Combination Moves are skills that are performed by two party members or more. In this tutorial, the type of combination move that we will be making is one that requires 2 party members selecting 2 different independent skills. Meaning that a combination move will only occur once two different party members select a certain skill.

Requirements:
- Yanfly Action Sequence Pack (Min. 1-2)
- Yanfly's Buff & States Core
- Yanfly's Auto Passive State
- Some Switches
- Some States
- Some Variables

- Some basic knowledge of scripting (If you want to customize it further)

Let's begin,

Tutorial:
1. Make your Combination Move


Sonic Dance.png

Make a new skill that will become the combination move performed by the actors. In my case, the combination move that will be used in this tutorial is called Sonic Dance.

Make sure you have the formula, action sequence, variance, message, and scope all fine and ready. Especially in the action sequence, you'd want to use "Character X" and "Character Y" as the people moving, because what you write in the skill's action sequence will be the action sequence that is used for the combination move. As for damage formula, I suggest using this:
$gameActors.actor(x).stat + $gameActors.actor(y).stat
It's so the damage output becomes the result of both the first actor and the second actor's stats.

X = The ID of the first actor who will perform the skill
Y = The ID of the second actor who will perform the skill
Stat = The stat you want to use (atk, mat, agi, luk, mdf, def)

For me, I will make x as 1, and y as 3, and stat as atk because this move can only be performed by Actor 1 and Actor 3 and it will calculate the damage with their Physical Attack.



2. Create some New Variables

1641621507749.png
The second step is to create some variables, one for each of your actors. It's better to name those variables your actors' names + target on the back just so you'll have a better understanding of which variable is for whom.

The purpose of these variables is to store the ID of the enemy the actor targeted in that turn. Further explanation will be explained in the next step, for now, make those variables.



3. Create States

1641621267391.png
The next thing you need to do after creating a new Skill is to create a new State. This state will be very important as it is used to check which enemy was targeted by the actor at the start of every turn. The ID of the enemy will be stored inside the variables that were previously made.

Don't change anything on the state, and I suggest not putting any icon too. The only thing you need to do is add this in the state's note:

<Custom Turn Start Effect>
$gameVariables.setValue(z, $gameActors.actor(x)._actions[0]._targetIndex)
</Custom Turn Start Effect>
Z = The variable that you made before
X = The Actor's ID

If you followed my steps before where I said to name the variables as actors' names, it's for this purpose. Put the corresponding variable ID and actor ID in the script. Make sure to create a state for each actor and edit the z and x to correspond with their IDs.
For me, I've put z as 102 and x as 1. For the next state, I put z as 103 and x as 3.

The ._actions[0]._targetIndex is the line that returns the enemy ID targeted by the player, if you're wondering. The target index will change when the actor performs a move, so it needs to be checked at the start of each turn.


Other than that, you also need to create a state that makes the actor cannot move. Just make a new state and put the removal conditions as follows:

1641628421878.png




4. Create Switches

1641624092238.png
Last but not least, before we go into the beefy stuff, we need to make a switch. Name the switch after the name of your Combination Move, in this case, I've named it Sonic Dance. If you plan to make more combination moves, then go make more switches!



5. Make the Condition to Trigger the Combination Move


This step is arguably the most important part of the process, decide which skills and conditions will be used to trigger the combination move.

1641624812795.png

For me, I've decided to use these 2 skills that I've redlined as the ones that will combine. I'm not sure if you can use the same skill but with different actors. You probably can, considering the logic that will be used, but, for now, we'll combine two separate skills.
If you want to be even more creative, you can even make it so that the combination move only triggers if the enemy has a certain state or not. Don't worry, since that mechanic is in my game, I'll also cover it in this tutorial. So let's continue.


And so, this is the scariest part of the tutorial, the Skill's Notes. Pick one of the two skills that will be used to trigger the combination move, I'm sure that if you use YEP Action Sequence Pack, you probably have some sort of action sequence already made in the Skill's notes, am I right?
Now, I want you to open Notepad and Copy-Paste the whole entire action sequence that you made there. This is important because if you screw this up, you'll have a backup.

Now, to tell the game how you want the moves to combine, we'll be using If statements. At the start of your action sequence, add this:
<setup action>
if

end
</setup action>
Now, an If statement can only work if we add the condition. Here are some conditions that I have already prepared that we want to use in our combination move:
  • $gameActors.actor(x)._lastBattleSkill._itemId == y Checks if Actor ID X has used move ID number Y.
  • target.isStateAffected(y) Checks if the targeted enemy is affected by State ID number Y.
  • $gameActors.actor(x).hp > 0 Checks if Actor ID X has more than 0 HP (If he's alive or not).
  • $gameActors.actor(x).isBattleMember() == true Checks if Actor ID X participates in battle.
  • $gameVariables.value(x) == $gameVariables.value(y) Checks if variable ID number X has the same value as variable ID number Y. The variable ID that we want to use here is the same variable ID we made before, meaning that basically this script checks if the actors that are going to use the combination move are targeting the same enemy or not.

Now, we want to put all of those conditions in one line, specifically, by using &&. Kind of like this:
if $gameActors.actor(1)._lastBattleSkill._itemId == 1 && $gameActors.actor(3)._lastBattleSkill._itemId == 5 && target.isStateAffected(22) && $gameActors.actor(1).hp > 0 && $gameActors.actor(3).hp > 0 && $gameVariables.value(102) == $gameVariables.value(103) && $gameActors.actor(3).isBattleMember() == true
I've replaced all the Xs and Ys with the numbers and values I've stated before. If you don't know how to read it, then let me explain it to you. The condition I've set for the combination move is that: the combination move will only work if
  1. Actor ID number 1 uses Skill ID number 1 (Or in this case, Slash).​
  2. Actor ID number 3 uses Skill ID number 5 (Or in this case, Strike).
  3. The targeted enemy is paralyzed with State ID number 22 (In my game, that means Stun).
  4. Actor ID number 1 is alive and has more than 0 HP.
  5. Actor ID number 3 is alive and has more than 0 HP.
  6. Both Actor ID number 1 and Actor ID number 3 is targeting the same enemy / Variable number 102 has the same value as variable number 103.
  7. Actor ID number 3 is a party member who participates in battle.
The reason why I only check for actor number 3 is because I will be putting this code into the Slash skill in my game which can only be used by actor number 1, therefore there's no need to check if he's battling or not.



6. Put the Condition into the Action Sequence


1641627171874.png


Now, insert the condition that you've made before into the If statement. Now, your action sequence will look like this:
<setup action>
if $gameActors.actor(1)._lastBattleSkill._itemId == 1 && $gameActors.actor(3)._lastBattleSkill._itemId == 5 && target.isStateAffected(22) && $gameActors.actor(1).hp > 0 && $gameActors.actor(3).hp > 0 && $gameVariables.value(102) == $gameVariables.value(103) && $gameActors.actor(3).isBattleMember() == true

end
</setup action>

Good job, now, since we got all that done, we just need to tell the game what to do if they've detected that the conditions are all true. In this case, we want the game to perform a combination move, in which case we'll use Force Action to do so.
eval: user.forceAction(x, $gameVariables.value(y));
eval: BattleManager.forceAction(user);
X = The Skill ID of your Combination Move that you made in step 1
Y = The variable that you used to store the targeted enemy ID

For me, I made X as 316 and Y as 102. Put it in and now your action sequence will look like this:
<setup action>
if $gameActors.actor(1)._lastBattleSkill._itemId == 1 && $gameActors.actor(3)._lastBattleSkill._itemId == 5 && target.isStateAffected(22) && $gameActors.actor(1).hp > 0 && $gameActors.actor(3).hp > 0 && $gameVariables.value(102) == $gameVariables.value(103) && $gameActors.actor(3).isBattleMember() == true

eval: user.forceAction(316, $gameVariables.value(102));
eval: BattleManager.forceAction(user);

end
</setup action>
Now, if the game has detected that Actor numbers 1 and 2 used Slash and Strike on a stunned enemy, the condition will be fulfilled and they will execute Sonic Dance!



7a. But What if it Didn't Work?

Now, great, the combination move will work! But what happens to the other person? Why are they still doing their skill? What happens if it doesn't work? Well, this is the most tedious part of the tutorial, cleaning up. This is the whole reason why we made switches and cannot move restriction states.

First of all, at the bottom of your Combination Move action sequence add these:


1641628635856.png

move character x: home, 1
move character y: home, 1
face character x: forward
face character y: forward
wait for movement
add state z: character y
add state z: character x
X = The ID of the first actor who will perform the skill
Y = The ID of the second actor who will perform the skill
Z = The ID of the state that makes you cannot move as told in Step 2

Basically what we're doing here is that we're putting the characters back to their home base and also giving them the cannot move restriction. In YEP Action Sequence Pack, this restriction makes it so that the actors will be freeze-framed and they won't be able to move. This means that neither of the actors who performed the Combination Move will be able to select or do any more action in that turn.



The second thing you need to do is head back to the skill where you put all your conditions and add this below the force actions:
eval: $gameSwitches.setValue(x, true)
X = The switch for your Combination Move

Other than the <setup action>, we also need to edit the <target action>.
<target action>
if $gameSwitches.value(x) == true
wait: 8
eval: $gameSwitches.setValue(x, false)
end
</target action>
X = The switch for your Combination Move

Now, your action sequence will look a bit like this:
<setup action>
if $gameActors.actor(1)._lastBattleSkill._itemId == 1 && $gameActors.actor(3)._lastBattleSkill._itemId == 5 && target.isStateAffected(22) && $gameActors.actor(1).hp > 0 && $gameActors.actor(3).hp > 0 && $gameVariables.value(102) == $gameVariables.value(103) && $gameActors.actor(3).isBattleMember() == true
eval: user.forceAction(316, $gameVariables.value(102));
eval: BattleManager.forceAction(user);
eval: $gameSwitches.setValue(204, true)
end
</setup action>


<target action>
if $gameSwitches.value(204) == true
wait: 8
eval: $gameSwitches.setValue(204, false)
end
</setup action>
I've already replaced the X with 204 in this case since it is the switch for my Combination Move.

You may be asking, why are we making such a pointless if statement in the <target action>? Because we will be using else branches.
Basically, before every
end, go add an else statement.
Now, you still have that notepad, right? Well, we'll be needing it now, below all your else statements, go add the action sequence list that you originally made.

<setup action>
if $gameActors.actor(1)._lastBattleSkill._itemId == 1 && $gameActors.actor(3)._lastBattleSkill._itemId == 5 && target.isStateAffected(22) && $gameActors.actor(1).hp > 0 && $gameActors.actor(3).hp > 0 && $gameVariables.value(102) == $gameVariables.value(103) && $gameActors.actor(3).isBattleMember() == true
eval: user.forceAction(316, $gameVariables.value(102));
eval: BattleManager.forceAction(user);
eval: $gameSwitches.setValue(204, true)
else
action list
action list
end
</setup action>


<target action>
if $gameSwitches.value(204) == true
wait: 8
eval: $gameSwitches.setValue(204, false)
else
action list
action list
end
</setup action>
action list = your original action sequence
Make sure all those "action list"s are replaced with the correct action sequence command that you wrote. Meaning that, if you previously wrote "Display Action" in <setup action>, then you need to replace the "action list" in <setup action> with that.

What we're basically doing is telling the game, "hey, if this condition isn't fulfilled, then don't do the combination move and do the original action sequence instead." and "hey, if the combination move actually works, then turn off switch x instead of doing the original action sequence."



7b. Why is the Other Actor still doing their skills?

If the actor that uses the Skill with the check condition is slower than their partner, then their partner will still have a chance to do their original skill action sequence in the same turn that the combination move is performed. But we don't want to have that! We want it so that both actors' turns were eaten up because they combined their skills! And so, we move on to the other skill, in my case, we move on to Strike.

Basically, all we have to do is do the exact same thing as before, make an If statement that has an else branch, with the only difference being in the content. Instead of turning on and off switches, or doing force actions, we just need to add a wait command.

<setup action>
if $gameActors.actor(1)._lastBattleSkill._itemId == 1 && $gameActors.actor(3)._lastBattleSkill._itemId == 5 && target.isStateAffected(22) && $gameActors.actor(1).hp > 0 && $gameActors.actor(3).hp > 0 && $gameVariables.value(102) == $gameVariables.value(103) && $gameActors.actor(3).isBattleMember() == true
wait: 8
else
action list
action list
end
</setup action>


<target action>
if $gameActors.actor(1)._lastBattleSkill._itemId == 1 && $gameActors.actor(3)._lastBattleSkill._itemId == 5 && target.isStateAffected(22) && $gameActors.actor(1).hp > 0 && $gameActors.actor(3).hp > 0 && $gameVariables.value(102) == $gameVariables.value(103) && $gameActors.actor(3).isBattleMember() == true
wait: 8
else
action list
action list
end
</setup action>
That's really all you need to do. This basically tells the game "Hey, if the condition is fulfilled, make this actor just wait.", the actual combination move will be done by the other actor who has the force action eval. This way, the actor who goes first doesn't do anything, and their turn is just spent doing a simple wait command.



8. Apply the States You've Made to the Actors in Accordance to Their Names.

1641631958540.png

Last but not least, before you get into battle and test out your Combination Moves, make sure you apply the states we've made to the actors, in accordance with their names.
For me, my "Rai Enemy" state will be applied to my first actor whose name is "Rai". You can do this by just applying the state to the actors through an event command, or using YEP's Auto Passive State plugin.

This way, the code in the State will trigger at the start of every turn, and it'll always keep track of which enemy the actor is selecting!



Well, now you're all done!
I want to send a GIF here of the result if I can, but I can't seem to get it working. Oh well.

Though, keep in mind that there are some cons in trying to make Combination Moves this way, for example, the speed or turn order of the combination move is solely decided by the speed / turn order of the actor who has the Combination Move Force Action Action Sequence (In this case, the turn order/speed of the combination move is solely decided by Actor 1's Agility).

Other than the conditions I compiled above, I'm sure there are more creative conditions you can think of, for example, instead of just 2 actors executing a move, if another actor uses skill x, it'll trigger a whole new combination move. You can do that by doing something like this:

<setup action>
if $gameActors.actor(1)._lastBattleSkill._itemId == 1 && $gameActors.actor(3)._lastBattleSkill._itemId == 5 && target.isStateAffected(22) && $gameActors.actor(1).hp > 0 && $gameActors.actor(3).hp > 0 && $gameVariables.value(102) == $gameVariables.value(103) && $gameActors.actor(3).isBattleMember() == true
eval: $gameSwitches.setValue(204, true);

end

if $gameActors.actor(1)._lastBattleSkill._itemId == 1 && $gameActors.actor(5)._lastBattleSkill._itemId == 3 && target.isStateAffected(22) && $gameActors.actor(1).hp > 0 && $gameActors.actor(5).hp > 0 && $gameVariables.value(102) == $gameVariables.value(106) && $gameActors.actor(5).isBattleMember() == true
eval: $gameSwitches.setValue(206, true);
else
action list
action list
end
</setup action>


<target action>
if $gameSwitches.value(204) == true && $gameSwitches.value(206) == true
wait: 8
eval: user.forceAction(317, $gameVariables.value(102));
eval: BattleManager.forceAction(user);
eval: $gameSwitches.setValue(204, false);
else if $gameSwitches.value(204) == true
wait: 8
eval: user.forceAction(316, $gameVariables.value(102));
eval: BattleManager.forceAction(user);
eval: $gameSwitches.setValue(204, false);
else
action list
action list
end
</setup action>
In there, I added a new condition, if Actor 5 has the same condition of targeting, being alive, using a certain move, it'll turn a switch on, and if both the switch for Actor 3's Combination Move and Actor 5's Combination Move is on, they'll perform a new combination move. But I haven't tested it yet, maybe you can try it.



All in all, that's all I have for this tutorial, thank you very much for giving it a read, and I really hope this helps. If you're having issues, or there was something that I haven't covered yet that made it bugged out, please do tell! Well, then, that's all from me, thank you!




 

Attachments

  • 1641631925423.png
    1641631925423.png
    102.1 KB · Views: 6
Last edited:

Frostorm

[]D[][]V[][]D
Veteran
Joined
Feb 22, 2016
Messages
2,660
Reaction score
2,252
First Language
English
Primarily Uses
RMMV
This is sweet! Too bad it uses action sequences though. Otherwise, it would've been cool to integrate such a feature in a tactical battle system, lol. I also assume this only works with battle systems where you select the entire party's actions before anything actually happens, right?
 

Skychord

Generic
Member
Joined
Jan 5, 2019
Messages
11
Reaction score
13
First Language
Indonesia
Primarily Uses
RMMV
This is sweet! Too bad it uses action sequences though. Otherwise, it would've been cool to integrate such a feature in a tactical battle system, lol. I also assume this only works with battle systems where you select the entire party's actions before anything actually happens, right?
Yep you're right, otherwise there would be no possible way to know if one or more actors have used the skill or not. I think in a battle system where the player acts instantly, it might be easier just to have a dedicated skill type for combination attacks. Select the skill, add a turn restriction to the other party member, remove when turn done. I'm not familiar with tactical battle systems, but if you can get the principle down, it might just be possible
 

Latest Threads

Latest Profile Posts

Remember to do your 0,01% progress on your game today!
Went to see Jujutsu Kaisen 0 yesterday, it was cool. The movie wasnt really a masterpiece, it had some pacing and characterization problems, but overall I enjoyed it, maybe because it was the first anime film I have ever been to in the cinema lol. The battle animation & music were top-notch. I havent seen much of the anime so people who watched the entire season would probably like it more.
MainMenu.PNG
Finally satisfied with the main menu xD

The plan was to have battle sprites in the menu...But these faces from Ocean's Nostalgia look pretty damn good imo. (Will have to adjust for them ofc and maybe recolor to match the overworld/battle sprites more)
It's always disturbing to me to see my cat eating something off the bathroom floor.

Forum statistics

Threads
121,988
Messages
1,145,736
Members
160,259
Latest member
Leonson
Top