Nataxinus 34 Posted May 20, 2015 (edited) Change Graphic to Coffin on Death When a character dies he turns into a coffin now. The player is only a coffin in battle but not on the map. This script is compatible with the Yanfly Battle Engine. After the battle all characters who is dead will appear as a coffin except for the player. I know there are some battle scripts that has a feature to change graphic upon death, but as far as I'm aware there is no stand alone script that also makes the characters appear as a coffin on the map for RPGMVXAce. I was inspired by Dragon Quest. This script is just plug and play, except if you want to change the graphic. Screenshots Script #=============================================================================== # Coffin Death Script # By Nataxinus #=============================================================================== #=============================================================================== # Description # When a character dies he turns into a coffin now. The player is only a coffin # in battle but not on the map. This script is compatible with the Yanfly Battle # Engine. After the battle all characters who is dead will appear as a coffin # except for the player. #=============================================================================== #=============================================================================== # Terms of use # Free for non-commercial and commercial projects, but credit me #=============================================================================== module Nataxinus module Coffin # If you want to use another graphic then change GRAPHIC. Remember to put the # graphic in the Graphics/Character folder. GRAPHIC = "$Coffin" # Set SHOW_IN_BATTLE to false if you don't want the coffin in battle. SHOW_IN_BATTLE = true # Set SHOW_ON_MAP to false if you don't want the coffin on the map SHOW_ON_MAP = true end end class Game_Actor < Game_Battler attr_accessor :character_name_temp attr_accessor :character_index_temp attr_accessor :character_name attr_accessor :character_index end class Game_BattleCharacter < Game_Character attr_accessor :actor end class Sprite_Character < Sprite_Base include Nataxinus::Coffin alias coffin_update update def update if @character.class == Game_Follower && SHOW_ON_MAP @actor = @character.actor elsif @character.class == Game_BattleCharacter && SHOW_IN_BATTLE @actor = @character.actor elsif @character.class == Game_Player && SHOW_ON_MAP if $game_actors[1].character_name == GRAPHIC $game_actors[1].character_name = $game_actors[1].character_name_temp $game_actors[1].character_index = $game_actors[1].character_index_temp end else @actor = nil end if @actor if @actor.hp <= 0 @coffin = true if @actor.character_name != GRAPHIC @actor.character_name_temp = @actor.character_name @actor.character_index_temp = @actor.character_index @actor.character_name = GRAPHIC @actor.character_index = 0 end @actor.set_graphic(GRAPHIC, 0, @actor.face_name, @actor.face_index) if @character.class == Game_BattleCharacter @character.set_graphic(GRAPHIC, 0) end @character.refresh if @character.class == Game_Follower elsif @actor.character_name_temp != nil if @actor.character_name == GRAPHIC @coffin = false @actor.character_name = @actor.character_name_temp @actor.character_index = @actor.character_index_temp puts @actor.character_name if @character.class == Game_BattleCharacter @character.set_graphic(@actor.character_name_temp, @actor.character_index_temp) end @character.refresh if @character.class == Game_Follower end end end coffin_update end end Edited May 21, 2015 by Nataxinus 2 Share this post Link to post Share on other sites
+ Galdelonian 13 Posted May 20, 2015 lol I'm tempted to make a hopping coffin just so when it's out of battle it'll hop. Share this post Link to post Share on other sites
+ TBWCS 953 Posted May 20, 2015 Cool script, but here's a suggestion. Offer your script users an option to easily edit which sprite they want to be shown during death, though you said its a coffin, someone might be using a custom sprite of a coffin, so easily editable area without much searching for the user is a good start. You can also put two switches or options that allows the user to have the option if he or she wants to show the coffins only in battle or only in map. Of course, these are just my suggestions, because it is still a cool script no matter what. Share this post Link to post Share on other sites
Mima 1 Posted January 22, 2021 I have set show_on_map to false but the coffin still show anyway? this script is like the perfect one for my game i just need to find how to disable the coffin in overworld someone please help. Share this post Link to post Share on other sites