No Zombie Leaders!
Version: 1.0
Author: modern algebra
Date: May 6, 2010
Version History
- <Version 1.0> 05.06.2010 - Original Release
Description
By default, if the lead actor of the party is killed, it will still be his/her graphic being used on the map. This script changes it so that if the leader of the party dies, replaces his/her sprite with that of the next living actor.
Features
- If the leader of the party dies, replaces his/her sprite with that of the next living actor.
- Completely plug & play - no configuration required!
Instructions
Just paste the script into its own slot in the script editor, above Main and below Materials. There is no configuration required.
Script
#==============================================================================
# No Zombie Leaders!
# Version: 1.0
# Author: modern algebra (rmrk.net)
# Date: May 6, 2010
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Description:
#
# By default, if the lead actor of the party is killed, it will still be
# his/her graphic being used on the map. This script changes it so that if
# the leader of the party dies, replaces his/her sprite with that of the next
# living actor.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Instructions:
#
# Place this script in its own slot in the Script Editor (F11) above Main
# and below Materials. That's all.
#==============================================================================
#==============================================================================
# ** Game_Actor
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased method - add_state; remove_state
#==============================================================================
class Game_Actor
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Add State
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modara_potat_leadded_adst_1gb3 add_state unless self.method_defined? (:modara_potat_leadded_adst_1gb3)
def add_state (state_id, *args)
modara_potat_leadded_adst_1gb3 (state_id, *args) # Run Original Method
$game_player.refresh if state_id == 1
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Remove State
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias mdala_pat_deledr_rmvst_5xc2 remove_state unless self.method_defined? (:mdala_pat_deledr_rmvst_5xc2)
def remove_state (state_id, *args)
mdala_pat_deledr_rmvst_5xc2 (state_id, *args) # Run Original Method
$game_player.refresh if state_id == 1
end
end
#==============================================================================
# ** Game_Player
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased method - refresh
#==============================================================================
class Game_Player
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Refresh
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias malg_lpot_dedlead_rfsh_7uj2 refresh
def refresh (*args)
if $game_party.members.size > 1 && $game_party.members[0].dead?
# Get first party member that isn't dead
i = 1
while i != $game_party.members.size && $game_party.members[i].dead?
i += 1
end
i = 0 if i == $game_party.members.size
actor = $game_party.members[i]
@character_name = actor.character_name
@character_index = actor.character_index
if self.methods.include? ("composite_character")
@composite_character = $game_party.members[0].composite_character
end
else
malg_lpot_dedlead_rfsh_7uj2 (*args) # Refresh
end
end
end
Credit
Thanks
- l33tpotato, for the request
Support
Please ask for support in this topic at RMRK. I will fix any bugs you may encounter and I will take any suggestions for future additions into consideration.
Known Compatibility Issues
It won't work well with Caterpillar scripts, simply because it would probably create repeat actors.
I am currently unaware of any other compatibility issues, but if you encounter any please post them here.