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.

XP - One of my scripts is acting up. Could someone help?

One of my scripts is acting up. I think it's the TOS Menu script. I made it so I could have 11 characters in my party, but only the first five on the list could participate in battle. But for some reason, when I use an event to put all 11 in my party, the first SEVEN characters participate in battle. And also, the order of the party is randomly jumbled up. Can somebody tell me how to fix it? Here's the stuff from my data folder, so you can take a look at it. The chest above the starting position will put all 11 characters into your party.

http://www.megaupload.com/?d=82QWGHGA

Also, this is unrelated, but, could someone tell me how to force a character to be in the battle party? I would like the main character, Reo, to be in the first slot of the party at all times.
 

khmp

Sponsor

Go into TOS Menu. Search for Scene_Battle. Overwrite the second one with this. Yes there are two of them. They are back to back. Party leader is the ID of whoever you want to be in the lead of the attack whenever you fight. She/he doesn't even need to be in the party for this to work either.

Code:
PARTY_LEADER = 3

#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This puts a limit on how many characters can enter battle.
#==============================================================================
class Scene_Battle
  #--------------------------------------------------------------------------
  # * Alias Methods
  #--------------------------------------------------------------------------
  alias_method :vash_tos_remove_main, :main
  alias_method :vash_tos_add_battle_end, :battle_end
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def main
    @saved_actors = []
    if $game_party.actors.size > Vash_ToS::PARTY_BATTLE
      for i in Vash_ToS::PARTY_BATTLE...$game_party.actors.size
        @saved_actors << $game_party.actors[i].id
        $game_party.remove_actor($game_party.actors[i].id)
      end
    end

    # If the party leader is already in the party but he may not be the first.
    # Delete his position because he will go into first whether he wants to or
    # not.
    if $game_party.actors.include?($game_actors[PARTY_LEADER])
      $game_party.actors.delete($game_actors[PARTY_LEADER])
    else
      # If the party leader wasn't in the party but its full time to make room.
      $game_party.actors.pop if $game_party.actors.size == Vash_ToS::PARTY_BATTLE
    end
    # Add the party leader to the 
    $game_party.actors.unshift($game_actors[PARTY_LEADER])

    vash_tos_remove_main
  end
  #--------------------------------------------------------------------------
  # * Battle End
  #--------------------------------------------------------------------------
  def battle_end(result)
    for actor_id in @saved_actors
      $game_party.add_actor(actor_id)
    end
    vash_tos_add_battle_end(result)
  end
end

Good luck with it AdditionalPylons! :thumb:
 

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