Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - KK20

3301
*casually walks in*
Window_BlacksmithForge: ShowHide
#===============================================================================
# ** Window_BlacksmithForge
#===============================================================================

class Window_BlacksmithForge < Window_Selectable

  def initialize(shop_goods)
    super(0, 128, 368, 352)
    # Initialize window and create instance variable to store available goods.
    @shop_goods = shop_goods
    self.active = self.visible = false
    refresh
    self.index = 0
  end
  #-----------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #-----------------------------------------------------------------------------
  def refresh(enchanting = false)
    # Dispose bitmap and set to nil if not already.
    if self.contents != nil
      self.contents = self.contents.dispose
    end
    # Set flag for enchanting
    @enchanting = enchanting
    # Create array of equipment, depending on flag
    if @enchanting
      @data = []
      # Add weapons
      ($data_weapons - [nil]).each {|weapon|
        if $game_party.weapon_number(weapon.id) > 0 &&
            !Blacksmith::NO_ENCHANT_WEAPONS.include?(weapon.id)
          @data.push(weapon)
        end
      }
      # Add Armor
      ($data_armors - [nil]).each {|armor|
        if $game_party.armor_number(armor.id) > 0 &&
            !Blacksmith::NO_ENCHANT_ARMORS.include?(armor.id)
          @data.push(armor)
        end
      }
    else
      @data = @shop_goods
    end
    # Keep only items that you have materials for
    @new_data = []
    @data.each{|i|
      case i
      when RPG::Weapon
        type = 0
      when RPG::Armor
        type = 1
      when RPG::Item
        type = 2
      end
      @new_data.push(i) if Blacksmith.materials?(type, i.id)
    }
    @data = @new_data
    # Create a new bitmap, sized for available items
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      (0...@item_max).each {|i| draw_item(i) }
    end
  end
  #-----------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    # Set a few local variables depending on the type of item.
    case item
    when RPG::Weapon
      quantity = $game_party.weapon_number(item.id)
      price, type = Blacksmith.weapon_gold(item.id)[0], 0
    when RPG::Armor
      quantity = $game_party.armor_number(item.id)
      price, type = Blacksmith.armor_gold(item.id)[0], 1
    when RPG::Item
      quantity = $game_party.item_number(item.id)
      price, type = Blacksmith.item_gold(item.id)[0], 2
    end
    # Don't check material requirments for forging wjen enchanting
    result = @enchanting ? true : Blacksmith.materials?(type, item.id)
    # Determine the color to use for drawing the item name.
    if quantity < 99 && result
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    # Draw the item name, icon, and price.
    x, y = 4, index * 32
    rect = Rect.new(x, y, self.width - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    if !@enchanting
      self.contents.draw_text(x + 240, y, 88, 32, price.to_s, 2)
    end
  end
  #-----------------------------------------------------------------------------
  def update_help
    @help_window.set_text(self.item == nil ? '' : self.item.description)
  end
end
CTRL + F for "Window_BlacksmithForge" and replace with this. It's been a while since I've looked at any programming, so I threw this together pretty quick. Obviously someone can find a way to hack this down a few lines shorter.
3303
Jumping distance takes current speed minus whatever is considered normal speed and then adds the value of "JUMPING". So, the game already processes that for you.

Played around with this a bit, and came to some way of implementing the feature. Mind you, this is a really amateur fix; there's probably a much better way going about solving this.

1.) Open Part 2 of BlizzABS. Locate 'def update_control' (Line 3592). A few lines below, find 'player.move_speed = player.normal_speed' (Line 3596) and replace it with
player.move_speed = player.normal_speed unless $game_switches[id]
Replace 'id' with whatever switch your horse event activates on.
Go down a bit and find 'player.move_speed = Config::RUN_SPEED' (Line 3605) and replace it with
player.move_speed = Config::RUN_SPEED unless $game_switches[id]
Again, replacing 'id' with the switch you want.

2.) Open Database and go to Common Events. Make it Parallel Process with the condition switch the same ID as what you just put above. Insert Script:
if Input.press?(Input::Run)
$game_player.move_speed = 6
else
$game_player.move_speed = 4
end

Change the move speed values to whatever you want.

Worked for me. Like I said, very crude fix...  :P
3304
After looking through the code a bit, I found nothing. Speeds are only defined by the constants you assign it before start up. The only suggestion I could give is use a Common Event that checks if the player has the Key pressed and change '$game_player.move_speed' to whatever value you want it to be. I don't know if using the same Key you have assigned to 'Run' would create any conflicts.
3305
Script Requests / Re: Class-Actor-Skill Hybrid?
October 24, 2011, 02:16:37 pm
There is no difference. It's a matter of one line of code versus two. '== nil' is the same as '.nil?'.

For that, you will have to make another method to check that. Get the class's useable weapons, run through all the possible techniques you have that have the skill required to use that weapon, then use that technique's ID in method 'add_tech'. It's probably best that this new method is called in two spots: when the actor is initialized (aka under def setup) and rewriting or aliasing class change.

Since you posted something while I was typing this up, what you have there seems to work, assuming that you don't want this script to be easily customizable. And the use of 'next' only applies to loops. If you want 'case 0' to do nothing, you don't have to write anything.

And you lost me with all of your explanation stuff below.
3306
Script Requests / Re: Class-Actor-Skill Hybrid?
October 24, 2011, 03:14:53 am
$game_actors[1].add_tech(0) #=> Aluxes gets technique with ID 0 (last time I checked, this was Endurance).
p $game_actors[1].techniques #=> DOES NOT DISPLAY an array with 0 in it. It will print out the whole technique array you have set up in Game_Technique.
'for index in 0.. @techniques.size' followed with '@techniques[index]' will be wrong. The way I have set up @techniques in Game_Actors is that the index value of the technique is located at the index value within @techniques. So if you added techniques 0, 1, and 5, '@techniques.size = 3'. @techniques[0] and @techniques[1] exist. But what the hell would @techniques[2] be? @techniques[2] is nil.

