XAS Battle System, changing Leader
#1
Hey all, I'm just having a lil trouble with what I am trying to achieve, hopefully someone here can help me again...

Below I have Two links and a Script
-XAS Battle Script
-An Extra Set of Actor Graphics for XAS Hero
-Modified DoD Change Leader

The Problem I Having is....
Is when the Leader Changes, the Skill Button 'D' doesn't change. For example if say 'Actor 1' knows Fire 1 and 'Actor 2' knows Thunder 1, when you change leader from 'Actor 1' to 'Actor 2' the skill doesn't change over.
Another issue (although not a big problem) is the same effect above happens to items as well.
Also if a 'Actor 1' leaves with the equipped with a Bronze Sword and is added back into the party the Sword is lost.

What Works
- When you change Leader the info gets updated in the HUD.
- The Equipped weapon stays with the Actor

http://atelier-rgss.com/RGSS/Battle/XAS_00a.html - XAS battle System
Script - MISC
Line 14 Change
PHP Code:
<?php 
SKILL_CHANGE
= Input::L
#Usar Item.
to
PHP Code:
<?php 
SKILL_CHANGE
= Input::R
#Usar Item.
- This will make the Script below work to change Leader without having the menu pop up all the time.

http://tmnt-fsc.net/Characters.zip - Extra Hero Graphics

-DoD Change Leader Script
PHP Code:
<?php 
#------------------#
#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
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
$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



Code:
#_______________________________________________________________________________
# MOG XAS Hud V2.6          
#_______________________________________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_______________________________________________________________________________
# Apresenta o status do herói no mapa.
# (HP,SP,Condição,Exp,level) em imagens.
#_______________________________________________________________________________
# Imagens necessarias.
#
# Nome_do_Personagem + _Face.png
# HP_Meter.png
# SP_Meter.png
# HP_Tx.png
# SP_Tx.png
# LV_Tx.png
# Bar_Meter.png
# Exp_Back.png
# Exp_Meter.png
#
#_______________________________________________________________________________
module XAS_HUD
    #Posição das janelas
    XASHUD_X = 0  
    XASHUD_Y = 370
    #ID da switch que desativa a janela do Status.
    DISABLE_STATUS_HUD_SWITCH = 5
    #Mostrar ícones dos status
    ICON_STATES = true
    #Deixar o HUD opaco caso o herói estiver em cima do HUD.
    FADE = true
end
$mog_rgss_xas_hud = true
###############
# Window_Base #
###############
class Window_Base < Window  
def draw_maphp2(actor, x, y)
    actor = $game_party.actors[0]    
    self.contents.font.size = 18  
    back = RPG::Cache.picture("BAR_Meter")    
    cw = back.width  
    ch = back.height
    src_rect = Rect.new(0, 0, cw, ch)    
    self.contents.blt(x + 62, y - ch + 28, back, src_rect)
    meter = RPG::Cache.picture("HP_Meter")    
    cw = meter.width  * actor.hp / actor.maxhp
    ch = meter.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 62, y - ch + 28, meter, src_rect)
    text = RPG::Cache.picture("HP_Tx")    
    cw = text.width  
    ch = text.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 35, y - ch + 30, text, src_rect)
    self.contents.font.color = Color.new(0,0,0,255)
    self.contents.draw_text(x + 76, y - 1, 48, 32, actor.hp.to_s, 2)
    lowhp = actor.maxhp * 20 / 100
    avhp = actor.maxhp * 50 / 100
    if actor.hp <= lowhp
    self.contents.font.color = Color.new(255,55,55,255)
    elsif actor.hp <= avhp
    self.contents.font.color = Color.new(255,255,55,255)
    else
    self.contents.font.color = Color.new(255,255,255,255)
    end
    self.contents.draw_text(x + 75, y - 2, 48, 32, actor.hp.to_s, 2)    
