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.
This looks like a nice quick fix for an irritating problem.
Great job Modern.
I have been waiting for a script like this for a while now. If I actually knew anything about scripting, I might have attempted it earlier. This is awesome! :D
I'm glad you guys like it. It's a pretty simple script. I probably could have done a better job of it had it not been way past my bedtime when I wrote it :P
Hi, I got an error when using this script.
line 59: NoMethodError occurred.
undefined method '>' for false:FalseClass
Thanks.
Sorry. At that line, delete the exclamation mark.
Sorry in advance for the necropost, but is there any chance of making this work with your "Change Party Order" script?
Right now, if say, I had the RTP Party of "Ralph, Ulrika, Bennett and Yvla", when Ralph dies, Ulrika's sprite becomes the lead as normal, but when I press L, the player's sprite stays the same (as opposed to going to Yvla's sprite).
BTW: Late Happy Canada Day.
Pardon the necropost, but I've found a bug.
For testing purposes, I've made all the skills in the database usable both in battle and in the menu, and when casting Poison on the party leader I get this error:
Script 'No Zombie Leaders' line 33: SystemStackError occurred.
stack level too deep
I have to mention though, it happens randomly, because most of the times I can cast Poison just fine.
death to zombies! thx for the script
so if i understand.. i tink i do not understand anyway..first tnking:if 1 actor die..it will switch with the stanby ally. second tinking:the actor disapear
wut is it?
I don't know if English is your first language, but that post is kind of hard to understand itself. This is how I interpreted your question (please correct me if I am wrong):
Quote from: digdarkevil on November 06, 2011, 11:25:56 PM
So if I understand (though I don't think I understand), this script does one of two things:
First thought: if 1 actor dies, the party sprite on the map will switch to a standby actor.
Second thought: the party sprite on the map disappears altogether.
Which is it?
If that is what you meant, then your first thought is correct. If the lead actor is dead, then the party sprite will be the next living actor.
IE. if your party is Ralph, Ulrika, Bennett, Ylva
If Ralph is not dead, then Ralph is the leader.
If Ralph is dead and Ulrika is not dead, then Ulrika is the leader.
If Ralph and Ulrika are dead and Bennett is not dead, then Bennet is the leader.
If everyone except Ylva is dead, then Ylva is the party leader.
If everyone is dead then it's game over, so there's no need for a party leader.
Your second thought would make this script just about one of the worst scripts ever. Unless what you meant is that you thought the actor was also taken out of the party, in which case you are talking about a permanent death script. That's not as objectively bad an idea, but that's not what this script does. It can be done via eventing and there probably is some script out there which does it.
Ok Tanks, Now I understand ;8
And yes, english isn't my firts language hehe..i didn't noticed it was so easy to know :lol:
So If I'm Correct,Your Script Is Supposed To Change The ''name'' of the party by switching the party leader rigth?so when the battle ends it will be written for exemple instead of:ralph's party Was Victorious!!! ''ralph'' in the exemple will be switched with the next party leader.
Lol,sorry for being so annoying,if i m not correct, but i understand better now tanks :D
No, not quite, though that would be a logical extension of the script and I could certainly add it if you want. What this script does is change the sprite that is on the map.
So, you would normally walk around as Ralph, but if he is dead, then you'd walk around as the next party member, etc..
Ie. it changes the graphic of the player that walks around on the map. Just try it out and see.
OOOOOOOOOOOOOOH!!!!!!!!!!!
NOW I UNDERSTAND ;D
LOL, Nice Script You Got There :)
hey i'm getting an error when I try to test my game I get
Script 'No Zombie Leaders' line 29: ArgumentError occurred.
wrong number of arguments(0 for 1)
What is this and how can I fix it?
Well, in the version of this script posted on this thread, line 29 is a comment, so it is not the line throwing that error. Are you sure that is the line that is identified? And are you sure that you correctly copied the script?
If you are, then I would ask that you copy the version of the script you have and post it so that I can take a look.
Yeah I copied it to a "T". This happened the last time I tried this Script.
Then copy, paste and post your copy of the script.
Well I would have, but I got ticked because I couldn't Battle Test or Play Test so I deleted the script. But I copied and pasted the Script from this page.
Well, line 29 is a comment, so it is impossible that that error was thrown from there. Maybe you have not accurately remembered the line number? If so, you could try putting it into your project again and seeing what line number it gives.
In any case, I am unable to reproduce the error. Maybe you could try reproducing this error in a new demo project and sharing it with me so that I could see what is going wrong.
Otherwise, I cannot help you. Sorry.
This is really good but when using the catepillar script,what happens is that you see the same character twice...really good tho!
Which caterpillar script?