Use @techniques.each{|tech| #CODE HERE# } instead.

Edit: Upon further realization, if there is a gap between tech IDs, 'each' still runs through them. Nothing like a 'next if tech.nil?' can't fix.
Further Edit: Okay, so @techniques.size would include the nils as well...forget everything I said. Just use what I said directly above ^^^^.
3307
Script Requests / Re: Strategy Bar system
October 20, 2011, 04:28:35 pm
Couple things to address:
1.) The glowing of bars gets funky when holding left or right arrow keys: the bars flash. This is because you are disposing the bar graphic, recreating it, and giving it the tone again. When repeated fast enough, you can see that instance where the tone has not been applied.
2.) If saving the changes of a strategy counts as an action, you will have to change the way your actors save these values. Assuming you are using the way the DBS works, confirming a strategy will then let you choose an action for the next actor. Pressing "B" will send you back to the previous actor you have just set the strategy for. Now the player can make this actor attack. In other words, this actor has just performed two actions when you only want it to do one.

I solved #1:
Spoiler: ShowHide
#==============================================================================
# ** Scene Battle Strategy
#------------------------------------------------------------------------------
#  This class performs battle strategy screen processing.
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Start Strategy (make sure @battler is_an_actor? = true)
  #--------------------------------------------------------------------------
  def start_strategy
    #load background window overlay with actor's name
    #load arrow key readers
    #@actor_command_window.visible = false
    @actor_command_window.active = false
    @triangle_step = 1
    @spd = @active_battler.spd
    @uke = @active_battler.uke
    @agg = @active_battler.agg
    @status_window.dispose
    @status_window = Window_BlankStatus.new
  end

  #--------------------------------------------------------------------------
  # * Make Triangle (circle, triangle lid)
  #--------------------------------------------------------------------------
  def make_triangle
    y_mod = 25
    # triangle background
      @sprite8 = Sprite.new
    @sprite8.z, @sprite8.x, @sprite8.y = 115, 477, 280 + y_mod
    @sprite8.angle = 0 #keep 0
    @sprite8.bitmap = RPG::Cache.picture ("tri_circle")
    #Create x_, y_, and z_rotate
    make_rotate
    #tri_cover
      @sprite12 = Sprite.new
    @sprite12.z, @sprite12.x, @sprite12.y = 119, 497, 290 + y_mod
    @sprite12.angle = 0 #keep 0
    @sprite12.bitmap = RPG::Cache.picture ("tri_cover")

  end
  #--------------------------------------------------------------------------
  # * Make Triangle (x_rotate, y_rotate, z_rotate)
  #--------------------------------------------------------------------------
  def make_rotate
    y_mod = 25
  # x_rotate
      @sprite9 = Sprite.new
    @sprite9.z, @sprite9.x, @sprite9.y = 116, 555, 306 + y_mod
    @sprite9.angle = 0 + (@spd * 3)
    @sprite9.ox = 6
    @sprite9.oy = 6
    @sprite9.bitmap = RPG::Cache.picture ("x_rotate")
    # y_rotate
      @sprite10 = Sprite.new
    @sprite10.z, @sprite10.x, @sprite10.y = 117, 503 +6, 381 + y_mod
    @sprite10.angle = 0 + (@uke * 3)
    @sprite10.ox = 6
    @sprite10.oy = 47
    @sprite10.bitmap = RPG::Cache.picture ("y_rotate")
    #z_rotate
      @sprite11 = Sprite.new
    @sprite11.z, @sprite11.x, @sprite11.y = 118, 525 +69, 383 + y_mod
    @sprite11.angle = 0 + (@agg * 3)
    @sprite11.ox = 69
    @sprite11.oy = 52
    @sprite11.bitmap = RPG::Cache.picture ("z_rotate")
  end
  #--------------------------------------------------------------------------
  # * Make Bars (initiative, semeru, brutality)
  #--------------------------------------------------------------------------
  def make_bars

    # @active_battler.name
    abs = 8 * @spd
    abu = 8 * @uke
    aba = 8 * @agg
   
    y_mod = 25
    # initiative <=> patience (impulsive/intercept)
      @sprite1 = Sprite.new
    @sprite1.z, @sprite1.x, @sprite1.y = 120, 260, 274 + y_mod
    @sprite1.angle = 0
    @sprite1.bitmap = RPG::Cache.picture ("yellow_blue")
    # semeru <=> ukeru (forceful/receiving)
      @sprite2 = Sprite.new
    @sprite2.z, @sprite2.x, @sprite2.y = 121, 261, 348 + y_mod
    @sprite2.angle = 0
    @sprite2.bitmap = RPG::Cache.picture ("indigo_green")
    # brutality <=> finesse (bloody/accurate)   
      @sprite3 = Sprite.new
    @sprite3.z, @sprite3.x, @sprite3.y = 122, 260, 376 + y_mod
    @sprite3.angle = 0
    @sprite3.bitmap = RPG::Cache.picture ("red_orange")
    #black rectangle status display
            @sprite7 = Sprite.new
    @sprite7.z, @sprite7.x, @sprite7.y = 125, 260, 402 + y_mod
    @sprite7.angle = 0
    @sprite7.bitmap = RPG::Cache.picture ("black_rectangle")
    # create arrow graphics
    make_arrows
    #you need to stick the +/- 1-10 + text. over black_rectangle
    #   may need a Window_BlackText to make it happen.
  end
  #--------------------------------------------------------------------------
  # * Make Arrows (arrowR, arrowG, arrowB)
  #--------------------------------------------------------------------------
  def make_arrows
    abs = 8 * @spd
    abu = 8 * @uke
    aba = 8 * @agg
    y_mod = 25
  #arrowB
          @sprite4 = Sprite.new
    @sprite4.z, @sprite4.x, @sprite4.y = 123, 346 + abs, 334 + y_mod
    @sprite4.angle = 0
    @sprite4.bitmap = RPG::Cache.picture ("arrowB")
    #arrowG
          @sprite5 = Sprite.new
    @sprite5.z, @sprite5.x, @sprite5.y = 123, 346 + abu, 362 + y_mod
    @sprite5.angle = 0
    @sprite5.bitmap = RPG::Cache.picture ("arrowG")
    #arrowR
          @sprite6 = Sprite.new
    @sprite6.z, @sprite6.x, @sprite6.y = 124, 346 + aba, 391 + y_mod
    @sprite6.angle = 0
    @sprite6.bitmap = RPG::Cache.picture ("arrowR")   
  end
  #--------------------------------------------------------------------------
  # * Frame Update (triangle lines and bar arrows move when updated)
  #--------------------------------------------------------------------------
