redmedved2

Veteran
Veteran
Joined
Nov 2, 2020
Messages
83
Reaction score
29
First Language
Belarusian
Primarily Uses
RMMV
I would like to know how you can temporarily hide the sprite of the enemy when he uses a special skill.

In my game, there are static sprites and sprites for animations (like in the darkest dungeon, static pictures moving smoothly on the screen). So I need during special attacks of the enemy to remove his sprite and in its place to reproduce a set of other pictures and for this, I will use yanfly action sequence, in which I'll start a common event, but there are 2 problems:

1) I don't know how to hide the sprite itself during this event. I found a command: $gameTroop.members()[1].hide();
But by itself, it doesn't work when I use it in combat. I've tried changing the values in brackets, but no luck as I don't know exactly how this script is supposed to work. So I need to know how to hide an enemy's sprite temporarily.

2) I'm wondering if there's any way to play an event without using a "common event" Because I'm going to make one big common event and while a certain character/opponent attacks, turn on a switch like "wolf jump" and then turn on a common event that will find the right set of pictures and show it, then turn the switch off again. Because of this, I would get a bulky common event and a lot of unnecessary switches, so I was wondering if there was another way to play the animation with the yanfly action sequence rather than through a common event.

Note: by "animations" here I mean a set of show/move picture commands, not the ingame animations.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,232
Reaction score
1,199
First Language
English
Primarily Uses
RMMV
1) I don't know how to hide the sprite itself during this event. I found a command: $gameTroop.members()[1].hide();
But by itself, it doesn't work when I use it in combat. I've tried changing the values in brackets, but no luck as I don't know exactly how this script is supposed to work. So I need to know how to hide an enemy's sprite temporarily.
So the number in the brackets is called the index - if you look at the enemies in the troop in your database, it's the order you added them into the troop, starting with 0.

However, you shouldn't need to worry about all of that because that's what the keyword "user" is for in action sequences. So you would do Eval: user.hide() - notice that just putting JavaScript into action sequences doesn't do anything unless you prepend it with Eval:

However however, the action sequence pack 2 has commands built in for this. opacity user: 0%, 0 should make it disappear.
2) I'm wondering if there's any way to play an event without using a "common event"
Even with your description, I'm not sure what this means. You only have events that are common events or events on the map. Where, in your mind, would the event exist if it's not in a common event?

You could figure out how to execute all of the commands in your event through JavaScript, stick it into a plugin, and then call the function from that plugin in your action sequence (or call them individually via the Eval command). But if you want/need to use event commands for it, then it needs to be...in an event.
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
970
Reaction score
432
First Language
english
Primarily Uses
RMMV
dont forget about troop events
 

redmedved2

Veteran
Veteran
Joined
Nov 2, 2020
Messages
83
Reaction score
29
First Language
Belarusian
Primarily Uses
RMMV
So the number in the brackets is called the index - if you look at the enemies in the troop in your database, it's the order you added them into the troop, starting with 0.

However, you shouldn't need to worry about all of that because that's what the keyword "user" is for in action sequences. So you would do Eval: user.hide() - notice that just putting JavaScript into action sequences doesn't do anything unless you prepend it with Eval:

However however, the action sequence pack 2 has commands built in for this. opacity user: 0%, 0 should make it disappear.

Even with your description, I'm not sure what this means. You only have events that are common events or events on the map. Where, in your mind, would the event exist if it's not in a common event?

You could figure out how to execute all of the commands in your event through JavaScript, stick it into a plugin, and then call the function from that plugin in your action sequence (or call them individually via the Eval command). But if you want/need to use event commands for it, then it needs to be...in an event.
I tried the first command and it really worked, but the only problem is that the enemy was not just hidden, but ceased to exist, I hide it and expected the battle to continue, but it was over, he was just hidden from reality and it really made me laugh.
1631908653224.png
But then I installed the second ASP and used the opacity command, so it worked well, thank you for the advice. The only issue is that you are hiding the enemy only for the duration of your/his turn. I mean, that's what I need, I just need to test it out. Maybe there will be problems, but I can't say for now. I thought that it will work differently, like you could hide the enemy in the first action sequence phase and then get him back by the same command in the ending phase.

And about the common event, I meant that...I don't know. Probably exactly that: to write all events in a script and then place it in the note box of the action sequence. But since I don't know javascript, I think I can just create 1 variable instead of dozen switches. And I'll have to create a number for each specific enemy/character animation and write it all down in my game notebook, but that's not a problem.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,232
Reaction score
1,199
First Language
English
Primarily Uses
RMMV
I thought that it will work differently, like you could hide the enemy in the first action sequence phase and then get him back by the same command in the ending phase.
I'm not following this - what do you mean by first phase and ending phase? Do you mean the 5 action sequences within a skill? Yes, you would do that, but that all happens inside of that person's turn. I'm not sure what you were wanting to do originally (especially as your thread title says during it's [sic] turn...).