end  
def draw_mapsp2(actor, x, y)
    actor = $game_party.actors[0]    
    self.contents.font.size = 18  
    back = RPG::Cache.picture("BAR_Meter")    
    cw = back.width  
    ch = back.height
    src_rect = Rect.new(0, 0, cw, ch)    
    self.contents.blt(x + 62, y - ch + 28, back, src_rect)    
    meter = RPG::Cache.picture("SP_Meter")    
    cw = meter.width  * actor.sp / actor.maxsp
    ch = meter.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 62, y - ch + 28, meter, src_rect)
    text = RPG::Cache.picture("SP_Tx")    
    cw = text.width  
    ch = text.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 35, y - ch + 30, text, src_rect)
    self.contents.font.color = Color.new(0,0,0,255)
    self.contents.draw_text(x + 76, y - 1, 48, 32, actor.sp.to_s, 2)
    self.contents.font.color = Color.new(255,255,255,255)
    self.contents.draw_text(x + 75, y - 2, 48, 32, actor.sp.to_s, 2)    
end  
  
  
  

def nada
face = RPG::Cache.picture("")
end  
def draw_heroface(actor,x,y)
    face = RPG::Cache.picture(actor.name + "_face") rescue nada
    cw = face.width
    ch = face.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x , y - ch, face, src_rect)    
end  
def draw_actor_statemap(actor, x, y, width = 100)
if XAS_HUD::ICON_STATES == false  
    self.contents.font.size = 16    
    text = make_battler_state_text(actor, width, true)
    self.contents.font.color = Color.new(0,0,0,255)
    self.contents.draw_text(x + 1, y + 1, width, 32, text)
    self.contents.font.color = Color.new(250,255,255,255)
    self.contents.draw_text(x, y, width, 32, text)
else
sta = []
for i in actor.states
    sta.push($data_states[i].name)
    for s in 0...sta.size
      if s < 4
      bitmap = RPG::Cache.icon(sta[s])
      self.contents.blt(x + (25 * s), y + 4, bitmap, Rect.new(0, 0, 32, 32))
      end
    end
end  
end  





#
end
def draw_actor_levelmap(actor, x, y)
    bitmap2 = RPG::Cache.picture("Exp_Back")
    cw = bitmap2.width
    ch = bitmap2.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 10 , y - ch + 30, bitmap2, src_rect)
  
    self.contents.font.size = 16  
    actor = $game_party.actors[0]
    if actor.next_exp != 0
    rate = actor.now_exp.to_f / actor.next_exp
    else
    rate = 1
    end
    bitmap = RPG::Cache.picture("Exp_Meter")
    if actor.level < 99
    cw = bitmap.width * rate
    else
    cw = bitmap.width
    end  
    ch = bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 10 , y - ch + 30, bitmap, src_rect)
    text = RPG::Cache.picture("LV_Tx")    
    cw = text.width  
    ch = text.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 0, y - ch + 30, text, src_rect)  
    self.contents.font.size = 18  
    self.contents.font.color = Color.new(0,0,0,255)
    self.contents.draw_text(x + 30, y - 4, 24, 32, actor.level.to_s, 1)
    self.contents.font.color = Color.new(255,255,255,255)    
    self.contents.draw_text(x + 31, y - 5, 24, 32, actor.level.to_s, 1)    
end
end
##############
# Game_Actor #
##############
class Game_Actor < Game_Battler
def now_exp
    return @exp - @exp_list[@level]
end
def next_exp
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
    end
end
#####################
# Window_Status_Map #
#####################
class Window_HUD < Window_Base
def initialize
    super(0, 0, 270, 125)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.windowskin = RPG::Cache.windowskin("")    
    self.contents.font.bold = true
    self.contents.font.name = "Georgia"
    self.opacity = 0
    @actor = $game_party.actors[0]
    if @actor != nil
    @old_hp = @actor.hp
    @old_sp = @actor.sp
    @old_level = @actor.level
    @old_state = @actor.states.to_s
    @old_exp = @actor.exp
    refresh
    end
end  
def refresh
  self.contents.clear
    draw_maphp2(@actor, 5, 35)
    draw_mapsp2(@actor, -35, 55)
    draw_heroface(@actor, 0, 60)
    draw_actor_statemap(@actor, 140, 62, 70)
    draw_actor_levelmap(@actor, 45, 10)  
    @old_hp = @actor.hp
    @old_sp = @actor.sp
    @old_level = @actor.level
    @old_state = @actor.states.to_s
    @old_exp = @actor.exp    