#probably an index loop starting with a case = 1, ++ with up/down
 
  def update_triangle
    case @triangle_step
    when 1     
      update_triangle_step1
    when 2
      update_triangle_step2
    when 3
      update_triangle_step3
    end
  end


  #--------------------------------------------------------------------------
  # * Arrows Verticle: UP & DOWN
  #--------------------------------------------------------------------------
  def arrows_verticle
   
      if Input.repeat?(Input::UP) and @triangle_step > 1
        $game_system.se_play($data_system.cursor_se)
        @triangle_step -= 1
      end
 
      if Input.repeat?(Input::DOWN) and @triangle_step < 3
        $game_system.se_play($data_system.cursor_se)
        @triangle_step += 1
      end
 
      #Confirm Choices and Exit
      if Input.trigger?(Input::C)
        $game_system.se_play($data_system.decision_se)
        make_strategy_result
      end
      if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        make_strategy_result(false)
      end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (Strategy Option 1)
  #--------------------------------------------------------------------------
  def update_triangle_step1
    @sprite1.tone = Tone.new(55, 0, 55, 0)
    @sprite2.tone = Tone.new(0, 0, 0, 0)
    if Input.repeat?(Input::LEFT) and @spd > -10
      $game_system.se_play($data_system.cursor_se)
       @spd -= 1
      refresh
    end

    if Input.repeat?(Input::RIGHT) and @spd < 10
      $game_system.se_play($data_system.cursor_se)
      @spd += 1
      refresh
    end
   
    #changes @active_battler.spd with left/right
    arrows_verticle

  end
  #--------------------------------------------------------------------------
  # * Frame Update (Strategy Option 2)
  #--------------------------------------------------------------------------
  def update_triangle_step2
    @sprite1.tone = Tone.new(0, 0, 0, 0)
    @sprite2.tone = Tone.new(100, 0, 100, 0)
    @sprite3.tone = Tone.new(0, 0, 0, 0)
    if Input.repeat?(Input::LEFT) and @uke > -10
      $game_system.se_play($data_system.cursor_se)
      @uke -= 1
      refresh
    end

   if Input.repeat?(Input::RIGHT) and @uke < 10
     $game_system.se_play($data_system.cursor_se)
     @uke += 1
     refresh
   end

    #changes @active_battler.uke with left/right
    arrows_verticle
   
  end
  #--------------------------------------------------------------------------
  # * Frame Update (Strategy Option 3)
  #--------------------------------------------------------------------------
  def update_triangle_step3
    @sprite2.tone = Tone.new(0, 0, 0, 0)
    @sprite3.tone = Tone.new(155, 0, 155, 0)
    if Input.repeat?(Input::LEFT) and @agg > -10
      $game_system.se_play($data_system.cursor_se)
      @agg -= 1
      refresh
    end

    if Input.repeat?(Input::RIGHT) and @agg < 10
      $game_system.se_play($data_system.cursor_se)
      @agg += 1
      refresh
    end
   
    #changes @active_battler.agg with left/right
    arrows_verticle
   
  end
  #--------------------------------------------------------------------------
  # * Refresh - may cause interference: alt: "strategy_refresh"
  #--------------------------------------------------------------------------
  def refresh # may crash
    #clear old sprites
#    @sprite1.dispose
#    @sprite2.dispose
#    @sprite3.dispose
    @sprite4.dispose
    @sprite5.dispose
    @sprite6.dispose
#    @sprite7.dispose
#    @sprite8.dispose
    @sprite9.dispose
    @sprite10.dispose
    @sprite11.dispose
#    @sprite12.dispose
    #make new sprites
#    make_bars
#    make_triangle
    make_arrows
    make_rotate
  end
  #--------------------------------------------------------------------------
  # * Make Strategy Results (Game Battler: attr accessor(s) for @actor)
  #--------------------------------------------------------------------------
  def make_strategy_result(save_changes=true)
    if save_changes
      @active_battler.spd = @spd
      @active_battler.uke = @uke
      @active_battler.agg = @agg
    end
    #lock values in place
    # deactivate triangle_update through "@triangle_step"
    @triangle_step = nil
    #dispose of these windows and bitmaps
    @sprite1.dispose
    @sprite2.dispose
    @sprite3.dispose
    @sprite4.dispose
    @sprite5.dispose
    @sprite6.dispose
    @sprite7.dispose
    @sprite8.dispose
    @sprite9.dispose
    @sprite10.dispose
    @sprite11.dispose
    @sprite12.dispose
    # Go to command input for next actor
    @actor_command_window.active = true
    @status_window.dispose
    @status_window = Window_BattleStatus.new
    phase3_next_actor if save_changes

  end
