Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

XAS Battle System, changing Leader

pez

Member

Hello Again,

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
Code:
 

SKILL_CHANGE = Input::L

#Usar Item.
to
Code:
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
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

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 [email=1...@actors.size]1...@actors.size[/email]

$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

For more details please check my last post here.
 
Hi there... ^^

I've edited the script a little bit and finished it with common events (because I am not that good at ruby)... ^^

Now you can change the leader and he got all the weapons and Skills the leader before had equiped...

I also inserted the Game-over-Leader-Change Script I found and edited it a little bit, so it will automatically change the new leader weapon etc. ^^

There can be bugs, because I copied it over from my game to the XAS Demo... on my game it works very well... ^^ And the few times I tested it on the demo, it worked too ^^

The only thing I can't get working is the exp points being parted.. ^^

Oh and if you would like to have the clothes changed also to the leader you have to do it the same way in the common events... ^^ But I don't like that... so you can also deactivate the change "shield" thing.. etc...

Maybe it will help the scripters out there to work on a script that have got all inside without common events.... ^^
Feel free to experiment with it.. ^^

Wish ya all fun with it... DOWNLOAD

Greetz,
Darkwonder

P.S. Sorry for my bad english, I am from Germany ^^
For the ones who don't know how to change leader "Press Button A and X" together.. for me it is Run and Shield button ^^
 
Hackel to the rescue! ^,^
now this script remembers equipped skills and items
for each actor. (thanks Hackel you are the man!)
and I've included a way to switch when an actor dies.
so that it won't gameover when you have more actors
in the party.

enjoy people ...this job is done! :D

must give credit and free to use ~ GO XAS! ^,^
Code:
=begin

 

SWITCH XAS LEADER script V.5

by gameface101

1-3-10

 

special thanks to Hackel

for help with remember skills and items

 

*free to use and must give credit

 

 

=end

 

class Game_Temp

      attr_accessor :remember_skill

      attr_accessor :remember_item

alias swap_initialize initialize

def initialize

      @remember_skill = []

      @remember_item = []

swap_initialize

end

end

class Scene_Map

  alias switch_xas_leader update

def update

switch_xas_leader

if Input.press? (Input::A) and Input.press?(Input::X)

$game_system.se_play(RPG::AudioFile.new("009-System09", 100, 100))

$game_player.animation_id = 220

xas_leader

end

def xas_leader

      $game_temp.remember_skill[$game_party.actors[0].id] = $game_system.xas_skill_id

      $game_variables[1] = $game_temp.remember_skill[$game_party.actors[0].id]

      $game_temp.remember_item[$game_party.actors[0].id]= $game_system.xas_item_id

      last_act = $game_party.actors.shift 

      $game_party.add_actor (last_act.id)

      $game_player.refresh

      unless $game_temp.remember_skill[$game_party.actors[0].id] == nil

      $game_system.xas_skill_id = $game_temp.remember_skill[$game_party.actors[0].id] #to clear equipped skill

    else

      $game_system.xas_skill_id = 0

    end

    unless $game_temp.remember_item[$game_party.actors[0].id] == nil

      $game_system.xas_item_id = $game_temp.remember_item[$game_party.actors[0].id] #to clear equipped item

    else

      $game_system.xas_item_id = 0

      end

      $scene = Scene_Map.new

 end

 

 end

end

 

class Scene_Map

  alias_method :switch_dead_actor_scene_map_update, :update

  def update

     switch_dead_actor_scene_map_update

     unless $game_party.actors.empty?

        if ($game_party.actors[0].hp).zero?

           unless $game_party.all_dead?

              $game_party.actors << $game_party.actors.shift

              $game_player.refresh

           else ; $game_temp.gameover = true

           end

        end        

     end

  end

end

 
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top