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

● ARCHIVED · READ-ONLY
Started by mkrudesign 4 posts View original ↗
  1. 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
  2. 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
  3. Thank you! This worked like a charm!
  4. [closed].[/closed]

    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.