The RPG Maker Resource Kit

RMRK RPG Maker Creation => Requests => Script Request => Topic started by: COURAGIOUS SON on July 19, 2011, 10:54:19 PM

Title: Remove 2nd, 3rd, and 4th party member upon death
Post by: COURAGIOUS SON on July 19, 2011, 10:54:19 PM
Hey dont kno if this should be on this forum but I was wondering if anybody would be willing to make me a script that removes the 2nd, 3rd, and 4th party member upon death, but ends the game when the first party member dies, I am using an ABS so idk if that makes a difference, thank you
Title: Re: Remove 2nd, 3rd, and 4th party member upon death
Post by: cozziekuns on July 19, 2011, 11:04:30 PM
This can be done with events. Make a Common Event with a parallel process conditional branch checking if the actor in the first slot is incapacitated, and that if he/she is, then it processes the Game Over Screen.
Title: Re: Remove 2nd, 3rd, and 4th party member upon death
Post by: DoctorTodd on July 19, 2011, 11:05:58 PM
There is a script for. I will try to find it.
Title: Re: Remove 2nd, 3rd, and 4th party member upon death
Post by: COURAGIOUS SON on July 19, 2011, 11:16:16 PM
Quote from: cozziekuns on July 19, 2011, 11:04:30 PM
This can be done with events. Make a Common Event with a parallel process conditional branch checking if the actor in the first slot is incapacitated, and that if he/she is, then it processes the Game Over Screen.


Sorry if im being an absolute newb but I tried the common event and the event trigger is on parrallell but what do I put under condition switch??
Title: Re: Remove 2nd, 3rd, and 4th party member upon death
Post by: DoctorTodd on July 19, 2011, 11:18:38 PM
Here you go  :) Credit goes to Jet
#===============================================================================
# Remove Dead Actors (Compatability Mode) Snippet
# By Jet10985 (Jet)
# Original Code by: Piejamas
#===============================================================================
# This snippet will allow you to remove actors from the party all together when
# they are inflicted with "incapacitated" state. I re-made this from Piejamas'
# code to make it compatable with a couple of my snippets and to improve checking.
# This script has: 2 customization options.
#===============================================================================
# Overwritten Methods:
# None
#-------------------------------------------------------------------------------
# Aliased methods:
# Game_Battler: hp=
#===============================================================================
=begin
How To Change Actors:

use the following command in the "script..." event command:

change_removable(actor, option)

actor = actor id that will be added/removed from the list.
option = true or false. True adds them to the list of non-removable, false makes
the removable.

=end

module RemoveDeadActors
 
  NO_REMOVE_ACTOR = [1, 5] # Actors that will NOT be removed. Can be changed later.
 
  NO_REMOVE_STATE = 17 # An actor inflicted with this state will not be removed.
 
end

#===============================================================================
# DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
#===============================================================================
class Game_Battler
 
  include RemoveDeadActors
 
  alias jet4398_newhp hp= unless $@
  def hp=(*args)
    self.jet4398_newhp(*args)
    $game_system.no_removal = NO_REMOVE_ACTOR.clone if $game_system.no_removal.nil?
    if @states.include?(1) && !$game_system.no_removal.include?(self.id) && !@states.include?(NO_REMOVE_STATE)
      $game_party.remove_actor(self.id) if self.actor?
    end
  end
end

class Game_System
 
  attr_accessor :no_removal
 
end

class Game_Interpreter
 
  include RemoveDeadActors
 
  def change_removable(actor, option)
    $game_system.no_removal = NO_REMOVE_ACTOR.clone if $game_system.no_removal.nil?
    if option == true
      $game_system.no_removal.push(actor) unless $game_system.no_removal.include?(actor)
    elsif option == false
      $game_system.no_removal.delete(actor) if $game_system.no_removal.include?(actor)
    elsif
      p "The option you chose was neither true or false. Please error check and try again"
    end
  end
end

unless $engine_scripts.nil?
  JetEngine.active("Remove Dead Actors", 1.2)