end
def update
    if XAS_HUD::FADE == true
    x = ($game_player.real_x - $game_map.display_x) / 4
    y = ($game_player.real_y - $game_map.display_y) / 4
    hud_size_x = 180
    hud_size_y = 100
    oc_range_x = hud_size_x + XAS_HUD::XASHUD_X
    oc_range_y = hud_size_y + XAS_HUD::XASHUD_Y
      if x < oc_range_x and x > XAS_HUD::XASHUD_X - 5 and
         y > XAS_HUD::XASHUD_Y and y < oc_range_y
      self.contents_opacity -= 10 if  self.contents_opacity > 120
      else
      self.contents_opacity += 10 if  self.contents_opacity < 255
      end
   end
   if @actor != nil  
   if @old_hp != @actor.hp or
      @old_sp != @actor.sp or
      @old_level != @actor.level or
      @old_state != @actor.states.to_s or
      @old_exp != @actor.exp      
   refresh
   end
   end
end
end
###############
# Game_Player #
###############
class Game_Player < Game_Character
    attr_accessor :wref
end
#############
# Scene_Map #
#############
class Scene_Map
alias mog11_main main
def main
    @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    
    mog11_main
    @sthero.dispose
end
alias mog11_update update
def update
    if $game_switches[XAS_HUD::DISABLE_STATUS_HUD_SWITCH] == false
    @sthero.visible = true  
    else
    @sthero.visible = false  
    end      
    @sthero.update
    mog11_update
end    
end
Reply }
#2
hmm im so not sure if this is going to work.

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::R
end
class Scene_Map
    alias change_leader update
    def update
    change_leader
   if Input.trigger?(Dodoop::CHANGE_LEADER_INPUT)
    leader_read
   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
    $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
Reply }
#3
Nah mate sorry no change...
Reply }
#4
right this was just a total guess and probably will not work, since i dont hacve the XAS system, i can really do much but guess.

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::R
end
class Scene_Map
    alias change_leader update
    def update
    change_leader
   if Input.trigger?(Dodoop::CHANGE_LEADER_INPUT)
    leader_read
   end
    $game_switches[$game_party.actors[0].id] = true # Turns on the switch of
    $game_switches[$data_skills[0].id] = true
    # the leading hero
end

def leader_read
    $game_switches[$game_party.actors[0].id] = false # Turns off the switch of
    $game_switches[$data_skills[0].id] = false
    # 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
    $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
Reply }
#5
I edited my post for you to include the HUD to give you more of an idea.
Reply }
#6
right, try this

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::R
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
    $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, replace the XAS HUD with this one

Code:
#_______________________________________________________________________________?
# MOG XAS Hud V2.6          
#_______________________________________________________________________________?
# By Moghunter
# http://www.atelier-rgss.com
#_______________________________________________________________________________?
# Apresenta o status do herói no mapa.
# (HP,SP,Condição,Exp,level) em imagens.
#_______________________________________________________________________________?
# Imagens necessarias.
#
# Nome_do_Personagem + _Face.png
# HP_Meter.png
# SP_Meter.png
# HP_Tx.png
# SP_Tx.png
# LV_Tx.png
# Bar_Meter.png
# Exp_Back.png
# Exp_Meter.png
#
#_______________________________________________________________________________?
module XAS_HUD
    #Posição das janelas
    XASHUD_X = 0  
    XASHUD_Y = 370
    #ID da switch que desativa a janela do Status.
    DISABLE_STATUS_HUD_SWITCH = 5
    #Mostrar ícones dos status
    ICON_STATES = true
    #Deixar o HUD opaco caso o herói estiver em cima do HUD.
    FADE = true
end
$mog_rgss_xas_hud = true
###############
# Window_Base #
###############
class Window_Base < Window  
def draw_maphp2(actor, x, y)
    actor = $game_party.actors[0]    
    self.contents.font.size = 18  
    back = RPG::Cache.picture("BAR_Meter")    
    cw = back.width  
    ch = back.height
    src_rect = Rect.new(0, 0, cw, ch)    
    self.contents.blt(x + 62, y - ch + 28, back, src_rect)
    meter = RPG::Cache.picture("HP_Meter")    
    cw = meter.width  * actor.hp / actor.maxhp
    ch = meter.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 62, y - ch + 28, meter, src_rect)
    text = RPG::Cache.picture("HP_Tx")    
    cw = text.width  
    ch = text.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 35, y - ch + 30, text, src_rect)
    self.contents.font.color = Color.new(0,0,0,255)
    self.contents.draw_text(x + 76, y - 1, 48, 32, actor.hp.to_s, 2)
    lowhp = actor.maxhp * 20 / 100
    avhp = actor.maxhp * 50 / 100
    if actor.hp <= lowhp
    self.contents.font.color = Color.new(255,55,55,255)
    elsif actor.hp <= avhp
    self.contents.font.color = Color.new(255,255,55,255)
    else
    self.contents.font.color = Color.new(255,255,255,255)
    end
    self.contents.draw_text(x + 75, y - 2, 48, 32, actor.hp.to_s, 2)    
