Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - [Resolved] Individual Battle Commands, I need to modify the script

Save-Point

Full Version: [Resolved] Individual Battle Commands, I need to modify the script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,
i need a modification to Chralie Lee's Individual Battle Command compatible with RTAB.
I need a simple change (I think is simple to do):
the comand window must show only 4 commands and not all.
(like in Charlie Lee's FFX demo).
Is it possible to do?
And is possible to make compatible with Laura's Escape for RTAB??

Thanks in advance.


For Charlie Lee: Non so se la modifica sia da fare al tuo script, immagino di si. Ho provato più volte a farlo da me prima di postare, ma è evidente che sono terribilemnte negato con gli script. Ti prego di aiutarmi. Grazie
Laura's Escape uh? Let's see. Meanwhile try this one to see if that is what you want:

Cogwheels RTAB compatible version:

P.S. Non pregare per così poco...
I'm already using this but it removes the "Escape" command that Laura's Escape script add to the actor command window.
I try to put it under or upper that script but if I put your script upper Laura E. it show me only the "Escape" and the skills aren't divided in the variour categories, and if I put it below the L.E. it show me only the categories without the "escape".
I think that the two script rewrait the same part of pary command..I think...
Below there is the link to the page with her script if it can help.

Laura's Escape Command

Thanks in advance.

In alternative there is possible to do that the varios skills commands (CMD) will be displeyed into the skill command?
Like FFXII if you played the game.
If not, I try to make an esample:
when clicking on "Skill" command, is showed another window command with all the CMD commands and then is like the normal script, by cliking on one of them are showed the varios skills. Is possible to do?

P.S. Maybe is better if I send you a PM in italian <_<
The version that I posted here is an already modified version, not the one you find in the official thread. Anyway, this one appears to work well:
Code:
#==============================================================================
# ** Individual Battle Commands (IBC) by Charlie Lee  
#
# Version:     1.0 RTAB + Laura's Escape compatible
# Author: Charlie Lee
#==============================================================================

#==============================================================================
# INTRUCTIONS
#==============================================================================

# Configuration of Individual Battle Commands
# Let us assume that you want to create "Black Magic" and "White Magic".
# Well, create two elements named "CMD White Magic" and "CMD Black Magic",
# and add the proper element to all the skills in your database that belong
# to either of the two "categories".
# Finished. Yes. Simple, isn't it?
# Remember, if "name" is you category, use an element called "CMD name".
# "name" will end up in the command window of the actors, and it will be
# displayed only if that actor has at least one skill of that category.
# Enjoy!

#==============================================================================
# SUPPORT FOR INDIVIDUAL BATTLE COMMANDS
#==============================================================================
class Game_Actor
  attr_accessor :individual_commands

  alias individual_commands_setup setup
  def setup(actor_id)
    # original call
    individual_commands_setup(actor_id)
    @individual_commands=[]
  end

  def refresh_commands
    @individual_commands=[]
    #print("refresh_commands, actor: ",id.to_s)
    #for c in @individual_commands
    #  print("command: ",c)
    #end
    for i in 0...@skills.size
      skill = $data_skills[@skills[i]]
      if skill != nil
        for elem_id in skill.element_set
          if $data_system.elements[elem_id][0,3]=="CMD"
            if !@individual_commands.include?($data_system.elements[elem_id])
              @individual_commands.
              push(String.new($data_system.elements[elem_id]))
            end
          end
        end
      end
    end
    for c in @individual_commands
      # remove "CMD " substring
      c[0,4]=""
    end
  end
end

class Game_Party
  #--------------------------------------------------------------------------
  # * Add an Actor
  #  actor_id : actor ID
  #--------------------------------------------------------------------------
  alias individual_commands_add_actor add_actor
  def add_actor(actor_id)
    # original call
    individual_commands_add_actor(actor_id)
    # Get actor
    actor = $game_actors[actor_id]
    actor.refresh_commands
  end
end

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Actor Command Window Setup
  #--------------------------------------------------------------------------
  alias ibc_phase3_setup_command_window phase3_setup_command_window
  def phase3_setup_command_window
    # Original call
    ibc_phase3_setup_command_window
    # Refresh commands
    $game_party.actors[@actor_index].refresh_commands
    #@active_battler.refresh_commands
    # Make a new window
    s1 = $data_system.words.attack
    s2 = $data_system.words.skill
    s3 = $data_system.words.guard
    s4 = $data_system.words.item
    #@individual_battle_commands=[s1]+@active_battler.individual_commands+[s3, s4]
    @individual_battle_commands=[s1]+$game_party.actors[@actor_index].individual_commands+[s3, s4,ESCAPE_TEXT]
    @actor_command_window.dispose
    @actor_command_window = Window_Command.new(160, @individual_battle_commands)
    # Set actor command window position
    @actor_command_window.x = @actor_index * 160
    @actor_command_window.y = 320 - 32 - 32*4
    @actor_command_window.height = 320 - 32 - 32*4
    @actor_command_window.back_opacity = 255
    @actor_command_window.opacity = 255
    @actor_command_window.active = true
    @actor_command_window.visible = true
    # Set index to 0
    @actor_command_window.index = 0
    # show the turn window (shown in start phase 2 only when the enemy attacks)
  end

  #--------------------------------------------------------------------------
  # * Frame Update (actor command phase : basic command)
  #--------------------------------------------------------------------------
  def update_phase3_basic_command
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Go to command input for previous actor
      phase3_prior_actor
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by actor command window command name
      case @actor_command_window.commands[@actor_command_window.index]
      # attack
      when $data_system.words.attack
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Set action
        @active_actor.current_action.kind = 0
        @active_actor.current_action.basic = 0
        # Start enemy selection
        start_enemy_select
      # Guard
      when $data_system.words.guard
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Set action
        @active_actor.current_action.kind = 0
        @active_actor.current_action.basic = 1
        # Go to command input for next actor
        phase3_next_actor
      # item
      when $data_system.words.item
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Set action
         @active_actor.current_action.kind = 2
        # Start item selection
        start_item_select
      when ESCAPE_TEXT
        # Play Decision SE
        $game_system.se_play($data_system.decision_se)
        if $game_temp.battle_can_escape == false
          # Play Buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play Decision SE
        $game_system.se_play($data_system.decision_se)
        @phase = 0
        @actor_command_window.active = false
        @actor_command_window.visible = false
        # Set main phase flag
        $game_temp.battle_main_phase = true
        if $game_temp.battle_turn == 0
          update_phase2_escape
          $game_temp.battle_turn = 1
          for battler in $game_party.actors
            battler.at -= @max / 2
          end
          return
        end
        # Play Decision SE
        $game_system.se_play($data_system.decision_se)
        @escape = true
        for battler in $game_party.actors
          @command_a = false
          @command.delete(battler)
          @action_battlers.delete(battler)
          skill_reset(battler)
        end  
      end
      ### SUPPORT FOR INDIVIDUAL BATTLE COMMANDS ###
      if @active_actor!=nil and @active_actor.individual_commands.
        include?(@actor_command_window.commands[@actor_command_window.index])
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        @active_actor.current_action.kind = 1
        @individual_battle_commands_skill_category=@actor_command_window.commands[@actor_command_window.index]
        start_skill_select
      end
    end
  end

  #--------------------------------------------------------------------------
  # * Start Skill Selection
  #--------------------------------------------------------------------------
  alias ibc_start_skill_select start_skill_select
  def start_skill_select
    # Original call
    ibc_start_skill_select
    # Make a new skill window
    @skill_window.dispose
    @skill_window = Window_Skill.new(@active_actor,@individual_battle_commands_skill_category)
    # Associate help window
    @skill_window.help_window = @help_window
  end
end

class Window_Skill < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #  actor : actor
  #--------------------------------------------------------------------------
  def initialize(actor, skill_command_type = "")
    if skill_command_type != ""
      @skill_command_element_id = $data_system.elements.
      index("CMD " + skill_command_type)
    else
      @skill_command_element_id = -1
    end
    
    super(0, 128, 640, 352)
    @actor = actor
    @column_max = 2
    refresh
    self.index = 0
    # If in battle, move window to center of screen
    # and make it semi-transparent
    if $game_temp.in_battle
      self.y = 64
      self.height = 256
      self.back_opacity = 160
    end
  end
  
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 0...@actor.skills.size
      skill = $data_skills[@actor.skills[i]]
      if skill != nil
        if @skill_command_element_id == -1 or skill.element_set.include?(
          @skill_command_element_id)
          @data.push(skill)
        end
      end
    end
    # If item count is not 0, make a bit map and draw all items
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
end
  
class Window_Command
  attr_accessor :commands
end

put it under Laura's Escape (RTAB).
Yes, it works very well! Thanks a lot!
Topic resolved. ^_^