Yanfly action sequence + sumrndm sequence input

Discussion in 'Javascript/Plugin Support' started by surunime, Nov 10, 2019.

  1. surunime

    surunime Villager Member

    Messages:
    14
    Likes Received:
    1
    First Language:
    indonesia
    Primarily Uses:
    RMMV
    Hi all, currently i use sequence input plugin : http://sumrndm.site/sequence-input/ in my combat sistem, but i wanna use it for a choice attack. For example, when the actor attack, the system wait for input button [up,down,left,right] and the actor attack based on what user input ex: up for upper slash, down for heavy slash etc.

    this is my approach to make those combat

    but system only read on last sequence input (up button), can someone help me with this? thanks before
     
    #1
  2. alcreator440

    alcreator440 Veteran Veteran

    Messages:
    210
    Likes Received:
    93
    First Language:
    English
    Primarily Uses:
    RMMV
    You don't need the Sequence Input script to accomplish what you're after. Below is a possible approach I would take:

    <Setup Action>
    animation 1: user // visual queue for the player to press a button
    wait: 30 // gives the player enough time to react
    </Setup Action>

    <TargetAction>
    if (Input.isPressed('up'))
    "Upper Slash"
    break action
    end

    if (Input.isPressed('down'))
    "Heavy Slash"
    break action
    end

    if (Input.isPressed('left'))
    "etc"
    break action
    end

    if (Input.isPressed('right'))
    "etc"
    end

    </Target Action>
     
    #2
    surunime likes this.
  3. surunime

    surunime Villager Member

    Messages:
    14
    Likes Received:
    1
    First Language:
    indonesia
    Primarily Uses:
    RMMV
    wow thanks sir it work like a charm. I have question, so if I use this approach the user timing for input button should be place on setup action? maybe if i wanna make combo after suscessfully press up and after actor action attack I press up again it can attack again, where I put timing for input button?
     
    #3
  4. alcreator440

    alcreator440 Veteran Veteran

    Messages:
    210
    Likes Received:
    93
    First Language:
    English
    Primarily Uses:
    RMMV
    You can put all of the code in the target action or virtually wherever you want. If you want to extend it then it gets a bit more complicated and you would probably have to use variables. Here is an example on how I would approach it:
    <TargetAction>
    if (Input.isPressed('up'))
    change variable 300 = 1
    change variable 301 = 1 // we store this variable so that the game knows the player used the "Upper Slash" input here
    "Upper Slash"
    end

    if $gameVariables.value(300) < 1 // so the game doesn't pick up multiple inputs at once since we're not using break action anymore.
    if (Input.isPressed('down'))
    change variable 300 = 1
    change variable 302 = 1 // we store this variable so that the game knows the player used the "Heavy Slash" input here
    "Heavy Slash"
    end

    if $gameVariables.value(300) < 1
    if (Input.isPressed('left'))
    change variable 300 = 1
    change variable 303 = 1
    "etc"
    break action
    end

    if $gameVariables.value(300) < 1
    if (Input.isPressed('right'))
    change variable 304 = 1
    "etc"
    end

    change variable 300 = 0 // to 'refresh' the variable for the next sequence.

    wait: 40 // to give the player time to react.
    ----------------------------------- // I usually put lines like this in my code to help differentiate the following sequence from the previous.

    The following sequence is where things can get as complicated as you want them to. The variables we stored would dictate what is available to the player next. We use this to give the player proper 'combo chains'. If you want different outcomes for each of the four previous inputs then you will have to write out the following code four times, each for the different variables stored. I'll only list the first possible outcome:


    if $gameVariables.value(301) > 0 // this option will be available because the player used the "Upper Slash" input previously
    if (Input.isPressed('up'))
    change variable 300 = 1
    change variable 311 = 1 // another variable can be stored here in case you want to extend the combo even further.
    "Upper Slash"
    end

    if $gameVariables.value(301) > 0 // same as above. Modify this variable to change what options the player has here
    if $gameVariables.value(300) < 1
    if (Input.isPressed('down'))
    change variable 300 = 1
    change variable 312 = 1 // again for a possible combo extension
    "Heavy Slash"
    end

    if $gameVariables.value(301) > 0
    if $gameVariables.value(300) < 1
    if (Input.isPressed('left'))
    change variable 300 = 1
    change variable 313 = 1
    break action
    end

    if $gameVariables.value(301) > 0
    if $gameVariables.value(300) < 1
    if (Input.isPressed('right'))
    change variable 301 = 1
    change variable 314 = 1
    "etc"
    end



    change variable 300 = 0 // to 'refresh' the variables for when the skill is used again.
    change variable 301 = 0
    change variable 302 = 0
    change variable 303 = 0
    change variable 304 = 0
    change variable 311 = 0
    change variable 312 = 0
    change variable 313 = 0
    change variable 314 = 0
    </Target Action>
     
    #4
    surunime likes this.
  5. surunime

    surunime Villager Member

    Messages:
    14
    Likes Received:
    1
    First Language:
    indonesia
    Primarily Uses:
    RMMV
    wow i dont know yanfly sequence can used like this. thanks again sir you're saving my life :guffaw::guffaw::guffaw:
     
    #5
    alcreator440 likes this.
  6. alcreator440

    alcreator440 Veteran Veteran

    Messages:
    210
    Likes Received:
    93
    First Language:
    English
    Primarily Uses:
    RMMV
    No problem! And if you have any more questions about action sequencing feel free to ask.
     
    #6

Share This Page