Save-Point
Lead Actor Swapper - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Archives (https://www.save-point.org/forum-105.html)
+--- Forum: Creation Asylum Archives (https://www.save-point.org/forum-90.html)
+---- Forum: Scripts & Code Snippets (https://www.save-point.org/forum-92.html)
+----- Forum: RPG Maker XP Code (https://www.save-point.org/forum-93.html)
+------ Forum: Enhancement/Modification Scripts (https://www.save-point.org/forum-98.html)
+------ Thread: Lead Actor Swapper (/thread-6559.html)



Lead Actor Swapper - Sheol - 03-11-2007

Lead Actor Swapper
by Sheol
VersiĆ³n: 1.01
Mar 11 2007

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Introduction

SephirothTDS requested it (I think), so when you type R or L on map, it'll change the character of the player, like in Breath of Fire.

Version History

Version 1.01 (March 18, 07)
- Fixed: Little bug when using L

Script
Code:
#==============================================================
# ** Lead Actor Swapper
#------------------------------------------------------------------------------
# Slipknot (creationasylum.net)
# Version 1.01
# March 18, 2006
#==============================================================

class Game_System
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  attr_reader :lead_actor
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  alias slipknot_las_init initialize
  #--------------------------------------------------------------------------
  # * Initialize
  #--------------------------------------------------------------------------
  def initialize
    slipknot_las_init
    @lead_actor = 0
  end
  #--------------------------------------------------------------------------
  # * Lead Actor
  #--------------------------------------------------------------------------
  def lead_actor=(n)
    @lead_actor = n
    $game_player.refresh
  end
end


class Game_Player
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias slipknot_las_update update
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if $game_party.actors.size == 0
      @character_name = ''
      @character_hue = 0
      return
    end
    actor = $game_party.actors[$game_system.lead_actor]
    @character_name = actor.character_name
    @character_hue = actor.character_hue
    @opacity = 255
    @blend_type = 0
  end
  #--------------------------------------------------------------------------
  # * Update
  #--------------------------------------------------------------------------
  def update
    slipknot_las_update
    if Input.trigger?(Input::R)
      $game_system.lead_actor = ($game_system.lead_actor + 1) % $game_party.actors.size
    end
    if Input.trigger?(Input::L)
      $game_system.lead_actor = ($game_system.lead_actor - 1) % $game_party.actors.size
    end
  end
end

Instructions

Paste the code above Main and below Game_Player.
Change the character with R and L.

Compatibility

Everything, i believe