设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 72|回复: 0

[制作教程] Creating Combination Moves, but only with YEP Freebies

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    前天 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    4446

    主题

    864

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    22899
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    28239

    灌水之王

    发表于 4 天前 | 显示全部楼层 |阅读模式
    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






    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
    Click to expand...

    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





    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





    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>
    Click to expand...

    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:








    4. Create Switches





    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.





    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>
    Click to expand...

    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
    Click to expand...

    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

    • Actor ID number 1 uses Skill ID number 1 (Or in this case, Slash).​

    • Actor ID number 3 uses Skill ID number 5 (Or in this case, Strike).​

    • The targeted enemy is paralyzed with State ID number 22 (In my game, that means Stun).​

    • Actor ID number 1 is alive and has more than 0 HP.​

    • Actor ID number 3 is alive and has more than 0 HP.​

    • 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.​

    • 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






    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>
    Click to expand...


    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);
    Click to expand...

    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>
    Click to expand...

    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:





    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
    Click to expand...

    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)
    Click to expand...

    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>
    Click to expand...

    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>
    Click to expand...

    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>
    Click to expand...

    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>
    Click to expand...

    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.





    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>
    Click to expand...

    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!








    本贴来自国际rpgmaker官方论坛作者:Skychord处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/creating-combination-moves-but-only-with-yep-freebies.143724/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-7-14 14:29 , Processed in 0.092580 second(s), 56 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表