end
#2 will require some variables and setting the actor's stats accordingly AFTER selecting actions for the entire party.
3308
Script Requests / Re: Strategy Bar system
October 20, 2011, 02:30:20 am
@Fantasist: Thanks  :^_^':

Yeah, everything should work as it is suppose to be. In my last edit, I've practically finished the controls stuff. Pressing "C" confirms and saves the 3 stats. Pressing "B" will cancel any changes made to the stats. Also cleaned up a few things and changed some orders around. @active_battler was constantly being assigned a value when it already has the actor data before you even started up Scene_Strategy.

Will the images be displayed there in the final product? All the text in the background window kinda destroys it. Easy fix would either be move the graphics on top of the enemy graphics or put a dark background behind the graphics to block off the windows behind it (the latter sounds better).
3309
Script Requests / Re: Strategy Bar system
October 19, 2011, 11:10:56 pm
Found it?
#--------------------------------------------------------------------------
 # * Refresh - may cause interference: alt: "strategy_refresh"
 #--------------------------------------------------------------------------
 def refresh # may crash
   #clear old sprites
   @sprite1.dispose
   @sprite2.dispose
   @sprite3.dispose
   @sprite4.dispose
   @sprite5.dispose
   @sprite6.dispose
   @sprite7.dispose
   @sprite8.dispose
   @sprite9.dispose
   @sprite10.dispose
   @sprite11.dispose
   @sprite12.dispose
   #make new sprites
   make_bars
   make_triangle
 end
You were calling 'update_triangle' again when the program was already running through 'update_triangle'. Tested: Went to a bar, held down right/left key, no stack error.

EDIT: Hell, I got bored.
Scene_Strategy: ShowHide
#==============================================================================
# ** Scene Battle Strategy
#------------------------------------------------------------------------------
#  This class performs battle strategy screen processing.
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Start Strategy (make sure @battler is_an_actor? = true)
  #--------------------------------------------------------------------------
  def start_strategy
    #load background window overlay with actor's name
    #load arrow key readers
    #@actor_command_window.visible = false
    @actor_command_window.active = false
    @triangle_step = 1
    @spd = @active_battler.spd
    @uke = @active_battler.uke
    @agg = @active_battler.agg
  end
  #--------------------------------------------------------------------------
  # * Make Triangle (circle, x_rotate, y_rotate, z_rotate, triangle lid)
  #--------------------------------------------------------------------------
  def make_triangle
    y_mod = 25
    # triangle background
      @sprite8 = Sprite.new
    @sprite8.z, @sprite8.x, @sprite8.y = 115, 477, 280 + y_mod
    @sprite8.angle = 0 #keep 0
    @sprite8.bitmap = RPG::Cache.picture ("tri_circle")
   
    # x_rotate
      @sprite9 = Sprite.new
    @sprite9.z, @sprite9.x, @sprite9.y = 116, 555, 306 + y_mod
    @sprite9.angle = 0 + (@spd * 3)
    @sprite9.ox = 6
    @sprite9.oy = 6
    @sprite9.bitmap = RPG::Cache.picture ("x_rotate")
    # y_rotate
      @sprite10 = Sprite.new
    @sprite10.z, @sprite10.x, @sprite10.y = 117, 503 +6, 381 + y_mod
    @sprite10.angle = 0 + (@uke * 3)
    @sprite10.ox = 6
    @sprite10.oy = 47
    @sprite10.bitmap = RPG::Cache.picture ("y_rotate")
    #z_rotate
      @sprite11 = Sprite.new
    @sprite11.z, @sprite11.x, @sprite11.y = 118, 525 +69, 383 + y_mod
    @sprite11.angle = 0 + (@agg * 3)
    @sprite11.ox = 69
    @sprite11.oy = 52
    @sprite11.bitmap = RPG::Cache.picture ("z_rotate")
   
   
    #tri_cover
      @sprite12 = Sprite.new
    @sprite12.z, @sprite12.x, @sprite12.y = 119, 497, 290 + y_mod
    @sprite12.angle = 0 #keep 0
    @sprite12.bitmap = RPG::Cache.picture ("tri_cover")

  end
  #--------------------------------------------------------------------------
  # * Make Bars (initiative, semeru, brutality, arrowR, arrowG, arrowB)
  #--------------------------------------------------------------------------
  def make_bars

    # @active_battler.name
    abs = 8 * @spd
    abu = 8 * @uke
    aba = 8 * @agg
   
    y_mod = 25
    # initiative <=> patience (impulsive/intercept)
      @sprite1 = Sprite.new
    @sprite1.z, @sprite1.x, @sprite1.y = 120, 260, 274 + y_mod
    @sprite1.angle = 0
    @sprite1.bitmap = RPG::Cache.picture ("yellow_blue")
    # semeru <=> ukeru (forceful/receiving)
      @sprite2 = Sprite.new
    @sprite2.z, @sprite2.x, @sprite2.y = 121, 261, 348 + y_mod
    @sprite2.angle = 0
    @sprite2.bitmap = RPG::Cache.picture ("indigo_green")
    # brutality <=> finesse (bloody/accurate)   
      @sprite3 = Sprite.new
    @sprite3.z, @sprite3.x, @sprite3.y = 122, 260, 376 + y_mod
    @sprite3.angle = 0
    @sprite3.bitmap = RPG::Cache.picture ("red_orange")
    #arrowB
          @sprite4 = Sprite.new
    @sprite4.z, @sprite4.x, @sprite4.y = 123, 346 + abs, 334 + y_mod
    @sprite4.angle = 0
    @sprite4.bitmap = RPG::Cache.picture ("arrowB")
    #arrowG
          @sprite5 = Sprite.new
    @sprite5.z, @sprite5.x, @sprite5.y = 123, 346 + abu, 362 + y_mod
    @sprite5.angle = 0
    @sprite5.bitmap = RPG::Cache.picture ("arrowG")
    #arrowR
          @sprite6 = Sprite.new
    @sprite6.z, @sprite6.x, @sprite6.y = 124, 346 + aba, 391 + y_mod
    @sprite6.angle = 0
    @sprite6.bitmap = RPG::Cache.picture ("arrowR")   
    #black rectangle status display
            @sprite7 = Sprite.new
    @sprite7.z, @sprite7.x, @sprite7.y = 125, 260, 402 + y_mod
    @sprite7.angle = 0
    @sprite7.bitmap = RPG::Cache.picture ("black_rectangle")   

    #you need to stick the +/- 1-10 + text. over black_rectangle
    #   may need a Window_BlackText to make it happen.
  end
  #--------------------------------------------------------------------------
  # * Frame Update (triangle lines and bar arrows move when updated)
  #--------------------------------------------------------------------------
