State that changes opacity upon running out? Animation on running out state finishing?

Captain_Joshua

Veteran
Veteran
Joined
Sep 10, 2017
Messages
50
Reaction score
3
First Language
English
Primarily Uses
RMMV
I have a state that is essentially supposed to make a character disappear from combat for X turns. The skill that applies this state changes the targets opacity to 0 and the state makes it so they cannot move or be targeted. However, the problem is that I am not sure how to change the opacity back to 255 after the state runs out since the target simply remains invisible.


Another question, so I don´t make two threads, how do I have a state play a specific animation on the affected when it runs out while also waiting for the animation to finish? It´s a somewhat lenghty animation that is supposed to play once the state runs out but once the state runs out the animation plays but it instantly moves on to the turn of the next actor.
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
832
Reaction score
525
First Language
English
Primarily Uses
RMMV
For your first thing, a <custom remove effect> tag from YEP_BuffsStatesCore is what you're looking for.

Custom remove effect plays when a state is removed, or when it fades due to state turns running out. A single line of code in one of these tags should be all you need to reset the opacity.

target.spriteOpacity(255,0)

So you'd use a tag like the following on your vanish state:
<Custom Remove Effect>
target.spriteOpacity(255,0)
</Custom Remove Effect>

If you want it to fade in, the 0 in that function is the number of frames the opacity change takes. Something like 20 will make it so that the actor doesn't randomly pop in.

Your second thing is a lot more complex. I had states doing animations (and waiting for them) in my old state workshop. Here is a link to a state that deals damage, and shows an animation, and waits for the animation to finish before continuing. The function setTimeout is what I used to do this. There's probably a way less complicated way to do it now, but it was 2016, and I didn't know any better.

Essentially you'd look at my code for the enflame state, specifically at the part where it defines animation timings, and then copy that to your liking with your own times and animation.
 
Last edited:

Captain_Joshua

Veteran
Veteran
Joined
Sep 10, 2017
Messages
50
Reaction score
3
First Language
English
Primarily Uses
RMMV
Thank you very much, I´ll use the upper one to make the skill work properly and try my best to get the lower thing to also work. Thank you very much for your help.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

DenRebrov wrote on Celianna's profile.
Seliana, will you be making desert tiles in the ancient dungeon?
Working on a casual shirt and jeans for female MZ gen. Woo.
Crazy idea: a crossover game made to showcase different RPG Maker games. Dimension crossing is involved and you get to play as different people's characters in some wacky nonsense plot.
HexMozart88 wrote on Citali's profile.
Kikuo!
The lack of bike trails and bungee jump areas in this city should be criminalized.

Forum statistics

Threads
107,429
Messages
1,029,641
Members
139,558
Latest member
dinodan
Top