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

Discussion in 'Javascript/Plugin Support' started by Blue001, Oct 24, 2015.

  1. Anorgar

    Anorgar Veteran Veteran

    Messages:
    56
    Likes Received:
    13
    First Language:
    French
    Primarily Uses:
    RMMV
    @Chaos17 it should be possible. Can you give more explanation please ? I need to know if the ally who random debuff is random selected, if he have a passive skill to random debuff, the condition, etc. Then I might be able to give you a way to do so.
     
  2. Chaos17

    Chaos17 Dreamer Veteran

    Messages:
    1,253
    Likes Received:
    420
    Location:
    France
    First Language:
    French
    Sure.

    Hero A got a debuff like Stun for example.
    Hero B has a chance to come and debuff it automaticly (I don't know if it's only once per turn or battle).

    I think it we need passive state for that but beyond that I don't know how to make Hero B react and act.
    But it might be interresting for bringing some synergy between actors, imo.
     
  3. RPGfan2005

    RPGfan2005 The Great RPG Fanatic Member

    Messages:
    5
    Likes Received:
    1
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    I have to say... I don't know how Yanfly did it... He's a genius!!! It is a lot simpler than what it seems.
     
  4. Anorgar

    Anorgar Veteran Veteran

    Messages:
    56
    Likes Received:
    13
    First Language:
    French
    Primarily Uses:
    RMMV
    @Chaos17 I was able to figure out a way to do it.
    You will need some yanfly plugin : target core, buffs & state core and passive state.
    Then you need to creat a common even, this even will force the battler who remove state to perform his action. In this common even, you need a conditionnal branche if (you don't need the else) : if (battler have passive state x) then (force action, this battler, skill remove state) The common even menu will ask for a target, just select random, the target will be selected later.

    then you need to create the passive state x. You can just leave it empty : it's just to check if the user can or not perform the debuff. In fact, you don't really need it to be passive, you just need your battler to have a state, a piece of weapon or even a skill (but then modify the common even condition).

    This part is a pain, I'm sorry I wasn't able to do something more simple, but my solution isn't the only way. On every state your ennemies can apply, you have to do a custom apply effect, this one is going to set the value of 2 variables. The first is the id of the currrent state, and the second is the id of the battler. You will need these on the debuff skill. After, your apply effect will call the common even to force your battler to cast the debuff skill.

    Code:
    <Custom Apply Effect>
    $gameVariables.setValue(x, stateId); //id of the current state
    $gameVariables.setValue(y, user._actorId); //user._actorId give you the id of the current actor, leave it like that
    $gameTemp.reserveCommonEvent(9); //call the common even
    </Custom Apply Effect>
    

    Last part is the skill. Your battler need to have learnt it. You need first a custom target eval, because common even isn't capable of that :

    Code:
    <Custom Target Eval>
    targets[0]=$gameActors.actor($gameVariables.value(y));
    </Custom Target Eval>
    
    The skill can have every animation you like, you only need this code line to remove the state:

    Code:
    EVAL: target.removeState($gameVariables.value(x));
    
    I still have a problem with this methode : the first time a state is apply, it work perfectly, but after the common even don't want to run again.

    If you want to add some conditions like a chance to perform the skill, add a if condition in the state apply effect. If you want it to work only once per turn, add a variable, then reset it in your passive state.

    Good luck to finish this skill, I hope this will help you a bit.
     
    Chaos17 likes this.
  5. Miseryfactory77

    Miseryfactory77 Veteran Veteran

    Messages:
    77
    Likes Received:
    3
    Okay so after looking over my notepad I keep for notes on making skills I think I have figured out what to do. so if I do something like this
    Else if statements for variable attacks
    IF a.agi>b.agi*3
    //attack 6 time
    ELSE IF a.agi>b.agi*2
    //attack 4 times
    ELSE IF a.agi>b.agi
    //attack 2 time
    ELSE
    //attack 1 time
    END
    (where the //attck times is located substitute that field with the appropriate attack sequence)

    But instead Do
    If a.(statex) & a.agi>b.agi*3
    //attack 12 times
    else if a.(statex) & a,agi>b.agi*3
    //attack 18 times
    Else if a.(statex) & a.agi>b.agi*2
    //attack 8 times
    else if a.(statex) & a.agi>b.agi*2


    Wow I was trying bust started getting confused typing this I have to think about it more now I have a headache lol. And wow anorgar you are really only a villager? it seems like you know so much.

    I currently have the skill notated as such and it does not seem to be working properly am I forgetting something?

    IF a.agi>b.agi*3
    animation 128: user, mirror
    move user: targets, back base, 12
    motion swing: user
    face user: forward
    animation 7: target
    action effect
    wait for movement

    wait: 20


    motion swing: user
    face user: target
    animation 128: user
    move user: target, front base, 12
    animation 7: target
    action effect
    wait for movement

    wait: 20

    animation 128: user, mirror
    move user: targets, back base, 12
    motion swing: user
    face user: forward
    animation 7: target
    action effect
    wait for movement

    wait: 20

    motion swing: user
    face user: target
    animation 128: user
    move user: target, front base, 12
    animation 7: target
    action effect
    wait for movement

    wait: 20

    animation 128: user, mirror
    move user: targets, back base, 12
    motion swing: user
    face user: forward
    animation 7: target
    action effect
    wait for movement

    wait: 20

    motion swing: user
    face user: target
    animation 128: user
    move user: target, front base, 12
    animation 7: target
    action effect
    wait for movement

    ELSE IF a.agi>b.agi*2
    animation 128: user, mirror
    move user: targets, back base, 12
    motion swing: user
    face user: forward
    animation 7: target
    action effect
    wait for movement

    wait: 20


    motion swing: user
    face user: target
    animation 128: user
    move user: target, front base, 12
    animation 7: target
    action effect
    wait for movement

    wait: 20

    animation 128: user, mirror
    move user: targets, back base, 12
    motion swing: user
    face user: forward
    animation 7: target
    action effect
    wait for movement

    wait:20

    motion swing: user
    face user: target
    animation 128: user
    move user: target, front base, 12
    animation 7: target
    action effect
    wait for movement



    ELSE IF a.agi>b.agi
    animation 128: user, mirror
    move user: targets, back base, 12
    motion swing: user
    face user: forward
    animation 7: target
    action effect
    wait for movement

    wait: 20

    motion swing: user
    face user: target
    animation 128: user
    move user: target, front base, 12
    animation 7: target
    action effect
    wait for movement
    ELSE
    animation 128: user, mirror
    move user: targets, back base, 12
    motion swing: user
    face user: forward
    animation 7: target
    action effect
    wait for movement
    END
     
    Last edited: May 5, 2017
  6. Anorgar

    Anorgar Veteran Veteran

    Messages:
    56
    Likes Received:
    13
    First Language:
    French
    Primarily Uses:
    RMMV
    @Miseryfactory77 yup, I'm just a villager, i started RPG maker 4 months ago. But I love code and I know a bit of javascript. I spent some time reading plugins code, and RMMV code to to know exactly what's going on behind the curtain. Now I use this knowledge to answer questions.

    If you do an attack like that, you can simply the code a lot :

    animation 128: user, mirror
    move user: targets, back base, 12
    motion swing: user
    face user: forward
    animation 7: target
    action effect
    wait for movement

    if a.agi>b.agi
    wait: 20
    motion swing: user
    face user: target
    animation 128: user
    move user: target, front base, 12
    animation 7: target
    action effect
    wait for movement
    end


    IF a.agi>b.agi*2
    wait:20
    animation 128: user, mirror
    move user: targets, back base, 12
    motion swing: user
    face user: forward
    animation 7: target
    action effect
    wait for movement

    wait:20

    motion swing: user
    face user: target
    animation 128: user
    move user: target, front base, 12
    animation 7: target
    action effect
    wait for movement
    end

    IF a.agi>b.agi*3
    wait:20
    animation 128: user, mirror
    move user: targets, back base, 12
    motion swing: user
    face user: forward
    animation 7: target
    action effect
    wait for movement

    wait:20

    motion swing: user
    face user: target
    animation 128: user
    move user: target, front base, 12
    animation 7: target
    action effect
    wait for movement
    end

    If you do consecutive "if" statement because you attacks are the same. You just add an attack if the agi is higer. So you perform 1 attack, then if a.agi>b.agi you perform an other one, and if a;agi>b.afi*2 you perform 2 more and so one. This way it will be easier for you to code, and to read your code.
     
  7. Miseryfactory77

    Miseryfactory77 Veteran Veteran

    Messages:
    77
    Likes Received:
    3

    Do I need a lunatics plugin or something for this to work? When I try using this code for my attack the only thing that happens is my actor steps forward becomes opaque then the enemy takes damage and my actor reappears. Is there a certain plugin I need to do if statements I have all of yanflys action sequence plugins and battle engine core I dont know what the problem is thats what happens when I try the coe I had or if I try the code you just typed have you tested it in your end? I cant think of what the problem could be with the plugin.
     
  8. Miseryfactory77

    Miseryfactory77 Veteran Veteran

    Messages:
    77
    Likes Received:
    3
    okay looks like part of the problem duh was that I forgot to write the <target actions> duh but when I go to battletest and try the skill some webkit thingie comes up that says

    ACTION SEQUENCE IF CONDITION ERROR
    /F:/Project1/js/plugins/YEP_AbsorptionBarrier.js:1442 a.agi>b.agi
    /F:/Project1/js/plugins/YEP_AbsorptionBarrier.js:1443 ReferenceError: a is not defined
    /F:/Project1/js/plugins/YEP_AbsorptionBarrier.js:1441 ACTION SEQUENCE IF CONDITION ERROR
    /F:/Project1/js/plugins/YEP_AbsorptionBarrier.js:1442 a.agi>b.agi*2
    /F:/Project1/js/plugins/YEP_AbsorptionBarrier.js:1443 ReferenceError: a is not defined
    /F:/Project1/js/plugins/YEP_AbsorptionBarrier.js:1441 ACTION SEQUENCE IF CONDITION ERROR
    /F:/Project1/js/plugins/YEP_AbsorptionBarrier.js:1442 a.agi>b.agi*3
    /F:/Project1/js/plugins/YEP_AbsorptionBarrier.js:1443 ReferenceError: a is not defined

    So when I turned off the absorption barrier and tried again it does it again but only says Yep weapon unleash where absorption barrier was what is the cause of this? this has never happened before lol.

    The skill is notated as follows
    <target action>

    animation 128: user, mirror

    move user: targets, back base, 12

    motion swing: user

    face user: forward

    animation 7: target

    action effect

    wait for movement



    if a.agi>b.agi

    wait: 20

    motion swing: user

    face user: target

    animation 128: user

    move user: target, front base, 12

    animation 7: target

    action effect

    wait for movement

    end





    IF a.agi>b.agi*2

    wait:20

    animation 128: user, mirror

    move user: targets, back base, 12

    motion swing: user

    face user: forward

    animation 7: target

    action effect

    wait for movement



    wait:20



    motion swing: user

    face user: target

    animation 128: user

    move user: target, front base, 12

    animation 7: target

    action effect

    wait for movement

    end



    IF a.agi>b.agi*3

    wait:20

    animation 128: user, mirror

    move user: targets, back base, 12

    motion swing: user

    face user: forward

    animation 7: target

    action effect

    wait for movement



    wait:20



    motion swing: user

    face user: target

    animation 128: user

    move user: target, front base, 12

    animation 7: target

    action effect

    wait for movement

    end

    </target action>
     
  9. Anorgar

    Anorgar Veteran Veteran

    Messages:
    56
    Likes Received:
    13
    First Language:
    French
    Primarily Uses:
    RMMV
    @Miseryfactory77 My bad, a. abd b. are used in the damage box, but in javascript conditions, you have to use
    IF user.agi>target.agi

    I tried it, and it work now :

    animation 128: user, mirror
    move user: targets, back base, 12
    motion swing: user
    face user: forward
    animation 7: target
    action effect
    wait for movement

    if user.agi>target.agi
    wait: 20
    motion swing: user
    face user: target
    animation 128: user
    move user: target, front base, 12
    animation 7: target
    action effect
    wait for movement
    end

    IF user.agi>target.agi*2
    wait:20
    animation 128: user, mirror
    move user: targets, back base, 12
    motion swing: user
    face user: forward
    animation 7: target
    action effect
    wait for movement

    wait:20

    motion swing: user
    face user: target
    animation 128: user
    move user: target, front base, 12
    animation 7: target
    action effect
    wait for movement
    end

    IF user.agi>target.agi*3
    wait:20
    animation 128: user, mirror
    move user: targets, back base, 12
    motion swing: user
    face user: forward
    animation 7: target
    action effect
    wait for movement

    wait:20

    motion swing: user
    face user: target
    animation 128: user
    move user: target, front base, 12
    animation 7: target
    action effect
    wait for movement
    end
     
  10. Miseryfactory77

    Miseryfactory77 Veteran Veteran

    Messages:
    77
    Likes Received:
    3
    Wow you are the best I cannot believe that this works this is amazing thank you. Now because I dont think that its possible to create a series of if statements that are conditional upon an if statement inside of the if statment perhaps you could help advise how I go about doing this.

    This character revolves around his agility stat and speed and multi hits etc so he has 2 skills that change is sv actor to ones I used gimp for to create after image looking effect. So while in that state all of his general skills would hit 2x the number they originally hit for. So I was thinking I would have to do one of 2 things. I would either have to while in that state have the skill replaced with a skill I make of the same name so that it appears the same and code it in the notes to hit for the doubled number of times. Then I would have to make it so when the state is no longer there that it goes back to the default use I guess.

    I am not opposed to that method however if there was a way to inside of that if statement expand upon it to make it also check for the actors statex or state x then execute the listed sequence for that state before checking if there is no state so it could do the default action.

    Man wording this is hard but your smart so I feel like you will understand what I am saying. So should I go the route of seeing if more if statements can be done inside the if statement or simply have the skill replaced is the actor is in state x or x with the properly coded move to double and triple the number of hits?

    If I explained that horribly and need to elaborate more please let me know lol. Once I can figure out how to do that this character along with my shapeshifting character will be pretty much done and then I can get started on my sorceress.

    Thanks again
     
  11. Anorgar

    Anorgar Veteran Veteran

    Messages:
    56
    Likes Received:
    13
    First Language:
    French
    Primarily Uses:
    RMMV
    @Miseryfactory77 If you want to attacktwice as much if your battler have state x, don't bother doing it in <target action>. You can use yanfly target core, and use it to target your ennemy twice if your battler have state x. <target action> will repeat for every target, so if you have 2 target (which is twice the same in fact) <target action> will play twice and you will have the expected result. And if you want to play it 3 times, then juste add the target one more time.

    Here is the code:

    Code:
    <Custom Target Eval>
    targets.push(target); //Initialize the targets with the selected target
    if (user.isStateAffected(x)){
    targets.push(target); //if you have the right state, add the same target again
    }
    </Custom Target Eval>
    
    Just add this to your skill, and it should work.
     
  12. Miseryfactory77

    Miseryfactory77 Veteran Veteran

    Messages:
    77
    Likes Received:
    3
    Wow you never fail to impress and it most certainly did work so perhaps I could find another use for that. The reason I need to have that applied but instead have my animations change is because in order for it to be true to the skill the number of hits changes on the slice not by him slicing again. Hard to explain but essentially in the note for the double slash skill we have been modifying action effect would be noted twice on the skill where the damage is calculated to generate 2 hits on a single slash. I know I have to note more but it makes the skill work the way I want better.

    Not only that but it would make sense given the other skills I have for this actor instead of playing the animation more times which is what the glorious thing you just came up with did its merely adding an additional action effect to all of the actors skills effected by this so that it can hit more.

    I know I will have to note more but worth it to me. I do like what you listed though and am saving that to my notes because I am certain I will be able to use that for a different character. Hower is there a way to achieve what I just outlined?

    I am serious I cant wait to put this game on the appstore I have already translated it to my phone for test play and I will sell it for 99 cents if it ever does well I wont forget you lol. But yeah is there any way to achieve this?

    I guess if state x is in effect I would want double the hits but by the method I listed. Hmm I just thought of an idea I could note a skill to do what I just described by haveing action effect noted 2x for twice the amount of hits and can I use that command you listed to check for state x and then if so use a different skill which in my skill data will be a skill of the same name just altered to have action effect listed twice?

    I hope I am making sense but you seem to understand me very well lol thanks in advance. Also if your french your english is very good.
     
  13. Anorgar

    Anorgar Veteran Veteran

    Messages:
    56
    Likes Received:
    13
    First Language:
    French
    Primarily Uses:
    RMMV
    @Miseryfactory77 If you want to change the skill depending of if the battlerhave state x or not, my trick won't work indeed. But you can modify the state x, to gain so time. When state x is apply, your battler lose double slash 1, but gain double slash 2 which have different animations and more hits.
    You still have to code double slash 2, but don't have to bother if user.isStateAffected(x) , only if user.agi>target.agi.
    You can use my trick to win some time if the number of attack is pair.

    If this still don't answer your question, maybe you can give me a step by step explanation. If you do, I can give you a more precise and specific help.
     
  14. Chaos17

    Chaos17 Dreamer Veteran

    Messages:
    1,253
    Likes Received:
    420
    Location:
    France
    First Language:
    French
    @Anorgar Thank you very much for taking your time for me, I will it give it a try today :)
     
  15. Miseryfactory77

    Miseryfactory77 Veteran Veteran

    Messages:
    77
    Likes Received:
    3
    Exactly I will code double slash 2 and I know how to use a state to add a skill but here is the catch. Since this state will alter all of this battlers known skills somehow a check will have to be done to see if he knows skill x and if he does then skill x is replaced with the skill the state gives for the duration of the state however when the state ends he gets his other skills back.

    I have done this with my shapeshift character the only thing is no skill is being "replaced" only a skill being granted so there was no complications. However for this there will have to be a check done to see if the actor knows x skill for if the actor has not yet learned skill x it wont be replaced or modified by the state however if the actor does know skill x then it is to be replaced and so forth.

    Hope I explained.
     
  16. Anorgar

    Anorgar Veteran Veteran

    Messages:
    56
    Likes Received:
    13
    First Language:
    French
    Primarily Uses:
    RMMV
    @Miseryfactory77 the code to know if a battler have a skill is :
    Code:
    user.isLearnedSkill(3)
    
    So If you want a state do add or remove a skill, the code below work
    Code:
    <Custom Apply Effect>
    
    if (user.isLearnedSkill(x)){
    user.forgetSkill(x);
    user.learnSkill(y);
    }
    </Custom Apply Effect>
    
    <custom remove effect>
    if (user.isLearnedSkill(y)){
    user.forgetSkill(y);
    user.learnSkill(x);
    }
    </custom remove effect>
    
     
  17. Miseryfactory77

    Miseryfactory77 Veteran Veteran

    Messages:
    77
    Likes Received:
    3
    Okay so my skill double slash is well actually its called rush fang so anyways rush fang is skill 48 and the recoded rush fang named *rush fang is the same however the action effect I have noted twice so in the twin-mirage state I put this in the states notebox
    <Custom Apply Effect>



    if (user.isLearnedSkill(48)){

    user.forgetSkill(48);

    user.learnSkill(54);

    }

    </Custom Apply Effect>



    <custom remove effect>

    if (user.isLearnedSkill(54)){

    user.forgetSkill(54);

    user.learnSkill(48);

    }

    </custom remove effect>

    Yet in battle it doesnt seem to be doing that any advice? Hmm I did forget to save lemme try that first.

    I tried placing that code in the notebox of the mirage state yet it doesnt seem to change the rushfang skill in battle.
     
    Last edited: May 7, 2017
  18. Anorgar

    Anorgar Veteran Veteran

    Messages:
    56
    Likes Received:
    13
    First Language:
    French
    Primarily Uses:
    RMMV
    @Miseryfactory77 Do you have the yanfly plugin buffs & state core? You need it to unlock <custom apply effect>on your state.
    I don't know what to say, it work for me. I tried the code I copy/past, and the effect apply with the state apply inside battle, and outside battle.

    If you have hard time making it work, you can try with common even, these are able to check if a battler have a skill or not. It should work too.

    If you want to know if the state work, change the name of your second skill. You will have a visual check to know which skill you battler have.
     
  19. Miseryfactory77

    Miseryfactory77 Veteran Veteran

    Messages:
    77
    Likes Received:
    3

    Im sorry but you are just 2 awsome lol and no I didnt have his buffs and states core Ill get it and see if that was the problem. Omg your the best it worked wow I dont think making my other characters moves will be this hard.

    you are so smart I wish I had another move or something I had a question about while I still had access to you. hmm wow this is so cool it worked oh I know okay so for my double slash skill aka rush fang the damage formula is a.atk + a.agi *2 - b.def

    IF twin mirage is on i want the formula to be a.atk + a.agi *3.5 - b.def what would be the proper way to write an if statement for that when the state I am referencing is state 21.

    Because if the state is not present I would want it to instead carry out the default attack formula.
     
    Last edited: May 7, 2017
  20. Anorgar

    Anorgar Veteran Veteran

    Messages:
    56
    Likes Received:
    13
    First Language:
    French
    Primarily Uses:
    RMMV
    @Miseryfactory77 You can use the yanfly plugin damage core. It give you access to :
    Code:
    <damage formula>
    if (user.isStateAffected(21){
    value = user.atk + user.agi*3.5-target.def;
    } else {
    value = user.atk + user.agi*2-target.def;
    }
    </damage formula>
    
     

Share This Page