If you want to have the actor disappear for longer than their turn, I think you'll need to change their sprite to a blank image.
But since I don't know javascript, I think I can just create 1 variable instead of dozen switches. And I'll have to create a number for each specific enemy/character animation and write it all down in my game notebook, but that's not a problem.
That sounds pretty complicated. If you can explain a little more precisely what you're trying to achieve, perhaps we can help you streamline it.
 
Last edited:

redmedved2

Veteran
Veteran
Joined
Nov 2, 2020
Messages
83
Reaction score
29
First Language
Belarusian
Primarily Uses
RMMV
I'm not following this - what do you mean by first phase and ending phase? Do you mean the 5 action sequences within a skill? Yes, you would do that, but that all happens inside of that person's turn. I'm not sure what you were wanting to do originally (especially as your thread title says during it's [sic] turn...).

If you want to have the actor disappear for longer than their turn, I think you'll need to change their sprite to a blank image.

That sounds pretty complicated. If you can explain a little more precisely what you're trying to achieve, perhaps we can help you streamline it.
I'm really sorry that I couldn't have explained it more clearly before.

Let's say when the enemy "wolf" uses the skill "jump" I want the standard wolf sprite to disappear, then I want to wolf's "jumping sprite" to appear and slide across the screen. And when the jumping wolf crossed the screen, I want to standard wolf sprite to appear again.
So I want to play a "wolf jump" event when the wolf is using his jump skill.

And by now I'm gonna do it this way:
1)I will create a variable called for example "animation number".
2)I will create a common event called "battle animation". The event will contain various If conditions like that:
If animation number is 1 >>> play spider web animation. So it will create spider image and move it from one side of the screen to another and then delete it.
If animation number is 2 >>> play bandit stab animation.
If animation number is 3 >>> play wolf jump animation.
And so this common event will have all the possible enemy animations.
3) I'll write down all the animations and their corresponding numbers somewhere just to avoid messing up.
4) I'll set up an action sequence pack in the wolf's "jump" skill notebox like that:
-hide the wolf sprite
-variable animation number = 3 (number for wolf jump animation)
- play common event "battle animation"

Everything I have mentioned here is very simple and written simply for the sake of explanation, because, in fact, the animation will not just be in the movement of a single image, but the main thing is that it will be an event. A show/move picture event.

For me, this whole system is kind of nice. It's a bit of a pain with numbers, but it's stable. But if you have suggestions, I'll gladly listen to them.

And when I said problems with the plugin, I meant that, to me, the commands should not work like that. If I set the enemy opacity to 0, it must remain 0 until I will use the command to change it, because that's the way I get used to. The way all things in rpgm works, like if you have done something, you have to manually undo it. Because for example if I wanted to create an assassin enemy that uses some cloak, it is supposed to be hidden not only on it's turn, but some turns after that too, until I will make his sprite visible again. So the problem is just in my confusion with how it works - how it returns the sprite to its original opacity at the end of turn without my permission.:rolleyes:
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,232
Reaction score
1,199
First Language
English
Primarily Uses
RMMV
Let's say when the enemy "wolf" uses the skill "jump" I want the standard wolf sprite to disappear, then I want to wolf's "jumping sprite" to appear and slide across the screen. And when the jumping wolf crossed the screen, I want to standard wolf sprite to appear again.
So I want to play a "wolf jump" event when the wolf is using his jump skill.
This makes sense. But this...
And by now I'm gonna do it this way:
I have no idea why you would do this nested event instead of just calling the animation.
Code:
opacity user: 0%, 0
action animation
or, if the animation selected in the skill in your database is a hit effect to play on the target, you play whatever other animation you want:
Code:
opacity user: 0%, 0
animation 56: user
or whatever ID your wolf animation is.
the animation will not just be in the movement of a single image, but the main thing is that it will be an event. A show/move picture event.
Why? That's what the animations section of your database is for.
I meant that, to me, the commands should not work like that. If I set the enemy opacity to 0, it must remain 0 until I will use the command to change it...So the problem is just in my confusion with how it works - how it returns the sprite to its original opacity at the end of turn without my permission.:rolleyes:
I understand, but Yanfly wrote the system to idiot-proof it a bit. You can do so much with it that it would be easy to accidentally break your game's functionality if you forgot a line. For example, forgetting to turn actors back, or the HUD on, or whatever - it was felt the safest way to write it was to have the battlefield in the default condition at the end of a skill.
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
970
Reaction score
432
First Language
english
Primarily Uses
RMMV
guessing you havent looked through yanfly tips and tricks?
the "FF4 jump" tips and tricks shows an example of turning a sprite opaque and later (when the state wears off which plugins can give several options for that) it forces a follow up skill and return to normal.
 
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,720
Reaction score
15,304
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Support. Thank you.

 

redmedved2

Veteran
Veteran
Joined
Nov 2, 2020
Messages
83
Reaction score
29
First Language
Belarusian
Primarily Uses
RMMV
This makes sense. But this...

I have no idea why you would do this nested event instead of just calling the animation.
Code:
opacity user: 0%, 0
action animation
or, if the animation selected in the skill in your database is a hit effect to play on the target, you play whatever other animation you want:
Code:
opacity user: 0%, 0
animation 56: user
or whatever ID your wolf animation is.

