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

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,500
Reaction score
2,857
First Language
English
Primarily Uses
RMMV
But is there a way for a SV actor or battler to do a 180 or 360 within an action sequence?
There's no such command in Yanfly's action sequences. Various other people on these forums have made extensions for these plugins - you might get better results starting your own thread asking about this, as it's not really related to the topic of pre-made action sequences.

The alternative would be to make an animation of the character moving in the way you want, and call that within an action sequence.
 

Kaymon145

Veteran
Veteran
Joined
Apr 22, 2022
Messages
34
Reaction score
17
First Language
English
Primarily Uses
RMMV
Hey, does anyone know how one would go about playing 1 of 3 sounds chosen at random? I've tried multiple options but either nothing happens or I get an error that says the sound effect was failed to load, and it always seems to be the first one in the list too meaning i'm apparently not even doing the "random" part right :( heres a few variations ive tried so far to no avail..

<whole action>
sound = ["sound1","sound2","sound3","sound4"][~~(Math.random()*4)];
se : sound
</whole action>

<whole action>
se : ["sound1","sound2","sound3","sound4"][~~(Math.random()*4)];
</whole action>

<whole action>
const list = ["sound1","sound2","sound3","sound4"]
se : ({name: `${list[~~(Math.random()*list.lenght)]}
</whole action>

I've also tried having the sound be chosen in the setup action but i'm obviously doing something wrong here... I'm just not sure what :(
 

JPlaysan

知識は力なり
Veteran
Joined
Jul 4, 2019
Messages
90
Reaction score
63
First Language
English
Primarily Uses
RMMV
Hey, does anyone know how one would go about playing 1 of 3 sounds chosen at random? I've tried multiple options but either nothing happens or I get an error that says the sound effect was failed to load, and it always seems to be the first one in the list too meaning i'm apparently not even doing the "random" part right :( heres a few variations ive tried so far to no avail..
I'm still learning when it comes to action sequences but what about using variables? The first thought that came to mind was if you could hold certain sounds to play in a variable then call that variable through a random.
 

Kaymon145

Veteran
Veteran
Joined
Apr 22, 2022
Messages
34
Reaction score
17
First Language
English
Primarily Uses
RMMV
I'm still learning when it comes to action sequences but what about using variables? The first thought that came to mind was if you could hold certain sounds to play in a variable then call that variable through a random.
Thats kind of what I was trying to do with the first example.. with sound being the name of one of my variables, I also tried replacing sound with "var 10" as 10 is the number of the variable in the database, but than i get an error saying cant find sound "var%"... I'm not sure maybe the "se:" function just isnt designed to work with variables :/
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,500
Reaction score
2,857
First Language
English
Primarily Uses
RMMV
maybe the "se:" function just isnt designed to work with variables :/
Correct, you must use the format of the commands as they're described in the action sequence documentation.

Nothing you type into an action sequence is JavaScript unless it says so - therefore, your first line "sound = ..." will be skipped as an invalid command.

Then, if you look at the documentation for the "se" command, you see that it will automatically turn the first argument into a string for the filename, and you probably don't have an SE with the filename "sound" (you also have an incorrect space before the colon).

To do things like this, you can use the "eval: " command to execute JavaScript commands. So you can do an "eval: " to set a variable equal to a randomly determined filename, then another "eval: " to call the AudioManager.playSe function which will accept your variable.

The other alternative is to use an "eval: " to create a variable set to a random value, then:
Code:
if random==1
    se: sound1
else if random==2
  se: sound2
end
etc.
 

Kaymon145

Veteran
Veteran
Joined
Apr 22, 2022
Messages
34
Reaction score
17
First Language
English
Primarily Uses
RMMV
Correct, you must use the format of the commands as they're described in the action sequence documentation.

Nothing you type into an action sequence is JavaScript unless it says so - therefore, your first line "sound = ..." will be skipped as an invalid command.

Then, if you look at the documentation for the "se" command, you see that it will automatically turn the first argument into a string for the filename, and you probably don't have an SE with the filename "sound" (you also have an incorrect space before the colon).

To do things like this, you can use the "eval: " command to execute JavaScript commands. So you can do an "eval: " to set a variable equal to a randomly determined filename, then another "eval: " to call the AudioManager.playSe function which will accept your variable.

The other alternative is to use an "eval: " to create a variable set to a random value, then:
Code:
if random==1
    se: sound1
else if random==2
  se: sound2
end
etc.
Oh man I didnt even know about the eval function... Looks like I need to brush up on my reading!! Thanks so much, I finally got it working the way I wanted to :) No more hearing the same HIIYAH! after every. single. attack. Lol thanks again you've opened up a lot of new possibilities for me!
 

Kanetsugu21

Warper
Member
Joined
Oct 28, 2014
Messages
4
Reaction score
0
First Language
English
Primarily Uses
Hey folks, this may be an already answered question but I can't seem to find a good answer so I've resorted to asking here: I'm trying to make a skill that hits 3 random enemies but it sometimes will hit a dead target that was killed by a previous hit and wastes one of the three hits. Any idea how to make it so that hit 2 and 3 can't choose the dead target? I've seen 'Death Break' suggested as an option but that completely stops the action sequence and I'd like it to continue as long as at least one living target remains. Including what I have currently for reference. I have the ability scope set to 1 random enemy, so I've included the 'action effect' three times total.

<setup action> immortal: targets true motion standby: user hide battle hud </setup action> <target action> move user: Point, 200, 350, 30 wait 30 motion attack: user wait for animation action effect action animation: target wait: 45 action effect action animation: target wait: 45 action effect action animation: target wait: 45 motion walk: user Wait 10 face user: forward wait for animation wait for movement death break </target action> <follow action> immortal: targets false opacity not focus: 100%, 30 wait for opacity show battle hud </follow action>

Also, I know the animation is a little janky, but I'd like to make the ability work as intended before worrying about aesthetic polish. Hehe. Any tips or suggestions are very much appreciated. Thanks in advance!
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,500
Reaction score
2,857
First Language
English
Primarily Uses
RMMV
Any idea how to make it so that hit 2 and 3 can't choose the dead target?
RPG Maker's targeting doesn't do that on its own, so you need to code it in. Do you care whether the attack can hit the same enemy twice, so long as it hasn't taken enough damage to die yet? Or do you want it to be forced to 3 separate enemies if possible?
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,500
Reaction score
2,857
First Language
English
Primarily Uses
RMMV
Did you try removing the immortal stuff?
That's a good thought - what will happen, though, if the first attack, or first two, kill the only remaining targets in the troop, and then there are more commands?

At the very least, there would be weird-looking shuffling about from the movement commands, and the effects and animations on a target that doesn't exist might glitch out.

Incidentally, @Kanetsugu21, that death break at the end of the target action is pointless.
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,887
Reaction score
1,838
First Language
English
Primarily Uses
RMMV
Only way to find out is to give it a try. I haven't done yanfly action sequences in over a year though.
 

Kaymon145

Veteran
Veteran
Joined
Apr 22, 2022
Messages
34
Reaction score
17
First Language
English
Primarily Uses
RMMV
Hi everyone, I've been working on this action sequence most of the day now and I'm so close to getting this quick time event to work the way I want to, if the player presses the ok key at the right time the player gets an extra hit in, I even managed to get it to switch to a different battler sheet and everything, The only problem is the player can button mash and pretty much nail the quick time event every time. I'm trying to use a switch to disable the quicktime event from running if the ok button is pressed too early, I have a feeling I'm formatting something wrong with my if statements, or my actions are all running together in the target action section, I'm not sure. I'm just kind of at a loss at this point, like I said everything works great but I'd really like to be able to disable button mashing if possible.. Oh and the plugin I'm using for QTE is right here :


I appreciate any advice I can get on this, I've been messing with it all day and I'm so close but at this point I feel like I'm just making a mess of my code and not making progress (I tried to remove some of what wasn't relevant to shorten the post but its still kind of a mess)

<setup action>
hide battle hud
change switch 35: on
eval: ran = [1,2][~~(Math.random()*4)];
display action
camera focus: user
zoom: 250%, 20
wait for zoom
camera focus: target
zoom: 150%, 20
camera offset: right, 50
end
immortal: targets, true
</setup action>

<target action>
if eval: Input.isTriggered("ok") {
change switch 35: off
FLASH SCREEN: RED }
end
move user: targets, front, 20
wait for movement
motion attack: user
wait: 10
attack animation: target
wait: 10
if eval: $gameSwitches.value[35] == true {
eval: $gameMap.QTE(["normal"],20,["ok"],true)
if eval:$gameMap.getQTEResult() === "success"
FLASH SCREEN: WHITE
}
end
wait for animation
action effect
wait for animation
wait for movement
wait: 5
if eval:$gameMap.getQTEResult() === "success"
{
eval: $gameActors.actor(1).setBattlerImage('LucasLarge2')
eval: $gamePlayer.refresh()
motion attack: user
wait: 10
attack animation: target
wait for animation
action effect
eval: $gameActors.actor(1).setBattlerImage('LucasLarge')
eval: $gamePlayer.refresh()
}
end
</target action>

<follow action>
zoom: 100%, 20
move user: home, 20
wait for movement
show battle hud
</follow action>

EDIT

I forgot to menton the red flash effect is activating even when I dont press 'ok' so I know I'm doing something wrong there..
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,500
Reaction score
2,857
First Language
English
Primarily Uses
RMMV
You should start putting the code you post into the code tags (the </> on the top row). It preserves your indents, and you don't risk values inside of brackets getting turned into BBCode.

I'm not familiar with that QTE plugin, so I'm just skimming, but this:
if eval: Input.isTriggered("ok") {
change switch 35: off
FLASH SCREEN: RED }
end
move user: targets, front, 20
wait for movement
motion attack: user
wait: 10
attack animation: target
wait: 10
if eval: $gameSwitches.value[35] == true {
eval: $gameMap.QTE(["normal"],20,["ok"],true)
if eval:$gameMap.getQTEResult() === "success"
FLASH SCREEN: WHITE
}
end
is all wrong.

1 - You can't put action sequence commands into random places. If eval isn't at the start of the line, it doesn't mean anything. So saying if eval: is already invalid. Then...

2 - Conditionals already use JavaScript. So there's no reason for you to try to use an eval there, you'd simply type if Input.isTriggered("ok"). That's why your conditionals all aren't working.

3 - Action sequences don't use braces, they use the conditional and then end. So putting that open brace at the end of that first line doesn't help anything, and the same is true for all the other close and open braces - as far as the action sequence is concerned, those are errors.

Hopefully all of that gets you closer! You might want to read some further examples of functioning action sequences to get a better grasp of their syntax. The very beginning of this thread isn't great for that because a lot of them weren't posted in code tags and they're unintelligible gibberish - but there are other threads and YouTube videos with readable stuff.
 

Kaymon145

Veteran
Veteran
Joined
Apr 22, 2022
Messages
34
Reaction score
17
First Language
English
Primarily Uses
RMMV
You should start putting the code you post into the code tags (the </> on the top row). It preserves your indents, and you don't risk values inside of brackets getting turned into BBCode.

I'm not familiar with that QTE plugin, so I'm just skimming, but this:

is all wrong.

1 - You can't put action sequence commands into random places. If eval isn't at the start of the line, it doesn't mean anything. So saying if eval: is already invalid. Then...

2 - Conditionals already use JavaScript. So there's no reason for you to try to use an eval there, you'd simply type if Input.isTriggered("ok"). That's why your conditionals all aren't working.

3 - Action sequences don't use braces, they use the conditional and then end. So putting that open brace at the end of that first line doesn't help anything, and the same is true for all the other close and open braces - as far as the action sequence is concerned, those are errors.

Hopefully all of that gets you closer! You might want to read some further examples of functioning action sequences to get a better grasp of their syntax. The very beginning of this thread isn't great for that because a lot of them weren't posted in code tags and they're unintelligible gibberish - but there are other threads and YouTube videos with readable stuff.
Thank you again, I was wondering if there was a way to shrink down my code posts a bit, and that did help me out a lot and i was able to clean up a bunch of my code and get things running a bit smoother, the one line I'm still having trouble with is this :
if Input.isTriggered("ok") FLASH SCREEN: RED change switch 35: off end
I still can't get this to trigger for some reason, I'm turning the switch on in setup actions and I want it to turn off as soon as the ok key is pressed but no matter if I hold the key down or mash the button the red flash isn't triggered and the switch isn't turned off. Other than that I removed all the brackets and unnecessary eval:'s and it looks a lot smoother!
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,500
Reaction score
2,857
First Language
English
Primarily Uses
RMMV
I still can't get this to trigger for some reason
As I said, I haven't worked with the other plugin you're using, so take this with a grain of salt - but I do not think you can do this the way you're trying to (and I'm not sure why you are trying to).

Usually, people use Input.isTriggered() in a parallel event that's running every game frame (60 times a second). That will pick up when the player presses the referenced button.

In your case, you're putting it in the middle of the skill, and isTriggered() only returns true for a single frame after the button is pressed, so the odds of the player hitting it at exactly the right time for this to work are nearly impossible. Especially since I don't see anything leading up to it in your action sequence that would queue them to do so. But even if they were, the timing of 1/60th of a second is impractical.

It seems like you should be using the QTE plugin to display something on the screen and wait for/record the player's input. Isn't that what you installed it for? :wink:
 

Kaymon145

Veteran
Veteran
Joined
Apr 22, 2022
Messages
34
Reaction score
17
First Language
English
Primarily Uses
RMMV
As I said, I haven't worked with the other plugin you're using, so take this with a grain of salt - but I do not think you can do this the way you're trying to (and I'm not sure why you are trying to).

Usually, people use Input.isTriggered() in a parallel event that's running every game frame (60 times a second). That will pick up when the player presses the referenced button.

In your case, you're putting it in the middle of the skill, and isTriggered() only returns true for a single frame after the button is pressed, so the odds of the player hitting it at exactly the right time for this to work are nearly impossible. Especially since I don't see anything leading up to it in your action sequence that would queue them to do so. But even if they were, the timing of 1/60th of a second is impractical.

It seems like you should be using the QTE plugin to display something on the screen and wait for/record the player's input. Isn't that what you installed it for? :wink:

haha yeah I did try and switch it from isTriggered to isPressed and noticed it does seem to only be triggering once, I was thinking of setting up some kind of loop to check for presses every 60 frames before the actual action sequence but this is all getting pretty complicated, I might just have to rethink my strategy or find a different plugin. The plugin itself works great I just wanted a way to make it harder by disabling it if the player presses "ok" too early ( the actual timed hit is like 20 frames I think) its supposed to be a precise timing thing but as it is the player can just button mash "ok" and pass the QTE every time, except for that one rare time I hit the 1/60th second button check before hand lol
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,500
Reaction score
2,857
First Language
English
Primarily Uses
RMMV
( the actual timed hit is like 20 frames I think) its supposed to be a precise timing thing but as it is the player can just button mash "ok" and pass the QTE every time
I couldn't read all of your post. But for this, you can control how much time the player has for the QTE.

If you read the documentation for it, it's the second number in:
Code:
$gameMap.QTE(mode,duration,sequence,visible,x*,y*,opacity*,width*,height*,wrongInput*,showTime*)
duration.

The author even gives an example of how to do this in the first post, where you have a timed window to make the skill be a critical hit.

But if you have any more questions about this, it really should go either in the thread for the QTE plugin or in a new Plugin Support thread, as it's off-topic for this one.
 

Ajx5

Warper
Member
Joined
Apr 29, 2022
Messages
2
Reaction score
1
First Language
English
Primarily Uses
RMMV
My Close Attempt at Trying to Replicate Dark Blade(Cless's Hi-Ougi from Tales of Phantasia)
<target action>
CAMERA FOCUS: user
wait: 10
-----<movement>------
battleback 3 add: battlebacks1, Speedlinevertical
battleback 3 scroll speed y: -300
camera screen: user, base top, 15
zoom: 200%, 15
------Charge Skill-------
move user: target, front, 20
motion attack: user
action animation
wait for animation
motion attack: user
action animation
wait for animation
opacity not focus: 0, 20
move user: target, front, 5
wait for opacity
opacity user: 100%, 5
wait for opacity
motion victory: user, no weapon
action animation
action effect
jump user: 500%, 29
jump target: 500%, 30
wait for jump
se: Earth5
shake screen: 3, 9, 10
motion guard: user, no weapon
ani wait: 5
action effect
immortal: target, false
Wait 30
battleback 3 remove
</target action>

<follow action>

opacity not focus: 100%, 60

wait for opacity

</follow action>
 

raptordev

Warper
Member
Joined
Jun 11, 2022
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hey, could I get that battleback from you? This looks cool
My Close Attempt at Trying to Replicate Dark Blade(Cless's Hi-Ougi from Tales of Phantasia)
<target action>
CAMERA FOCUS: user
wait: 10
-----<movement>------
battleback 3 add: battlebacks1, Speedlinevertical
battleback 3 scroll speed y: -300
camera screen: user, base top, 15
zoom: 200%, 15
------Charge Skill-------
move user: target, front, 20
motion attack: user
action animation
wait for animation
motion attack: user
action animation
wait for animation
opacity not focus: 0, 20
move user: target, front, 5
wait for opacity
opacity user: 100%, 5
wait for opacity
motion victory: user, no weapon
action animation
action effect
jump user: 500%, 29
jump target: 500%, 30
wait for jump
se: Earth5
shake screen: 3, 9, 10
motion guard: user, no weapon
ani wait: 5
action effect
immortal: target, false
Wait 30
battleback 3 remove
</target action>

<follow action>

opacity not focus: 100%, 60

wait for opacity

</follow action>
 

Latest Threads

Latest Posts

Latest Profile Posts

Took some trial and error, but I managed to create "visuals" for underground dig path regions.
Couldn't sleep at all so I started working on the topmost deck. I've had to make several deviations from the Imperator/Berengaria's deck-plans to accommodate MV's movement, but 100% accuracy was never my intention.
Still no name for the poor ship...:kaodes:
Screenshot-2022-06-25-053308.png
ScreenShot_6_24_2022_9_20_7.png
Here's Mike when you get a preemptive strike in battle. There's another one for when an enemy sneaks up on you too.
Suddenly, games mean nothing. The money spent was worth it to bring souls towards the light of life. May God bless my path forever. I pray that all are shaken for truth and poured out flat on the table of true understanding, knowledge, and wisdom. Bless you.

Forum statistics

Threads
123,026
Messages
1,153,505
Members
161,370
Latest member
BuiTra
Top