#probably an index loop starting with a case = 1, ++ with up/down
 
  def update_triangle
    case @triangle_step
    when 1
      update_triangle_step1
    when 2
      update_triangle_step2
    when 3
      update_triangle_step3
    end
  end

  #--------------------------------------------------------------------------
  # * Arrows Verticle: UP & DOWN
  #--------------------------------------------------------------------------
  def arrows_verticle
   
      if Input.repeat?(Input::UP) and @triangle_step > 1
        $game_system.se_play($data_system.cursor_se)
        @triangle_step -= 1
      end
 
      if Input.repeat?(Input::DOWN) and @triangle_step < 3
        $game_system.se_play($data_system.cursor_se)
        @triangle_step += 1
      end
 
      #Confirm Choices and Exit
      if Input.trigger?(Input::C)
        $game_system.se_play($data_system.decision_se)
        make_strategy_result
      end
      if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        make_strategy_result(false)
      end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (Strategy Option 1)
  #--------------------------------------------------------------------------
  def update_triangle_step1
     
    if Input.repeat?(Input::LEFT) and @spd > -10
      $game_system.se_play($data_system.cursor_se)
       @spd -= 1
      refresh
    end

    if Input.repeat?(Input::RIGHT) and @spd < 10
      $game_system.se_play($data_system.cursor_se)
      @spd += 1
      refresh
    end
   
    #changes @active_battler.spd with left/right
    arrows_verticle

  end
  #--------------------------------------------------------------------------
  # * Frame Update (Strategy Option 2)
  #--------------------------------------------------------------------------
  def update_triangle_step2
   
    if Input.repeat?(Input::LEFT) and @uke > -10
      $game_system.se_play($data_system.cursor_se)
      @uke -= 1
      refresh
    end

   if Input.repeat?(Input::RIGHT) and @uke < 10
     $game_system.se_play($data_system.cursor_se)
     @uke += 1
     refresh
   end

    #changes @active_battler.uke with left/right
    arrows_verticle
   
  end
  #--------------------------------------------------------------------------
  # * Frame Update (Strategy Option 3)
  #--------------------------------------------------------------------------
  def update_triangle_step3
   
    if Input.repeat?(Input::LEFT) and @agg > -10
      $game_system.se_play($data_system.cursor_se)
      @agg -= 1
      refresh
    end

    if Input.repeat?(Input::RIGHT) and @agg < 10
      $game_system.se_play($data_system.cursor_se)
      @agg += 1
      refresh
    end
   
    #changes @active_battler.agg with left/right
    arrows_verticle
   
  end
  #--------------------------------------------------------------------------
  # * Refresh - may cause interference: alt: "strategy_refresh"
  #--------------------------------------------------------------------------
  def refresh # may crash
    #clear old sprites
    @sprite1.dispose
    @sprite2.dispose
    @sprite3.dispose
    @sprite4.dispose
    @sprite5.dispose
    @sprite6.dispose
    @sprite7.dispose
    @sprite8.dispose
    @sprite9.dispose
    @sprite10.dispose
    @sprite11.dispose
    @sprite12.dispose
    #make new sprites
    make_bars
    make_triangle
  end
  #--------------------------------------------------------------------------
  # * Make Strategy Results (Game Battler: attr accessor(s) for @actor)
  #--------------------------------------------------------------------------
  def make_strategy_result(save_changes=true)
    if save_changes
      @active_battler.spd = @spd
      @active_battler.uke = @uke
      @active_battler.agg = @agg
    end
    #lock values in place
    # deactivate triangle_update through "@triangle_step"
    @triangle_step = nil
    #dispose of these windows and bitmaps
    @sprite1.dispose
    @sprite2.dispose
    @sprite3.dispose
    @sprite4.dispose
    @sprite5.dispose
    @sprite6.dispose
    @sprite7.dispose
    @sprite8.dispose
    @sprite9.dispose
    @sprite10.dispose
    @sprite11.dispose
    @sprite12.dispose
    # Go to command input for next actor
    @actor_command_window.active = true
  end