end  
def draw_mapsp2(actor, x, y)
    actor = $game_party.actors[0]    
    self.contents.font.size = 18  
    back = RPG::Cache.picture("BAR_Meter")    
    cw = back.width  
    ch = back.height
    src_rect = Rect.new(0, 0, cw, ch)    
    self.contents.blt(x + 62, y - ch + 28, back, src_rect)    
    meter = RPG::Cache.picture("SP_Meter")    
    cw = meter.width  * actor.sp / actor.maxsp
    ch = meter.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 62, y - ch + 28, meter, src_rect)
    text = RPG::Cache.picture("SP_Tx")    
    cw = text.width  
    ch = text.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 35, y - ch + 30, text, src_rect)
    self.contents.font.color = Color.new(0,0,0,255)
    self.contents.draw_text(x + 76, y - 1, 48, 32, actor.sp.to_s, 2)
    self.contents.font.color = Color.new(255,255,255,255)
    self.contents.draw_text(x + 75, y - 2, 48, 32, actor.sp.to_s, 2)    
end  
  
  
  

def nada
face = RPG::Cache.picture("")
end  
def draw_heroface(actor,x,y)
    face = RPG::Cache.picture(actor.name + "_face") rescue nada
    cw = face.width
    ch = face.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x , y - ch, face, src_rect)    
end  
def draw_actor_statemap(actor, x, y, width = 100)
if XAS_HUD::ICON_STATES == false  
    self.contents.font.size = 16    
    text = make_battler_state_text(actor, width, true)
    self.contents.font.color = Color.new(0,0,0,255)
    self.contents.draw_text(x + 1, y + 1, width, 32, text)
    self.contents.font.color = Color.new(250,255,255,255)
    self.contents.draw_text(x, y, width, 32, text)
else
sta = []
for i in actor.states
    sta.push($data_states[i].name)
    for s in 0...sta.size
      if s < 4
      bitmap = RPG::Cache.icon(sta[s])
      self.contents.blt(x + (25 * s), y + 4, bitmap, Rect.new(0, 0, 32, 32))
      end
    end
end  
end  





#
end
def draw_actor_levelmap(actor, x, y)
    bitmap2 = RPG::Cache.picture("Exp_Back")
    cw = bitmap2.width
    ch = bitmap2.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 10 , y - ch + 30, bitmap2, src_rect)
  
    self.contents.font.size = 16  
    actor = $game_party.actors[0]
    if actor.next_exp != 0
    rate = actor.now_exp.to_f / actor.next_exp
    else
    rate = 1
    end
    bitmap = RPG::Cache.picture("Exp_Meter")
    if actor.level < 99
    cw = bitmap.width * rate
    else
    cw = bitmap.width
    end  
    ch = bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 10 , y - ch + 30, bitmap, src_rect)
    text = RPG::Cache.picture("LV_Tx")    
    cw = text.width  
    ch = text.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 0, y - ch + 30, text, src_rect)  
    self.contents.font.size = 18  
    self.contents.font.color = Color.new(0,0,0,255)
    self.contents.draw_text(x + 30, y - 4, 24, 32, actor.level.to_s, 1)
    self.contents.font.color = Color.new(255,255,255,255)    
    self.contents.draw_text(x + 31, y - 5, 24, 32, actor.level.to_s, 1)    
end
end
##############
# Game_Actor #
##############
class Game_Actor < Game_Battler
def now_exp
    return @exp - @exp_list[@level]
end
def next_exp
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
    end
