CBS Help

Started by Nortos, January 08, 2008, 02:03:16 am

Previous topic - Next topic

Nortos

I need help again sorry...I made it so when click on skill go to another command window in it's place with choices, technique, defensive magic, offensive magic, soul rage, chaos rage and everything to do with window works fine you can move the rectangle cursor and select things but it's not reading the scene battle code I wrote for it
here's the code for the commands, I made the scene battle for the skillcommand use update_phase6 and I added the update_phase6 in scene battle 1 and I added the correct code in places for @skillcommand.active = true and visible ect but I can't seem to get it to read the scene_battle please help
#==============================================================================
#  CrossCommand

#   Blazingamer
#  -----------------------------------------
#   Makes a pretty command window in a shape of a cross like in Wild Arms
#==============================================================================

class CrossCommand < Window_Selectable2

  def initialize
super(320 - 128, 160 - 128, 256, 256)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
@commands = ["attack", "magic","defend","items","run away"]
@item_max = 5
draw_item(0, 32,32,"Attack")
draw_item(1, 32,0, "Magic")
draw_item(2, 64,32,"Defend")
draw_item(3, 0,32, "Items")
draw_item(4, 32,64, $game_temp.battle_can_escape ? "Run" : "Run cancel")
self.active = false
self.visible = false
self.index = 0
  end

  def draw_item(index, x, y, icon)   
bitmap = RPG::Cache.icon(icon)
self.contents.blt(x, y, bitmap, Rect.new(0, 0, 32, 32))
  end

  def update_cursor_rect
if index == 3
  self.cursor_rect.set(0, 32, 32, 32)
elsif index == 2
  self.cursor_rect.set(64, 32, 32, 32)
elsif index == 1
   self.cursor_rect.set(32,0,32,32)
elsif index == 4
   self.cursor_rect.set(32,64,32,32)
else
   self.cursor_rect.set(32,32,32,32)
end
if Input.press?(Input::LEFT)
  @index = 3
elsif Input.press?(Input::RIGHT)
  @index = 2
elsif Input.press?(Input::UP)
  @index = 1
elsif Input.press?(Input::DOWN)
  @index = 4
else
  @index = 0
end
  end
end

#-------------------------------------------------------------------------#
        # Start Scene_Battle
#-------------------------------------------------------------------------#
class Scene_Battle

def update_phase3_basic_command
   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     phase3_prior_actor
     return
end
if Input.trigger?(Input::C)
  case @actor_command_window.index
  when 0
  $game_system.se_play($data_system.decision_se)
  @active_battler.current_action.kind = 0
  @active_battler.current_action.basic = 0
  start_enemy_select
  when 1
  $game_system.se_play($data_system.decision_se)
    @skillcommand.active = true
    @skillcommand.visible = true
    @actor_command_window.active = false
    @actor_command_window.visible = false
    update_phase6
  when 2
  $game_system.se_play($data_system.decision_se)
  @active_battler.current_action.kind = 0
  @active_battler.current_action.basic = 1
  phase3_next_actor
  when 3
  $game_system.se_play($data_system.decision_se)
  @active_battler.current_action.kind = 2
  start_item_select
  when 4
        sg_update2_escape_check
      end
      return
    end
  end
 
   def sg_update2_escape_check
    if $game_temp.battle_can_escape == false
      $game_system.se_play($data_system.buzzer_se)
      return
    end
    $game_system.se_play($data_system.decision_se)
    update_phase2_escape
  end
end

#-------------------------------------------------------------------------#
      # Start SkillCommand
       # Nortos
#-------------------------------------------------------------------------#

class Window_SkillCommand < Window_Selectable2
 
  def initialize
super(320 - 128, 160 - 128, 256, 256)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
@commands = ["attack", "offensive magic","defensive magic","soul drive","chaos drive"]
@item_max = 5
draw_item(0, 32,32,"Attack")
draw_item(1, 32,0, "offensive magic")
draw_item(2, 64,32,"defensive magic")
draw_item(3, 0,32, "soul drive")
draw_item(4, 32,64, "chaos drive")
self.index = 0
  end

  def draw_item(index, x, y, icon)   
bitmap = RPG::Cache.icon(icon)
self.contents.blt(x, y, bitmap, Rect.new(0, 0, 32, 32))
  end

  def update_cursor_rect
if index == 3
  self.cursor_rect.set(0, 32, 32, 32)
elsif index == 2
  self.cursor_rect.set(64, 32, 32, 32)
elsif index == 1
   self.cursor_rect.set(32,0,32,32)
elsif index == 4
   self.cursor_rect.set(32,64,32,32)
else
   self.cursor_rect.set(32,32,32,32)
end
if Input.press?(Input::LEFT)
  @index = 3
elsif Input.press?(Input::RIGHT)
  @index = 2
elsif Input.press?(Input::UP)
  @index = 1
elsif Input.press?(Input::DOWN)
  @index = 4
else
  @index = 0
end
  end
end

class Scene_Battle

  def update_phase6
    if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
      start_phase3
    end
if Input.trigger?(Input::C)
  case @skillcommand.index
  when 0
  $game_system.se_play($data_system.decision_se)
  @active_battler.current_action.kind = 0
  @active_battler.current_action.basic = 0
  start_enemy_select
  when 1
  $game_system.se_play($data_system.decision_se)
  when 2
  $game_system.se_play($data_system.decision_se)
  @active_battler.current_action.kind = 0
  @active_battler.current_action.basic = 1
  phase3_next_actor
  when 3
  $game_system.se_play($data_system.decision_se)
    @active_battler.current_action.kind = 8
    start_chaos_select
  when 4
  $game_system.se_play($data_system.decision_se)
    @active_battler.current_action.kind = 3
    start_rage_select
    end
  end
  end
end

Fantasist

Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Nortos

yeah sorry just copied this post from old forum lol. Bassically I have a cross command window in place of actor_command_window and when the play selects skills it does the code update_phase6 and makes @skillcommand.active = true and visible but it doesn't read the scene battle info near the bottom the window works fine just not scene battle I can send you project if u want

Fantasist

Not today Nortos, sorry but I'm  busy.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Nortos

k that's cool I'm mapping and spriting and this doesn't even need to be done for ages as demo won't have Chaos Rage and Soul Rage still in next one