end
Scene_Battle 3: ShowHide
#==============================================================================
# ** Scene_Battle (part 3)
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Start Actor Command Phase
  #--------------------------------------------------------------------------
  def start_phase3
    # Shift to phase 3
    @phase = 3
    # Set actor as unselectable
    @actor_index = -1
    @active_battler = nil
    # Go to command input for next actor
    phase3_next_actor
  end
  #--------------------------------------------------------------------------
  # * Go to Command Input for Next Actor
  #--------------------------------------------------------------------------
  def phase3_next_actor
    # Loop
    begin
      # Actor blink effect OFF
      if @active_battler != nil
        @active_battler.blink = false
      end
      # If last actor
      if @actor_index == $game_party.actors.size-1
        # Start main phase
        start_phase4
        return
      end
      # Advance actor index
      @actor_index += 1
      @active_battler = $game_party.actors[@actor_index]
      @active_battler.blink = true
    # Once more if actor refuses command input
    end until @active_battler.inputable?
    # Set up actor command window
    phase3_setup_command_window
  end
  #--------------------------------------------------------------------------
  # * Go to Command Input of Previous Actor
  #--------------------------------------------------------------------------
  def phase3_prior_actor
    # Loop
    begin
      # Actor blink effect OFF
      if @active_battler != nil
        @active_battler.blink = false
      end
      # If first actor
      if @actor_index == 0
        # Start party command phase
        start_phase2
        return
      end
      # Return to actor index
      @actor_index -= 1
      @active_battler = $game_party.actors[@actor_index]
      @active_battler.blink = true
    # Once more if actor refuses command input
    end until @active_battler.inputable?
    # Set up actor command window
    phase3_setup_command_window
  end
  #--------------------------------------------------------------------------
  # * Actor Command Window Setup
  #--------------------------------------------------------------------------
  def phase3_setup_command_window
    # Disable party command window
    @party_command_window.active = false
    @party_command_window.visible = false
    # Enable actor command window
    @actor_command_window.active = true
    @actor_command_window.visible = true
    # Set actor command window position
    @actor_command_window.x = @actor_index * 160
    # Set index to 0
    @actor_command_window.index = 0
  end
  #--------------------------------------------------------------------------
  # * Frame Update (actor command phase)
  #--------------------------------------------------------------------------
  def update_phase3
  #--------------------------------------------------------------------------
  #   ***         Strategy3       ***
    if @triangle_step != nil
      update_triangle
    return
    end
  #--------------------------------------------------------------------------
    # If enemy arrow is enabled
    if @enemy_arrow != nil
      update_phase3_enemy_select
    # If actor arrow is enabled
    elsif @actor_arrow != nil
      update_phase3_actor_select
    # If skill window is enabled
    elsif @skill_window != nil
      update_phase3_skill_select
    # If item window is enabled
    elsif @item_window != nil
      update_phase3_item_select
    # If actor command window is enabled
    elsif @actor_command_window.active
      update_phase3_basic_command
    end
  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 cursor position
      case @actor_command_window.index
      when 0  # attack
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Set action
        @active_battler.current_action.kind = 0
        @active_battler.current_action.basic = 0
        # Start enemy selection
        start_enemy_select
      when 1  # skill
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Set action
        @active_battler.current_action.kind = 1
        # Start skill selection
        start_skill_select
      when 2  # guard
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Set action
        @active_battler.current_action.kind = 0
        @active_battler.current_action.basic = 1
        # Go to command input for next actor
        phase3_next_actor
      when 3  # item
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Set action
        @active_battler.current_action.kind = 2
        # Start item selection
        start_item_select
#===================================================================   
#   ***         Strategy2       ***
      when 4  # strategy
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Set action
        @active_battler.current_action.kind = 0
        @active_battler.current_action.basic = 1
        #make strategy bars
        start_strategy
        make_triangle
        make_bars
       