end
#####################
# Window_Status_Map #
#####################
class Window_HUD < Window_Base
def initialize
    super(0, 0, 270, 125)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.windowskin = RPG::Cache.windowskin("")    
    self.contents.font.bold = true
    self.contents.font.name = "Georgia"
    self.opacity = 0
    @actor = $game_party.actors[0]
    if @actor != nil
    @old_hp = @actor.hp
    @old_sp = @actor.sp
    @old_level = @actor.level
    @old_state = @actor.states.to_s
    @old_exp = @actor.exp
    refresh
    end
end  
def refresh
  self.contents.clear
    draw_maphp2(@actor, 5, 35)
    draw_mapsp2(@actor, -35, 55)
    draw_heroface(@actor, 0, 60)
    draw_actor_statemap(@actor, 140, 62, 70)
    draw_actor_levelmap(@actor, 45, 10)  
    @old_hp = @actor.hp
    @old_sp = @actor.sp
    @old_level = @actor.level
    @old_state = @actor.states.to_s
    @old_exp = @actor.exp
    $game_player.refresh
    $game_party.refresh    
end
def update
    if XAS_HUD::FADE == true
    x = ($game_player.real_x - $game_map.display_x) / 4
    y = ($game_player.real_y - $game_map.display_y) / 4
    hud_size_x = 180
    hud_size_y = 100
    $game_player.refresh
    $game_party.refresh
    oc_range_x = hud_size_x + XAS_HUD::XASHUD_X
    oc_range_y = hud_size_y + XAS_HUD::XASHUD_Y
      if x < oc_range_x and x > XAS_HUD::XASHUD_X - 5 and
         y > XAS_HUD::XASHUD_Y and y < oc_range_y
      self.contents_opacity -= 10 if  self.contents_opacity > 120
      else
      self.contents_opacity += 10 if  self.contents_opacity < 255
      end
   end
   if @actor != nil  
   if @old_hp != @actor.hp or
      @old_sp != @actor.sp or
      @old_level != @actor.level or
      @old_state != @actor.states.to_s or
      @old_exp != @actor.exp      
   refresh
   end
   end
end
@sthero.update
end
###############
# Game_Player #
###############
class Game_Player < Game_Character
    attr_accessor :wref
end
#############
# Scene_Map #
#############
class Scene_Map
alias mog11_main main
def main
    @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    
    mog11_main
    @sthero.dispose
end
alias mog11_update update
def update
    if $game_switches[XAS_HUD::DISABLE_STATUS_HUD_SWITCH] == false
    @sthero.visible = true  
    else
    @sthero.visible = false  
    end      
    @sthero.update
    mog11_update
end    
end

Fingers crossed xD

Code:
#_______________________________________________________________________________?
# MOG XAS Hud V2.6          
#_______________________________________________________________________________?
# By Moghunter
# http://www.atelier-rgss.com
#_______________________________________________________________________________?
# Apresenta o status do herói no mapa.
# (HP,SP,Condição,Exp,level) em imagens.
#_______________________________________________________________________________?
# Imagens necessarias.
#
# Nome_do_Personagem + _Face.png
# HP_Meter.png
# SP_Meter.png
# HP_Tx.png
# SP_Tx.png
# LV_Tx.png
# Bar_Meter.png
# Exp_Back.png
# Exp_Meter.png
#
#_______________________________________________________________________________?
module XAS_HUD
    #Posição das janelas
    XASHUD_X = 0  
    XASHUD_Y = 370
    #ID da switch que desativa a janela do Status.
    DISABLE_STATUS_HUD_SWITCH = 5
    #Mostrar ícones dos status
    ICON_STATES = true
    #Deixar o HUD opaco caso o herói estiver em cima do HUD.
    FADE = true
