RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
No Zombie Leaders!

0 Members and 2 Guests are viewing this topic.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
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


Code: [Select]
#==============================================================================
#    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


  • modern algebra

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.
« Last Edit: June 27, 2011, 06:10:19 PM by modern algebra »

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
This looks like a nice quick fix for an irritating problem.

Great job Modern.

****
I saw a squirrel...
Rep:
Level 82
...it got in my way.
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
« Last Edit: May 08, 2010, 12:44:09 AM by Strak »

Gods ain't gonna help ya son...

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
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

**
Rep: +0/-0Level 79
RMRK Junior
Hi, I got an error when using this script.

line 59: NoMethodError occurred.
undefined method '>' for false:FalseClass

Thanks.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Sorry. At that line, delete the exclamation mark.

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
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.
« Last Edit: July 03, 2010, 12:23:40 AM by cozziekuns »

***
Rep:
Level 75
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.

****
Rep:
Level 69
death to zombies! thx for the script

**
Rep: +0/-0Level 67
RPGVX Advanced (I Do Not Script Tough)
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?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
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):

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.
« Last Edit: November 07, 2011, 12:55:07 AM by modern algebra »

**
Rep: +0/-0Level 67
RPGVX Advanced (I Do Not Script Tough)
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

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
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.

**
Rep: +0/-0Level 67
RPGVX Advanced (I Do Not Script Tough)
OOOOOOOOOOOOOOH!!!!!!!!!!!

NOW I UNDERSTAND ;D
LOL, Nice Script You Got There :)

**
Rep: +0/-0Level 62
RMRK Junior
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?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
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.

**
Rep: +0/-0Level 62
RMRK Junior
Yeah I copied it to a "T". This happened the last time I tried this Script.

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Then copy, paste and post your copy of the script.
it's like a metaphor or something i don't know

**
Rep: +0/-0Level 62
RMRK Junior
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.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
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.

*
Rep: +0/-0Level 68
RMRK Junior
This is really good but when using the catepillar script,what happens is that you see the same character twice...really good tho!

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Which caterpillar script?