Yanfly action sequence + sumrndm sequence input

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
Spoiler: sequence
<setup action>

clear battle log

display action

immortal: targets, true

perform start

wait for movement

cast animation

wait for animation

</setup action>



<Whole Action>

move user: targets, front, 20

</Whole Action>



<target action>

wait for movement



start sequence input: down, 2

start sequence input: up, 3

wait for sequence input: maxFrames

end sequence input



if $gameVariables.value(2) > 10

animation 1: user

wait for animation

camera focus: target, center, 10

zoom: 105%, 10

wait for zoom

motion attack: user

wait: 10

attack animation: target

face user: target

wait for animation

action effect: target

death break

else if $gameVariables.value(3) > 10

animation 2: user

wait for animation

motion attack: user

wait: 10

attack animation: target

face user: target

wait for animation

action effect: target

death break

end



</target action>



<follow action>

immortal: targets, false

reset zoom: 10

wait for camera

camera clamp on

</follow action>



<finish action>

immortal: targets, false

wait for new line

clear battle log

perform finish

wait for movement

wait for effect

</finish action>

but system only read on last sequence input (up button), can someone help me with this? thanks before
You don't need the Sequence Input script to accomplish what you're after. Below is a possible approach I would take:

Spoiler: Code
<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>
You don't need the Sequence Input script to accomplish what you're after. Below is a possible approach I would take:

Spoiler: Code
<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>

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?
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?
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:
Spoiler: code
<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>
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:
Spoiler: code
<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>

wow i dont know yanfly sequence can used like this. thanks again sir you're saving my life 🤣🤣🤣
No problem! And if you have any more questions about action sequencing feel free to ask.
No problem! And if you have any more questions about action sequencing feel free to ask.
sorry if I ask again, but I have difficult time when using this action sequence. so I wanna make sequence wait for the input without time remaining. so it progress on next sequence only after user press the button input. is it possible?
I'm not sure. I'll think about it but for now just shorten the wait time.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-action-sequence-sumrndm-sequence-input.115072/