#-------------------------------------------------------------------   
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (actor command phase : skill selection)
  #--------------------------------------------------------------------------
  def update_phase3_skill_select
    # Make skill window visible
    @skill_window.visible = true
    # Update skill window
    @skill_window.update
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # End skill selection
      end_skill_select
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Get currently selected data on the skill window
      @skill = @skill_window.skill
      # If it can't be used
      if @skill == nil or not @active_battler.skill_can_use?(@skill.id)
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Set action
      @active_battler.current_action.skill_id = @skill.id
      # Make skill window invisible
      @skill_window.visible = false
      # If effect scope is single enemy
      if @skill.scope == 1
        # Start enemy selection
        start_enemy_select
      # If effect scope is single ally
      elsif @skill.scope == 3 or @skill.scope == 5
        # Start actor selection
        start_actor_select
      # If effect scope is not single
      else
        # End skill selection
        end_skill_select
        # Go to command input for next actor
        phase3_next_actor
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (actor command phase : item selection)
  #--------------------------------------------------------------------------
  def update_phase3_item_select
    # Make item window visible
    @item_window.visible = true
    # Update item window
    @item_window.update
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # End item selection
      end_item_select
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Get currently selected data on the item window
      @item = @item_window.item
      # If it can't be used
      unless $game_party.item_can_use?(@item.id)
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Set action
      @active_battler.current_action.item_id = @item.id
      # Make item window invisible
      @item_window.visible = false
      # If effect scope is single enemy
      if @item.scope == 1
        # Start enemy selection
        start_enemy_select
      # If effect scope is single ally
      elsif @item.scope == 3 or @item.scope == 5
        # Start actor selection
        start_actor_select
      # If effect scope is not single
      else
        # End item selection
        end_item_select
        # Go to command input for next actor
        phase3_next_actor
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Updat (actor command phase : enemy selection)
  #--------------------------------------------------------------------------
  def update_phase3_enemy_select
    # Update enemy arrow
    @enemy_arrow.update
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # End enemy selection
      end_enemy_select
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Set action
      @active_battler.current_action.target_index = @enemy_arrow.index
      # End enemy selection
      end_enemy_select
      # If skill window is showing
      if @skill_window != nil
        # End skill selection
        end_skill_select
      end
      # If item window is showing
      if @item_window != nil
        # End item selection
        end_item_select
      end
      # Go to command input for next actor
      phase3_next_actor
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (actor command phase : actor selection)
  #--------------------------------------------------------------------------
  def update_phase3_actor_select
    # Update actor arrow
    @actor_arrow.update
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # End actor selection
      end_actor_select
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Set action
      @active_battler.current_action.target_index = @actor_arrow.index
      # End actor selection
      end_actor_select
      # If skill window is showing
      if @skill_window != nil
        # End skill selection
        end_skill_select
      end
      # If item window is showing
      if @item_window != nil
        # End item selection
        end_item_select
      end
      # Go to command input for next actor
      phase3_next_actor
    end
  end
  #--------------------------------------------------------------------------
  # * Start Enemy Selection
  #--------------------------------------------------------------------------
  def start_enemy_select
    # Make enemy arrow
    @enemy_arrow = Arrow_Enemy.new(@spriteset.viewport1)
    # Associate help window
    @enemy_arrow.help_window = @help_window
    # Disable actor command window
    @actor_command_window.active = false
    @actor_command_window.visible = false
  end
  #--------------------------------------------------------------------------
  # * End Enemy Selection
  #--------------------------------------------------------------------------
  def end_enemy_select
    # Dispose of enemy arrow
    @enemy_arrow.dispose
    @enemy_arrow = nil
    # If command is [fight]
    if @actor_command_window.index == 0
      # Enable actor command window
      @actor_command_window.active = true
      @actor_command_window.visible = true
      # Hide help window
      @help_window.visible = false
    end
  end
  #--------------------------------------------------------------------------
  # * Start Actor Selection
  #--------------------------------------------------------------------------
  def start_actor_select
    # Make actor arrow
    @actor_arrow = Arrow_Actor.new(@spriteset.viewport2)
    @actor_arrow.index = @actor_index
    # Associate help window
    @actor_arrow.help_window = @help_window
    # Disable actor command window
    @actor_command_window.active = false
    @actor_command_window.visible = false
  end
  #--------------------------------------------------------------------------
  # * End Actor Selection
  #--------------------------------------------------------------------------
  def end_actor_select
    # Dispose of actor arrow
    @actor_arrow.dispose
    @actor_arrow = nil
  end
  #--------------------------------------------------------------------------
  # * Start Skill Selection
  #--------------------------------------------------------------------------
  def start_skill_select
    # Make skill window
    @skill_window = Window_Skill.new(@active_battler)
    # Associate help window
    @skill_window.help_window = @help_window
    # Disable actor command window
    @actor_command_window.active = false
    @actor_command_window.visible = false
  end
  #--------------------------------------------------------------------------
  # * End Skill Selection
  #--------------------------------------------------------------------------
  def end_skill_select
    # Dispose of skill window
    @skill_window.dispose
    @skill_window = nil
    # Hide help window
    @help_window.visible = false
    # Enable actor command window
    @actor_command_window.active = true
    @actor_command_window.visible = true
  end
  #--------------------------------------------------------------------------
  # * Start Item Selection
  #--------------------------------------------------------------------------
  def start_item_select
    # Make item window
    @item_window = Window_Item.new
    # Associate help window
    @item_window.help_window = @help_window
    # Disable actor command window
    @actor_command_window.active = false
    @actor_command_window.visible = false
  end
  #--------------------------------------------------------------------------
  # * End Item Selection
  #--------------------------------------------------------------------------
  def end_item_select
    # Dispose of item window
    @item_window.dispose
    @item_window = nil
    # Hide help window
    @help_window.visible = false
    # Enable actor command window
    @actor_command_window.active = true
    @actor_command_window.visible = true
  end
end
You may also delete the set methods you implemented in Game_Actor.
3310
Script Requests / Re: Strategy Bar system
October 19, 2011, 12:31:47 pm
Not to mention, your script has a heavy use of pictures we don't have access to. *hint*
3311
Actually, yeah, the whole '$game_temp.in_battle' throws errors. It's because $game_temp isn't initialized BEFORE the title screen's window pops up. So, to combat this, I added $game_temp = Game_Temp.new in 'Main', right below 'begin'. F0's edit then worked.
3312
You should try clarifying a bit more by what you want fixed. I did this in Window_Command:
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #     color : text color
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.font.size = 18
    self.contents.draw_text(rect, @commands[index])
  end
And that reduced the size of the "Attack, Skills, Items, Defend" commands in battle. It also changes the font size of the title screen window.
3313
Script Requests / Re: Class-Actor-Skill Hybrid?
October 12, 2011, 11:37:28 pm
Loops. 'nuff said.
Spoiler: ShowHide
  #--------------------------------------------------------------------------
  # * Add Techniques
  #--------------------------------------------------------------------------
  def add_tech(tech_id)
    return if @techniques[tech_id] != nil # stops if tech is already possessed
    @techniques[tech_id] = Game_Technique.new(tech_id)
    weapon_tech(tech_id)
  end
  #--------------------------------------------------------------------------
  # * Custom Weapon Set - technique interface w/ add weapon
  #--------------------------------------------------------------------------
  def weapon_tech(id)
    skills = @techniques[id].skills
    skills.each{|s|
      if [6,7,8,9,10,11,62,63].include?(s)
        a =  $data_skills[s].str_f
        z =  $data_skills[s].dex_f
        for n in a..z
          add_weapon(n)
        end
      end
    }
    p(@weapon_set)
  end
For your array of [6,7,8,9,10,11,62,63], I'm hoping you make that more user-friendly. Unless this script is solely yours...in that case, knock yourself out.
3314
Script Requests / Re: Class-Actor-Skill Hybrid?
October 12, 2011, 02:30:13 pm
Really? That first line (self.class_id) shouldn't have done anything. Just tested it--no errors.
And the $data_weapons was just an example, not a fix for the script. $data_weapons is something completely different.

