Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 XAS Battle System, changing Leader
#7
Code:
#------------------#
#Dod Change Leader #
#by:Dodoop #
#version:1.0 #
#------------------#
#
# Edited by: Night_Runner
# Date: 15/Sept/09
#
# Designed to: Turn on the switch corresponding with the leading player's ID
# (and turn off the switch from the last leading player). And update the
# leading player before battle (designed to be compatable with MOG XAS Hud
# V2.6.
#
#-----------------#
#Muda o líder quando uma certa tecla for pressionada no mapa.
module Dodoop
    #Tecla que devera ser pressiona para mudar o líder.
    CHANGE_LEADER_INPUT = Input::L
end
class Scene_Map
    alias change_leader update
    def update
    change_leader
   if Input.trigger?(Dodoop::CHANGE_LEADER_INPUT)
    leader_read
    @sthero.update
   end
    $game_switches[$game_party.actors[0].id] = true # Turns on the switch of
    # the leading hero
end

def leader_read
    $game_switches[$game_party.actors[0].id] = false # Turns off the switch of
    # the last hero
    @actors = []
   for i in 0...$game_party.actors.size
    @actors[i] = $game_party.actors[i]
   end
   for i in 1...@actors.size
    $game_party.actors[i - 1] = @actors[i]
   end
@Xas_Window_Skill.update
    $game_party.actors[@actors.size - 1] = @actors[0]
    $game_player.refresh
    $game_party.refresh # Needed to update the party order.
    @sthero.refresh # Only to be used with MOG's XAS, refreshes the HUD.
    @sthero.update if @sthero != nil
    @sthero.refresh if @sthero != nil
    @sthero.update if @sthero != nil
   if @sthero != nil
     @sthero.dispose
     @sthero = Window_HUD.new
     @sthero.x = XAS_HUD::XASHUD_X
     @sthero.y = XAS_HUD::XASHUD_Y
     if $game_switches[XAS_HUD::DISABLE_STATUS_HUD_SWITCH] == false
       @sthero.visible = true
     else
      @sthero.visible = false
     end
    @sthero.update
   end
end
end

#================================================#
# Game_Party
#================================================#

class Game_Party

def remove_actor(actor_id)
    # Delete actor
    @actors.delete($game_actors[actor_id])
    # Refresh player
    $game_player.refresh
    $game_switches[actor_id] = false # If the actor is removed, they cannot
    # be the leading hero.
end
end

ok here try this one now
Reply }


Messages In This Thread
XAS Battle System, changing Leader - by pez - 09-17-2009, 03:12 PM
XAS Battle System, changing Leader - by Legacy - 09-17-2009, 03:20 PM
XAS Battle System, changing Leader - by pez - 09-17-2009, 03:42 PM
XAS Battle System, changing Leader - by Legacy - 09-17-2009, 04:12 PM
XAS Battle System, changing Leader - by pez - 09-17-2009, 04:32 PM
XAS Battle System, changing Leader - by Legacy - 09-17-2009, 05:24 PM
XAS Battle System, changing Leader - by Legacy - 09-17-2009, 06:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
   ACBS - Atoa Custom Battle System and TP System zlsl 2 3,788 10-20-2021, 05:09 AM
Last Post: zlsl
   [RMXP] Showing skill gained by leveling up on battle result FrQise 12 10,490 05-07-2021, 02:05 PM
Last Post: FrQise
   Adding face script on Cogwheel's RTAB Battle Status rekkatsu 15 13,125 08-25-2020, 03:09 AM
Last Post: DerVVulfman
   I want to add an Atoa Custom Battle System command cut-in. zlsl 11 12,045 11-11-2019, 08:55 PM
Last Post: DerVVulfman
   Question about ACBS (Atoa Custom Battle System) aeliath 10 11,054 08-08-2019, 02:50 PM
Last Post: aeliath
   YAMI Battle symphony + Holder add on (Loop casting anim) Starmage 0 3,932 03-01-2018, 09:03 AM
Last Post: Starmage
   (RMVXace) Battle error with Tankentai's battle system, help. x( Starmage 0 3,514 02-14-2018, 04:25 PM
Last Post: Starmage
   Atoa Individual Battle Commands Geminil 3 6,252 08-02-2017, 03:17 AM
Last Post: DerVVulfman
   Problems with counteraatack addon of Atoa Custom Battle System Djigit 22 31,787 01-05-2017, 08:05 PM
Last Post: Noctis
   RMXP SKill animations too bright (overlaying the battle screen) Starmage 4 9,252 06-13-2016, 03:41 AM
Last Post: Starmage



Users browsing this thread: