Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: Zexion on May 14, 2011, 06:31:02 pm

Title: Blizz Abs Main characters
Post by: Zexion on May 14, 2011, 06:31:02 pm
Hey I was just wondering if there was a possible way to make it so that only certain "main characters" can be switched and playable.
Example:
Spoiler: ShowHide
A1= actor 1
A2= actor 2
A3= support char 3

A1,A2,A3
Leader Change:
A2,A1,A3
Another Leader Change:
A1,A2,A3

as you can see actor 3 is never played or switched too and is mainly a party character.

Is this possible to do in blizz abs?
Title: Re: Blizz Abs Main characters
Post by: LiTTleDRAgo on May 15, 2011, 09:40:27 am
this code is in Blizz ABS 2.7.9

module BlizzABS
 
  class Controller
   
   
    def switch_leader
      # store the old party leader
      leader = player
      # iterate "number of party members" times
      $game_party.actors.size.times {
          # change party leader
          $game_party.add_actor($game_party.actors.shift.id)
          # until finding one who's not dead
          break if $game_party.actors[0] != nil &&
          !$game_party.actors[0].dead? &&
          #-------------------------------------------------------------
          $game_party.actors[0].id != 2 &&
          $game_party.actors[0].id != 3
          #-------------------------------------------------------------
          }
      # stop if party leader has not changed
      return if leader == player
      # enforce emptying moving buffer and add special command
      update_buffer(nil)
      # center screen display on new player controlled character
      center(player.x, player.y, true) if $game_system.caterpillar
      # except if charging
      unless player.charging?
        # reset player action
        player.reset_action
        # reset player action counter
        player.in_action = 0
      end
      # except if charging
      unless leader.charging?
        # reset old leader action
        leader.reset_action
        # reset old leader action counter
        leader.in_action = 0
      end
      # set flag for HUD update
      $game_temp.hud_refresh = true
    end
  end
end