Will be gone for a few hours. Try and find a list of what you want done next when I get back; I'm bored.
3315
Script Requests / Re: Class-Actor-Skill Hybrid?
October 12, 2011, 02:06:21 pm
@weapon_set = $data_classes[@class_id].weapon_set.clone
It looks like this, right? I just did that right now and it worked.

Thanks for that 'clone' tip. It actually helped me out with my current project. :P
3316
According to the setup, each item/weapon/armor has only one recipe. I'm sure it's more than possible to edit the script to satisfy your needs, but at the current state of the script, no, it's not possible. (Anyone correct me if I'm wrong)
3317
Quote from: Xuroth on October 12, 2011, 03:52:59 am
can you use this to create multiple recipes for an item?
for example:
to make a chaos sword (no enchantments) you need:
1 chaos essence
1 mithril sword
but if you dont have a mithril sword but you have its reqs:
3 mithril ores
1 wrapped hilt
You should be able to use:
3 mithril ores
1 wrapped hilt
1 chaos essence
For not having all the specific items (and because the smith will "forge" the sword then add the essence) you should have to pay the fee of both making the mithril sword and the chaos sword together.

Just curious...
I'm not sure if it works exactly like that. I'm assuming it doesn't. But that doesn't mean you can't just forge a mithril sword and then use that sword to make a chaos sword.
3318
Script Requests / Re: Class-Actor-Skill Hybrid?
October 11, 2011, 08:30:22 pm
Through testing, I found out that even if you did something like @weapon_set = $data_classes[@class_id].weapon_set and then did @weapon_set.push(100), it would still push 100 as a usable weapon to any actor who shared the same class. As such, I only took the array values from $data_classes[@class_id].weapon_set by using a ".each{}" and stored those values into @unique_weapon. The reason I called it Unique is because only this specific actor has access to this list of weapons. When I did @unique_weapon.push(100)--along with all the modifications I added--only that specific actor was capable of equipping weapon 100. I even had other party members who were the same class and they couldn't equip weapon 100.

Just use my add-on I wrote, and then press CTRL+H to change the names of 'unique_weapon' and 'unique_armor' to whatever you want it to be (I'm guessing 'weapon_set' and 'armor_set').

If you want to make a custom method to add weapons/armors that don't duplicate, do something like:
def add_weapon(id)
    return if @unique_weapon.include?(id)
    @unique_weapon.push(id)
    @unique_weapon.sort!
  end
3319
Script Requests / Re: Class-Actor-Skill Hybrid?
October 11, 2011, 07:16:06 pm
Got it:
Spoiler: ShowHide
class Game_Actor < Game_Battler
  attr_accessor :techniques
  attr_accessor :unique_weapon
  attr_accessor :unique_armor
 
  alias initialize_techniques initialize
  def initialize(actor_id)
    @techniques = []
    @unique_weapon = []
    @unique_armor = []
    initialize_techniques(actor_id)
  end
 
  alias call_actor_setup setup
  def setup(actor_id)
    call_actor_setup(actor_id)
    $data_classes[@class_id].weapon_set.each{|w|
      @unique_weapon.push(w)
    }
    $data_classes[@class_id].armor_set.each{|a|
      @unique_armor.push(a)
    }
  end
 
  # Adds the specified technique to the @techniques array
  def add_tech(tech_id)
    return if @techniques[tech_id] != nil # stops if tech is already possessed
    @techniques[tech_id] = Game_Technique.new(tech_id)
  end


  #--------------------------------------------------------------------------
  # * Determine if Equippable
  #     item : item
  #--------------------------------------------------------------------------
  def equippable?(item)
    # If weapon
    if item.is_a?(RPG::Weapon)
      # If included among equippable weapons in current class
      if @unique_weapon.include?(item.id)
        return true
      end
    end
    # If armor
    if item.is_a?(RPG::Armor)
      # If included among equippable armor in current class
      if @unique_armor.include?(item.id)
        return true
      end
    end
    return false
  end
 
end
#===============================================================================
# Modified Equip Window: Shows the proper equips actor can equip
#===============================================================================
class Window_EquipItem < Window_Selectable
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # Add equippable weapons
    if @equip_type == 0
      weapon_set = @actor.unique_weapon
      for i in 1...$data_weapons.size
        if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
          @data.push($data_weapons[i])
        end
      end
    end
    # Add equippable armor
    if @equip_type != 0
      armor_set = @actor.unique_armor
      for i in 1...$data_armors.size
        if $game_party.armor_number(i) > 0 and armor_set.include?(i)
          if $data_armors[i].kind == @equip_type-1
            @data.push($data_armors[i])
          end
        end
      end
    end
    # Add blank page
    @data.push(nil)
    # Make a bit map and draw all items
    @item_max = @data.size
    self.contents = Bitmap.new(width - 32, row_max * 32)
    for i in 0...@item_max-1
      draw_item(i)
    end
  end
end
Tested it a bit. Seemed fine. Also possible to use $game_actors[id].unique_weapon.push(id) to add new items.

Edit: Ninja'd
Edit 2: Wait...you said you needed to find a way to add onto the base. In that case, no ninja. I've provided that.
3320
Script Requests / Re: Class-Actor-Skill Hybrid?
October 11, 2011, 06:27:30 pm
Just make each actor be its own unique class? Or do you plan to still have the option to change classes?

Anyways, yes, you're right that if you push a weapon into the $data_classes, you affect EVERY instance of any actor that may be of that class type. If you want to make weapons actor-specific, there might be a script for that already. Otherwise, you will have to edit a portion of the other RMXP default scripts (like the Equip_Windows).