Is there any way to change an character's sprite while they are affected by a state?

Status
Not open for further replies.

mkrudesign

Veteran
Veteran
Joined
Jun 11, 2019
Messages
31
Reaction score
2
First Language
English
Primarily Uses
RMMV
In my example, a player character can be affected by the "vampirism" state in battle, which acts similarly to poison in most rpgs, basically draining health while walking. What I want to know is if there is a way to swap out the character sprite to a different image while under this "vampirism" state and of course change back once the state has been removed. Is it also possible to change the character image in the menu while the character is afflicted with the state?


This:
Actorclothesmila.png

To this:
Actorclothesmila2.png
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
2,143
Reaction score
651
First Language
English
Primarily Uses
N/A
In a common event that's always active, check if the actor has the state, and if their current spirite is the correct sprite, If the first is yes, but the second is no, it changes the sprit.

Then have it check if the actor doesn't have the state, but has the sprite. If they don't have the state but have the sprite, it changes them back

Their should probably be like a 5 frame wait for each check. It would need to be parellel process and turned on by an auto-event early in the game or at the first possible place they can get vampirism
 

mkrudesign

Veteran
Veteran
Joined
Jun 11, 2019
Messages
31
Reaction score
2
First Language
English
Primarily Uses
RMMV
Thank you! This worked like a charm!
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,744
Reaction score
15,884
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.



If you are using a common event, make sure you add a Wait at the very start. You do not need to check 60 times a second for the entire duration of the game whether the player has this state, and having a few events like this will likely result in lag.

I'd personally just do something that changed the sprite when the state is added or removed. I made a State Add/Remove Commands plugin just for this sort of thing.
 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

So unbelievably excited for IGMC this year! First public game was for the original one and I'm just so pumped!!
Sometimes I am amazed at how relentless spam bots are. I would clear the que and then see 800~5k more depending on their mood.
Work on UD is already so delayed but I gotta drop everything so that I have something ready for IGMC!
Messed up the chains... :kaoback:
Sw7U8dA.jpg

Character: Jeanne D'Arc from Fate/Apocrypha.
Neptrone wrote on Andar's profile.
Hello Andar, i just saw you created a lot of helpful thread in the past regarding RPG, genre, game design, etc, etc.

Do you have full collection or list about every useful thread that you made in the past ? I think it would be very useful for me.


Thanks :)

Forum statistics

Threads
123,255
Messages
1,155,241
Members
161,636
Latest member
qixxi
Top