Why? That's what the animations section of your database is for.

I understand, but Yanfly wrote the system to idiot-proof it a bit. You can do so much with it that it would be easy to accidentally break your game's functionality if you forgot a line. For example, forgetting to turn actors back, or the HUD on, or whatever - it was felt the safest way to write it was to have the battlefield in the default condition at the end of a skill.
Yeah, I'm just not ready yet for the systems that make things easier for me. I want to suffer. To forget about one line of code that will break my game when I'm already on 3 hour of the test run.

And I really want to just do an actual animation for this. But it's the way the default animations works. some time ago I tried to mess with them, I saw terrible things. Like the guys splitting their big animation onto 4 blocks to just play it because the default animations resolution is too low. So I just gave it all up a long time ago. I can't even remember now the main problems that caused me to give up, not counting the resolution.
 

redmedved2

Veteran
Veteran
Joined
Nov 2, 2020
Messages
83
Reaction score
29
First Language
Belarusian
Primarily Uses
RMMV
guessing you havent looked through yanfly tips and tricks?
the "FF4 jump" tips and tricks shows an example of turning a sprite opaque and later (when the state wears off which plugins can give several options for that) it forces a follow up skill and return to normal.
Honestly, I gave up on these Tips & Tricks when I saw how many of them were on the list. I sometimes wanted to look there because there were so many incredible ideas, but I never really got around to it.
But with your help now I can create my cloaking assassin. Thanks.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,232
Reaction score
1,199
First Language
English
Primarily Uses
RMMV
And I really want to just do an actual animation for this. But it's the way the default animations works. some time ago I tried to mess with them, I saw terrible things. Like the guys splitting their big animation onto 4 blocks to just play it because the default animations resolution is too low.
Ehn? That still seems weird to me, but if there's some reason it can't work for you, then okay...To me, if you needed 4 times the width of the animation editor to get across your screen, your resolution is incorrectly high for an MV game (unless you've also modded the hell out of the entire rest of the system to have huger character sprites and everything). I think that would just look bad.

There's also a plugin that simply stretches a given animation to fit whatever resolution you tell it to, so you could draw your animation as you want it, squish it down in your image editor, then plug it into the animation editor.

There's also also a paid extension plugin for Action Sequences to add projectile images which move from the user to the target. And they can be animated, if you wanted your jumping wolf to have ruffling fur or moving legs.

But anyway, all of the functionality you're looking for is in the Action Sequences if you carefully read through their lists of commands (or, as Tiamat said, combining them with states).
 

redmedved2

Veteran
Veteran
Joined
Nov 2, 2020
Messages
83
Reaction score
29
First Language
Belarusian
Primarily Uses
RMMV
Ehn? That still seems weird to me, but if there's some reason it can't work for you, then okay...To me, if you needed 4 times the width of the animation editor to get across your screen, your resolution is incorrectly high for an MV game (unless you've also modded the hell out of the entire rest of the system to have huger character sprites and everything). I think that would just look bad.

But anyway, all of the functionality you're looking for is in the Action Sequences if you carefully read through their lists of commands (or, as Tiamat said, combining them with states).
Some time ago when I had no idea what the resolution should be for a mv game I started with 1600x900. And I'm still fine with that, because I still don't know if it's good or bad, it's just fine for me. The sprites are 400x900. It's fine with the performance too. Well, more or less.
Oh, I really forgot to mention. I use a front battle system. with big sprites.
I found this image roughly describing the interface from my old post, in which, by the way, you were the one who helped me too.
1631917731295.png
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,232
Reaction score
1,199
First Language
English
Primarily Uses
RMMV
That seems even easier as an enemy attacking you wouldn't really be a wolf leaping sideways across the screen, but going up and down in place with the perspective zooming in as it leapt at the screen.
 

redmedved2

Veteran
Veteran
Joined
Nov 2, 2020
Messages
83
Reaction score
29
First Language
Belarusian
Primarily Uses
RMMV
In fact, it's not about wolves at all. Here's a rough sketch of what they look like in the game. I wish I had a proper gif of the end result but for now only this one.
I couldn't upload the gif directly here, so I'll do it like this:
The animation
And by the way, it's really late, so I think I'm going to go to bed. Thanks for all your help.
 

Latest Threads

Latest Profile Posts

I was listening to songs by Chuck E Cheese's voice actor (Jaret Reddick from Bowling for Soup) when the meds I was taking for my stomach virus apparently stopped working. I can't take my next dose until morning, but it's no use anyway. I'm officially sick again. Of course, I'll definitely take the next dose either way, but it's useless now.
New profile picture! This time, it's representative of my current project.
I suddenly feel like making a game for little kids: a pointless sandbox of cute animals, silly collectibles, and random mini games.
Anyone else just like, not bother to make games themed around specific holidays? I know I won't get them done in time for it to make sense.
time to enter the playtest dimension

Forum statistics

Threads
115,992
Messages
1,094,702
Members
151,285
Latest member
cycloxalis
Top