Turn dead characters into 'ghosts'.

If you've played the older Dragon Warrior/Dragon Quest games on the NES, you probably remember that when a party member died, their sprite changed to a hollow outline representing their 'ghost'. This tutorial will show you how to do something similar in your own game.

Demo here:



You will first need to create duplicates of your character sprites so that you have one 'normal' and one 'dead':

Testboy1.PNG Testboy2.PNG


Testboy3.PNG Testboy4.PNG

I just used Paint.net for this part. Just open the sprite, and change the Layer opacity from 255 to whatever you think looks best (the samples above were about 100 or so I believe).

Once you have that you need a common event like this:

DeadComEveDemo.PNG

Be sure the trigger is set to Parallel Process, otherwise it won't work. The switch to trigger the event (StartOfGame in the example) needs to be turned on at the very beginning of the game.

You're done! The only flaw I can't seem to figure out is if you use an item or a spell to revive a dead character, their "dead" face in the menu won't change until you exit the menu and re-open it. I'm sure there may be a way to change that but if there is then I don't know about it.
I VERY strongly suggest that you add a Wait command at the start of that parallel process. In fact, it would be better to have it triggered by anything that could change the status of an actor to dead or not dead (this might mean a plugin/script), and then turn the switch off again at the end of the event.

Otherwise, the above event is going to run 60 times per second, for every second of the game, continually changing the actor graphics (because you've got nothing in there to say "only change the sprite if it's not already the correct one"). I can see this contributing to severe lag.

Nice idea, but needs a better implementation.
Agreed with Shaz that this kind of setup requires a Wait (5 frames at the very least). However, there's an even better non-scripting way to do it, and such an approach should be used for any kind of event you'd generally want to run post-battle.

You set a certain switch ON at the beginning of every battle (battle troop events - Turn 0 - set scope to "Battle" so it only runs once), and you use this switch as the Condition in your (parallel process) Common Event. At the END of the Common Event, turn this switch back OFF so that it only runs once and won't run again (until the switch is turned back on by another battle).

Be sure to set this switch ON when you run any event that can kill or revive characters, as well - such as a night at the Inn, or a deadly trap in a dungeon. This will ensure that the characters correctly turn into ghosts/turn back into corporeal humans when they are killed/revived outside of battle, too.

With an implementation method like this (where the Switch causes the event to run just once), no Wait is necessary. Not only does this method circumvent all possible performance issues, but it will also avoid the timing weirdness that a long Wait command (30+ frames) in the event could cause.

(Also, I think that creating a second version of the Common Event (identical, except without turning On/Off any switches), setting its Trigger to NONE (this is really important - it should only be run when explicitly called), and having any Skill/Item that can revive (or kill!) your characters run this Common Event in the item's Features box might be able to solve your Menu Portrait problem, but I haven't ever tried anything like this so I'm not 100% sure.)

Original thread: https://forums.rpgmakerweb.com/threads/turn-dead-characters-into-ghosts.94504/