end
$mog_rgss_xas_hud = true
###############
# Window_Base #
###############
class Window_Base < Window  
def draw_maphp2(actor, x, y)
    actor = $game_party.actors[0]    
    self.contents.font.size = 18  
    back = RPG::Cache.picture("BAR_Meter")    
    cw = back.width  
    ch = back.height
    src_rect = Rect.new(0, 0, cw, ch)    
    self.contents.blt(x + 62, y - ch + 28, back, src_rect)
    meter = RPG::Cache.picture("HP_Meter")    
    cw = meter.width  * actor.hp / actor.maxhp
    ch = meter.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 62, y - ch + 28, meter, src_rect)
    text = RPG::Cache.picture("HP_Tx")    
    cw = text.width  
    ch = text.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 35, y - ch + 30, text, src_rect)
    self.contents.font.color = Color.new(0,0,0,255)
    self.contents.draw_text(x + 76, y - 1, 48, 32, actor.hp.to_s, 2)
    lowhp = actor.maxhp * 20 / 100
    avhp = actor.maxhp * 50 / 100
    if actor.hp <= lowhp
    self.contents.font.color = Color.new(255,55,55,255)
    elsif actor.hp <= avhp
    self.contents.font.color = Color.new(255,255,55,255)
    else
    self.contents.font.color = Color.new(255,255,255,255)
    end
    self.contents.draw_text(x + 75, y - 2, 48, 32, actor.hp.to_s, 2)    
end  
def draw_mapsp2(actor, x, y)
    actor = $game_party.actors[0]    
    self.contents.font.size = 18  
    back = RPG::Cache.picture("BAR_Meter")    
    cw = back.width  
    ch = back.height
    src_rect = Rect.new(0, 0, cw, ch)    
    self.contents.blt(x + 62, y - ch + 28, back, src_rect)    
    meter = RPG::Cache.picture("SP_Meter")    
    cw = meter.width  * actor.sp / actor.maxsp
    ch = meter.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 62, y - ch + 28, meter, src_rect)
    text = RPG::Cache.picture("SP_Tx")    
    cw = text.width  
    ch = text.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 35, y - ch + 30, text, src_rect)
    self.contents.font.color = Color.new(0,0,0,255)
    self.contents.draw_text(x + 76, y - 1, 48, 32, actor.sp.to_s, 2)
    self.contents.font.color = Color.new(255,255,255,255)
    self.contents.draw_text(x + 75, y - 2, 48, 32, actor.sp.to_s, 2)    
end  
  
  
  

def nada
face = RPG::Cache.picture("")
end  
def draw_heroface(actor,x,y)
    face = RPG::Cache.picture(actor.name + "_face") rescue nada
    cw = face.width
    ch = face.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x , y - ch, face, src_rect)    
end  
def draw_actor_statemap(actor, x, y, width = 100)
if XAS_HUD::ICON_STATES == false  
    self.contents.font.size = 16    
    text = make_battler_state_text(actor, width, true)
    self.contents.font.color = Color.new(0,0,0,255)
    self.contents.draw_text(x + 1, y + 1, width, 32, text)
    self.contents.font.color = Color.new(250,255,255,255)
    self.contents.draw_text(x, y, width, 32, text)
else
sta = []
for i in actor.states
    sta.push($data_states[i].name)
    for s in 0...sta.size
      if s < 4
      bitmap = RPG::Cache.icon(sta[s])
      self.contents.blt(x + (25 * s), y + 4, bitmap, Rect.new(0, 0, 32, 32))
      end
    end
end  
end  





#
end
def draw_actor_levelmap(actor, x, y)
    bitmap2 = RPG::Cache.picture("Exp_Back")
    cw = bitmap2.width
    ch = bitmap2.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 10 , y - ch + 30, bitmap2, src_rect)
  
    self.contents.font.size = 16  
    actor = $game_party.actors[0]
    if actor.next_exp != 0
    rate = actor.now_exp.to_f / actor.next_exp
    else
    rate = 1
    end
    bitmap = RPG::Cache.picture("Exp_Meter")
    if actor.level < 99
    cw = bitmap.width * rate
    else
    cw = bitmap.width
    end  
    ch = bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 10 , y - ch + 30, bitmap, src_rect)
    text = RPG::Cache.picture("LV_Tx")    
    cw = text.width  
    ch = text.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x + 0, y - ch + 30, text, src_rect)  
    self.contents.font.size = 18  
    self.contents.font.color = Color.new(0,0,0,255)
    self.contents.draw_text(x + 30, y - 4, 24, 32, actor.level.to_s, 1)
    self.contents.font.color = Color.new(255,255,255,255)    
    self.contents.draw_text(x + 31, y - 5, 24, 32, actor.level.to_s, 1)    
end
end
##############
# Game_Actor #
##############
class Game_Actor < Game_Battler
def now_exp
    return @exp - @exp_list[@level]