end 
Title: Re: Remove 2nd, 3rd, and 4th party member upon death
Post by: COURAGIOUS SON on July 19, 2011, 11:46:54 PM
Quote from: DoctorTodd on July 19, 2011, 11:18:38 PM
Here you go  :) Credit goes to Jet
#===============================================================================
# Remove Dead Actors (Compatability Mode) Snippet
# By Jet10985 (Jet)
# Original Code by: Piejamas
#===============================================================================
# This snippet will allow you to remove actors from the party all together when
# they are inflicted with "incapacitated" state. I re-made this from Piejamas'
# code to make it compatable with a couple of my snippets and to improve checking.
# This script has: 2 customization options.
#===============================================================================
# Overwritten Methods:
# None
#-------------------------------------------------------------------------------
# Aliased methods:
# Game_Battler: hp=
#===============================================================================
=begin
How To Change Actors:

use the following command in the "script..." event command:

change_removable(actor, option)

actor = actor id that will be added/removed from the list.
option = true or false. True adds them to the list of non-removable, false makes
the removable.

=end

module RemoveDeadActors
 
  NO_REMOVE_ACTOR = [1, 5] # Actors that will NOT be removed. Can be changed later.
 
  NO_REMOVE_STATE = 17 # An actor inflicted with this state will not be removed.
 
end

#===============================================================================
# DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
#===============================================================================
class Game_Battler
 
  include RemoveDeadActors
 
  alias jet4398_newhp hp= unless $@
  def hp=(*args)
    self.jet4398_newhp(*args)
    $game_system.no_removal = NO_REMOVE_ACTOR.clone if $game_system.no_removal.nil?
    if @states.include?(1) && !$game_system.no_removal.include?(self.id) && !@states.include?(NO_REMOVE_STATE)
      $game_party.remove_actor(self.id) if self.actor?
    end
  end
end

class Game_System
 
  attr_accessor :no_removal
 
end

class Game_Interpreter
 
  include RemoveDeadActors
 
  def change_removable(actor, option)
    $game_system.no_removal = NO_REMOVE_ACTOR.clone if $game_system.no_removal.nil?
    if option == true
      $game_system.no_removal.push(actor) unless $game_system.no_removal.include?(actor)
    elsif option == false
      $game_system.no_removal.delete(actor) if $game_system.no_removal.include?(actor)
    elsif
      p "The option you chose was neither true or false. Please error check and try again"
    end
  end
end

unless $engine_scripts.nil?
  JetEngine.active("Remove Dead Actors", 1.2)
end 


Hey Im sorry to bother you again but when a party member dies I go into the party and exit out i get an error (Script 'requiem group command' Line 27 nomethoderror
occurred. undefined method 'dead?' for nil:Nilclass

Here is line 27


def enabled?
    return false if $game_party.members[$ally_index].dead?
    return false if $game_party.members[$ally_index].piece.map_id != $game_map.map_id
    return true
  end
 
end
Title: Re: Remove 2nd, 3rd, and 4th party member upon death
Post by: DoctorTodd on July 20, 2011, 12:10:22 AM
Make sure to put below group command, if that doesn't work then it is most likely incompatible and you would need to try the event way.  :D
Title: Re: Remove 2nd, 3rd, and 4th party member upon death
Post by: COURAGIOUS SON on July 20, 2011, 12:24:47 AM
Quote from: DoctorTodd on July 20, 2011, 12:10:22 AM
Make sure to put below group command, if that doesn't work then it is most likely incompatible and you would need to try the event way.  :D

Yeh thanks for the script but it must not be compatiable with my abs, if you would be willing to post an eventing tuturial or give me a different abs script, but if thats to much then thats fine
Title: Re: Remove 2nd, 3rd, and 4th party member upon death
Post by: DoctorTodd on July 20, 2011, 12:29:04 AM
I use this ABS http://rmrk.net/index.php/topic,33456.0.html (http://rmrk.net/index.php/topic,33456.0.html) if it doesn't work then I will post a tutorial later on for you  :)
Title: Re: Remove 2nd, 3rd, and 4th party member upon death
Post by: COURAGIOUS SON on July 20, 2011, 12:32:53 AM
Quote from: DoctorTodd on July 20, 2011, 12:29:04 AM
I use this ABS http://rmrk.net/index.php/topic,33456.0.html (http://rmrk.net/index.php/topic,33456.0.html) if it doesn't work then I will post a tutorial later on for you  :)


very very much apreciated
Title: Re: Remove 2nd, 3rd, and 4th party member upon death
Post by: DoctorTodd on July 20, 2011, 12:42:28 AM
So I take it that it worked?