end
def next_exp
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
    end
end
#####################
# Window_Status_Map #
#####################
class Window_HUD < Window_Base
def initialize
    super(0, 0, 270, 125)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.windowskin = RPG::Cache.windowskin("")    
    self.contents.font.bold = true
    self.contents.font.name = "Georgia"
    self.opacity = 0
    @actor = $game_party.actors[0]
    if @actor != nil
    @old_hp = @actor.hp
    @old_sp = @actor.sp
    @old_level = @actor.level
    @old_state = @actor.states.to_s
    @old_exp = @actor.exp
    refresh
    end
end  
def refresh
  self.contents.clear
    draw_maphp2(@actor, 5, 35)
    draw_mapsp2(@actor, -35, 55)
    draw_heroface(@actor, 0, 60)
    draw_actor_statemap(@actor, 140, 62, 70)
    draw_actor_levelmap(@actor, 45, 10)  
    @old_hp = @actor.hp
    @old_sp = @actor.sp
    @old_level = @actor.level
    @old_state = @actor.states.to_s
    @old_exp = @actor.exp

end
def update
    if XAS_HUD::FADE == true
    x = ($game_player.real_x - $game_map.display_x) / 4
    y = ($game_player.real_y - $game_map.display_y) / 4
    hud_size_x = 180
    hud_size_y = 100
    oc_range_x = hud_size_x + XAS_HUD::XASHUD_X
    oc_range_y = hud_size_y + XAS_HUD::XASHUD_Y
      if x < oc_range_x and x > XAS_HUD::XASHUD_X - 5 and
         y > XAS_HUD::XASHUD_Y and y < oc_range_y
      self.contents_opacity -= 10 if  self.contents_opacity > 120
      else
      self.contents_opacity += 10 if  self.contents_opacity < 255
      end
   end
   @draw_item.update
   @skill.update
   if @actor != nil  
   if @old_hp != @actor.hp or
      @old_sp != @actor.sp or
      @old_level != @actor.level or
      @old_state != @actor.states.to_s or
      @old_exp != @actor.exp      
   refresh
   end
   end
end
end
###############
# Game_Player #
###############
class Game_Player < Game_Character
    attr_accessor :wref
end
#############
# Scene_Map #
#############
class Scene_Map
alias mog11_main main
def main
    @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    
    mog11_main
    @sthero.dispose
end
alias mog11_update update
def update
    if $game_switches[XAS_HUD::DISABLE_STATUS_HUD_SWITCH] == false
    @sthero.visible = true  
    else
    @sthero.visible = false  
    end      
    @sthero.update
    mog11_update
end    
end
Reply }
#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 }


Possibly Related Threads…
Thread Author Replies Views Last Post
   GW Animated Battle backs Patch for Atoa ACBS Solitaire 21 2,264 10-17-2024, 06:37 AM
Last Post: Solitaire
   ACBS - Atoa Custom Battle System and TP System zlsl 2 4,648 10-20-2021, 05:09 AM
Last Post: zlsl
   [RMXP] Showing skill gained by leveling up on battle result FrQise 12 12,939 05-07-2021, 02:05 PM
Last Post: FrQise
   Adding face script on Cogwheel's RTAB Battle Status rekkatsu 15 16,154 08-25-2020, 03:09 AM
Last Post: DerVVulfman
   I want to add an Atoa Custom Battle System command cut-in. zlsl 11 14,160 11-11-2019, 08:55 PM
Last Post: DerVVulfman
   Question about ACBS (Atoa Custom Battle System) aeliath 10 13,063 08-08-2019, 02:50 PM
Last Post: aeliath
   YAMI Battle symphony + Holder add on (Loop casting anim) Starmage 0 4,298 03-01-2018, 09:03 AM
Last Post: Starmage
   (RMVXace) Battle error with Tankentai's battle system, help. x( Starmage 0 3,954 02-14-2018, 04:25 PM
Last Post: Starmage
   Atoa Individual Battle Commands Geminil 3 7,074 08-02-2017, 03:17 AM
Last Post: DerVVulfman
   Problems with counteraatack addon of Atoa Custom Battle System Djigit 22 35,953 01-05-2017, 08:05 PM
Last Post: Noctis



Users browsing this thread: 1 Guest(s)