[XP] Stormtronics CMS

Started by Blizzard, January 09, 2008, 04:00:35 pm

Previous topic - Next topic

Blizzard

I check for the index of the window I am currently in and then change the visibility. i.e.


@item_windows.each {|window| window.visible = false}
@item_windows[@right_window.index].visible = true


That should actually already work automatically.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

reaper72004

umm I must be tired cause I don't get it :P

Blizzard

As I said, my code should be doing that already.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

reaper72004

May 29, 2009, 12:02:58 pm #203 Last Edit: May 29, 2009, 12:14:52 pm by reaper72004
I'll upload a demo so you can see. Gimme a few min and I'll have it up.

Okie here it is : http://www.sendspace.com/file/zg162n
Warning though don't select the equipment option on the main menu.

Blizzard

*selects the Equipment option* OH SHI-

I think I didn't understand you right, because what I understood that isn't working actually is working. o_o; Can you explain what's wrong in a different way?
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

reaper72004

May 29, 2009, 02:28:33 pm #205 Last Edit: May 29, 2009, 02:29:50 pm by reaper72004
Okie lol you see how when your in the option's menu and when items or quest items is selected but not pressing C, it auto shows the window with the items in it. I want that to happen when I have equipment selected.

Haha ment item's menu not option's

Blizzard

As I said, that already happens in the Equip menu. When you change the index of Window_CMSEquipRight (aka you press down and then Shield is selected instead of Weapon), the appropriate Window_CMSEquipItem instance below becomes visible (showing you now shields instead of weapons).
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

reaper72004

May 29, 2009, 03:23:04 pm #207 Last Edit: May 29, 2009, 05:29:41 pm by reaper72004
I don't need it for Window_CMSEquipRight though, I need it for this Window_EquipmentItem.

On Item:
Spoiler: ShowHide


On Equipment: the one I'm trying to do..
Spoiler: ShowHide


On Quest Items:
Spoiler: ShowHide


You see when the courser or selector is on Item or Quest Item how it show the window of the items without being in that window.. that's what I want to do with the Equipment one that's beside Item.

Blizzard

May 29, 2009, 06:21:40 pm #208 Last Edit: May 29, 2009, 06:25:12 pm by Blizzard
Step 1: ShowHide
Change this:
    @commands = ['    Items', '   Equipment', '      Sort', '     Quest Items']

to this:
    @commands = ['Items', 'Sort', 'Equipment', 'Quest Items']



Step 2: ShowHide
Change this:
    self.contents.fill_rect(8 + 150*i, 0, 164, 32, Color.new(0, 0, 0, 0))
   self.contents.draw_text(8 + 150*i, 0, 164, 32, @commands[i], 0)

to this:
    self.contents.fill_rect(160*i, 0, 128, 32, Color.new(0, 0, 0, 0))
   self.contents.draw_text(160*i, 0, 128, 32, @commands[i], 1)



Step 3: ShowHide
Change this:
      when 1
       @equips_window = Window_EquipmentItem.new
       @equips_window.help_window = @help_window
       @equips_window.active = @help_window.visible = true
       @items_window1.active = false
       @items_window1.visible = false
       @equips_window.visible = true
       @help_window.x, @help_window.y = 0, -612
       @equips_window.index = 0        
     when 2 then @sort_window = Window_CMSSortCommand.new

to this:
      when 2
       @equips_window.active = @help_window.visible = true
       @equips_window.index = 0        
     when 1 then @sort_window = Window_CMSSortCommand.new



Step 4: ShowHide
Change this:
      when 0
       $game_system.se_play($data_system.decision_se)
       if BlizzCFG::CUSTOM_ITEM_SCENE
         @scene = Scene_Item.new
       else
         @item_choose_window = Window_CMSChooseItem.new
         @items_window1 = Window_NormalItem.new
         @items_window2 = Window_QuestItem.new
         @items_window1.help_window = @items_window2.help_window = @help_window
         @command_window.active = false
         @help_window.x, @help_window.y = 0, -576
         @help_window.set_text('')
         @help_window.visible = false
         items_refresh
       end

to this:
      when 0
       $game_system.se_play($data_system.decision_se)
       if BlizzCFG::CUSTOM_ITEM_SCENE
         @scene = Scene_Item.new
       else
         @item_choose_window = Window_CMSChooseItem.new
         @items_window1 = Window_NormalItem.new
         @items_window2 = Window_QuestItem.new
         @equips_window = Window_EquipmentItem.new
         @items_window1.help_window = @items_window2.help_window =
             @equips_window.help_window = @help_window
         @command_window.active = false
         @equips_window.active = false
         @equips_window.index = -1
         @help_window.x, @help_window.y = 0, -576
         @help_window.set_text('')
         @help_window.visible = false
         items_refresh
       end



Step 5: ShowHide
Change this:
  def items_refresh
   index = @item_choose_window.index
   @items_window1.visible = [0, 1].include?(index)
   @items_window2.visible = (index == 3)
 end

to this:
  def items_refresh
   index = @item_choose_window.index
   @items_window1.visible = [0, 1].include?(index)
   @equips_window.visible = (index == 2)
   @items_window2.visible = (index == 3)
 end



Step 6: ShowHide
Change this:
  def del_items
   @items_window1.dispose
   @items_window1 = nil
   @items_window2.dispose
   @items_window2 = nil
   @item_choose_window.dispose
   @item_choose_window = nil
 end

 def del_equipment
   @equips_window.dispose
   @equips_window = nil
 end

to this:
  def del_items
   @items_window1.dispose
   @items_window1 = nil
   @items_window2.dispose
   @items_window2 = nil
   @item_choose_window.dispose
   @item_choose_window = nil
   @equips_window.dispose
   @equips_window = nil
 end

 def del_equipment
   @equips_window.active = false
   @equips_window.index = -1
 end



Step 7: ShowHide
And finally find and delete this line:
        @equips_window.update

Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

reaper72004

May 29, 2009, 06:36:21 pm #209 Last Edit: May 29, 2009, 06:44:13 pm by reaper72004
 :^_^': lol every thing you just told me to change I've been messing with this whole time.  :haha:

Thx Blizz.. I bow to you..  :bow:


Umm.. It's not show a discription of the item's and equips now.  :O.o:

Blizzard

I think you messed up something badly since I can't find what's causing the problem. There are also a few other problems.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

reaper72004

May 29, 2009, 07:04:24 pm #211 Last Edit: May 30, 2009, 04:01:06 am by reaper72004
If I messed up something it's gonna be in Scene_Menu.. I'll look over mine by comparing it to a unmodified one.

Only other thing modified in Scene_menu that connects to that is this..

I changed this:
Spoiler: ShowHide
Quote
if @equips_window != nil
     update_equipment
   elsif @command_window.active
     update_command
   elsif @status_windows[0].active
     update_status
   elsif @item_choose_window != nil
     if @item_choose_window.active
       items_refresh
       update_items_choose
     elsif @sort_window != nil && @sort_window.active
       update_sort
     elsif @items_window1 != nil && @items_window1.active
       @items_window1.update
       update_item
     elsif @items_window2 != nil && @items_window2.active
       @items_window2.update
       update_item


To this:
Spoiler: ShowHide
Quote
if @command_window.active
     update_command
   elsif @status_windows[0].active
     update_status
   elsif @item_choose_window != nil
     if @item_choose_window.active
       items_refresh
       update_items_choose
     elsif @sort_window != nil && @sort_window.active
       update_sort
     elsif @items_window1 != nil && @items_window1.active
       @items_window1.update
       update_item
     elsif @equips_window != nil
       update_equipment
     elsif @items_window2 != nil && @items_window2.active
       @items_window2.update
       update_item



Hmm I dunno whats causing the prob, I made the exact changes on a unmodifed version and it does the same thing.

Also now the sort "Alphabet" is messed up. :(

I need a break before I start pulling out hair. ^^

Okie I fixed the sort problem. Just found something else though, when I select a item aka..'Potion'.. and try to use it then go back to the item choose window the select actor to use the item on window is active, not getting disposed I think :P If that makes since..lol

Hmm, this whole problem with the help window and the last prob I found is all pointing at this:

Spoiler: ShowHide

when 0
       $game_system.se_play($data_system.decision_se)
       if BlizzCFG::CUSTOM_ITEM_SCENE
         @scene = Scene_Item.new
       else
         @item_choose_window = Window_CMSChooseItem.new
         @items_window1 = Window_NormalItem.new
         @items_window2 = Window_QuestItem.new
         @equips_window = Window_EquipmentItem.new    
         @items_window1.help_window = @items_window2.help_window =
           @equips_window.help_window = @help_window
         @command_window.active = false
         @equips_window.active = false
         @equips_window.index = -1
         @help_window.x, @help_window.y = 0, -576
         @help_window.set_text('')
         @help_window.visible = false
         items_refresh
       end


If I comment out the lines that have to do with the @equips the help window displays and the problem with the items disappears, but then equipment doesn't work cause I commented them out.

Blizzard

Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

reaper72004

May 30, 2009, 07:06:14 am #213 Last Edit: May 30, 2009, 07:08:56 am by reaper72004
I made some progress: here's the scripts data file:


I got it to where the help display's but once you goto equipment and exit and go back the help display disappears, if that makes since. Still can't figure out whats causing the prob with the items though.

Blizzard

I'll do it from scratch, it will be better that way.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

reaper72004

May 30, 2009, 07:10:37 am #215 Last Edit: May 30, 2009, 07:11:54 am by reaper72004
.. ok, when you do redo it I'll have to redo all the other changes I made huh.  :O.o:

*off topic* XD game guy wants me to make cave's for him now. 8)

Blizzard

Put this code under STCMS. It will disable the Equipment option and show Equipment in the Items menu instead. Just like you wanted it.

Spoiler: ShowHide
#=begin
class Window_CMSCommand < Window_Command
 
 alias initialize_cmsmod_alias initialize
 def initialize(index, continue)
   initialize_cmsmod_alias(index, continue)
   self.disable_item(1)
 end
 
end

class Window_CMSChooseItem < Window_Selectable
 
 def initialize
   @background = 'CMSHelp'
   super(0, -576, 640, 64)
   @commands = ['Items', 'Sort', 'Equipment', 'Quest Items']
   @item_max = @column_max = @commands.size
   self.contents = Bitmap.new(width - 32, 32)
   refresh
   self.active, self.z, self.index = true, 2900, 0
 end
 
 def draw_item(i, color)
   self.contents.font.color = color
   self.contents.fill_rect(160*i, 0, 128, 32, Color.new(0, 0, 0, 0))
   self.contents.draw_text(160*i, 0, 128, 32, @commands[i], 1)
 end
 
end

class Window_EquipmentItem < Window_CMSItem
 
 alias initialize_cmsmod_alias initialize
 def initialize(actor)
   initialize_cmsmod_alias(actor)
   self.x, self.y = 256, -512
   self.active = self.visible = false
 end
 
 def draw_item(i)
   self.contents.font.color = normal_color
   case @data[i]
   when RPG::Weapon then number = $game_party.weapon_number(@data[i].id)
   when RPG::Armor then number = $game_party.armor_number(@data[i].id)
   end
   self.contents.fill_rect(4, i*32, 352, 32, Color.new(0, 0, 0, 0))
   bitmap = RPG::Cache.icon(@data[i].icon_name)
   self.contents.blt(4, 4 + i*32, bitmap, Rect.new(0, 0, 24, 24))
   self.contents.draw_text(32, i*32, 212, 32, @data[i].name, 0)
   self.contents.draw_text(308, i*32, 16, 32, ':', 1)
   self.contents.draw_text(324, i*32, 24, 32, number.to_s, 2)
 end
 
end
 
class Scene_Menu
 
 def del_items
   @items_window1.dispose
   @items_window1 = nil
   @items_window2.dispose
   @items_window2 = nil
   @item_choose_window.dispose
   @item_choose_window = nil
   @equip_window.dispose
   @equip_window = nil
 end
 
 def move_da_items(win = @item_choose_window)
   y_plus = [@item_choose_window, @items_window1, @items_window2,
       @equip_window, @help_window]
   move_windows([[], [], y_plus, []], 0, 64, win, false)
 end
 
 def update
   @status_windows.each {|win| win.update(@actor_index)}
   @target_windows.each {|win| win.update(@target_index)}
   @info_window.update
   unless @status_windows[0].x < 0 || @status_windows[0].dir != 0 ||
       @target_windows[0] != nil && @target_windows[0].dir != 0
     @command_window.update
     [@help_window, @item_choose_window, @sort_window,
     @skill_window, @left_window, @right_window, @playerstatus_window,
     @options_window, @end_window].each {|win| win.update if win != nil}
   end
   move_da_main if @status_windows[0].x < 0
   move_da_selection if @status_windows[0].dir != 0
   move_da_targeting if @target_windows[0] != nil && @target_windows[0].dir != 0
   move_da_status if @playerstatus_window != nil && @playerstatus_window.y > 0
   move_da_equip if @left_window != nil && @left_window.x > 0
   move_da_skill if @skill_window != nil && @skill_window.x < 256
   move_da_target if @target_windows[0] != nil && @target_windows[0].x < 0
   move_da_items if @item_choose_window != nil && @item_choose_window.y < 0
   move_da_sort if @sort_window != nil && @sort_window.y < 64
   move_da_options if @options_window != nil && @options_window.y > 0
   move_da_end if @end_window != nil && @end_window.y > 336
   if @moved
     @moved = false
     return
   end
   if @command_window.active
     update_command
   elsif @status_windows[0].active
     update_status
   elsif @item_choose_window != nil
     if @item_choose_window.active
       items_refresh
       update_items_choose
     elsif @sort_window != nil && @sort_window.active
       update_sort
     elsif @items_window1 != nil && @items_window1.active
       @items_window1.update
       update_item
     elsif @equip_window != nil && @equip_window.active
       @equip_window.update
       update_item_equipment
     elsif @items_window2 != nil && @items_window2.active
       @items_window2.update
       update_item
     elsif @target_windows[0] != nil && @target_windows[0].active
       update_item_target
     end
   elsif @skill_window != nil && @skill_window.active
     update_skill
   elsif @target_windows[0] != nil && @target_windows[0].active
     update_skill_target
   elsif @right_window != nil
     if @right_window.active
       update_right_equip
     elsif @item_window != nil && @item_window.active
       @item_window.update
       update_eitem
     end
   elsif @playerstatus_window != nil && @playerstatus_window.active
     update_playerstatus
   elsif @options_window != nil && @options_window.active
     update_options
   elsif @end_window != nil
     update_end
   end
 end
 
 alias update_command_cmsmod_alias update_command
 def update_command
   if Input.trigger?(Input::C) && @command_window.index == 0
     if $game_party.actors.size == 0
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     $game_system.se_play($data_system.decision_se)
     if BlizzCFG::CUSTOM_ITEM_SCENE
       @scene = Scene_Item.new
     else
       @item_choose_window = Window_CMSChooseItem.new
       @items_window1 = Window_NormalItem.new
       @items_window2 = Window_QuestItem.new
       @equip_window = Window_EquipmentItem.new(@actor)
       @equip_window.index = -1
       @items_window1.help_window = @items_window2.help_window = @help_window
       @items_window1.help_window = @items_window2.help_window =
           @equip_window.help_window = @help_window
       @command_window.active = false
       @help_window.x, @help_window.y = 0, -576
       @help_window.set_text('')
       @help_window.visible = false
       items_refresh
     end
   elsif Input.trigger?(Input::C) && @command_window.index == 1
     $game_system.se_play($data_system.buzzer_se)
   else
     update_command_cmsmod_alias
   end
 end
 
 alias update_items_choose_cmsmod_alias update_items_choose
 def update_items_choose
   if Input.trigger?(Input::C) && @item_choose_window.index == 2
     items_refresh
     @item_choose_window.active = false
     $game_system.se_play($data_system.decision_se)
     @equip_window.active = @help_window.visible = true
     @equip_window.index = 0
   elsif Input.trigger?(Input::C) && @item_choose_window.index == 3
     items_refresh
     @item_choose_window.active = false
     $game_system.se_play($data_system.decision_se)
     @items_window2.active = @help_window.visible = true
     @items_window2.index = 0
   else
     update_items_choose_cmsmod_alias
   end
 end
 
 def items_refresh
   index = @item_choose_window.index
   @items_window1.visible = [0, 1].include?(index)
   @equip_window.visible = (index == 2)
   @items_window2.visible = (index == 3)
 end
 
 def update_item
   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     @item_choose_window.active = true
     @help_window.set_text('')
     @items_window1.active = @items_window2.active = @help_window.visible = false
     @items_window1.index = @items_window2.index = -1
   elsif Input.trigger?(Input::C)
     win = (@item_choose_window.index == 0 ? @items_window1 : @items_window2)
     @item = win.data
     unless @item.is_a?(RPG::Item) && $game_party.item_can_use?(@item.id)
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     $game_party.actors.each_index {|i|
         @target_windows.push(Window_CMSTarget.new($game_party.actors[i]))}
     @target_index = 0
     $game_system.se_play($data_system.decision_se)
     if @item.scope.between?(3, 6)
       win.active = false
       @target_windows.each {|win| win.active = true}
       if [4, 6].include?(@item.scope)
         @target_windows.each {|win| win.index = -2}
       else
         @target_windows[@target_index].index = 0
       end
     elsif @item.common_event_id > 0
       $game_temp.common_event_id = @item.common_event_id
       $game_system.se_play(@item.menu_se)
       if @item.consumable
         $game_party.lose_item(@item.id, 1)
         win.draw_item(win.index)
       end
       (@status_windows + @target_windows).each {|win| win.refresh}
       @scene = Scene_Map.new
     elsif @skill.scope == 7
       $game_system.se_play($data_system.buzzer_se)
     end
   end
 end
 
 alias update_item_cmsmod_later update_item
 def update_item
   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     @item_choose_window.active = true
     @help_window.set_text('')
     @equip_window.active = @items_window1.active = @items_window2.active =
         @help_window.visible = false
     @equip_window.index = @items_window1.index = @items_window2.index = -1
   else
     update_item_cmsmod_later
   end
 end

 def update_item_equipment
   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     @item_choose_window.active = true
     @help_window.set_text('')
     @equip_window.active = @items_window1.active = @items_window2.active =
         @help_window.visible = false
     @equip_window.index = @items_window1.index = @items_window2.index = -1
   end
 end
 
end
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

reaper72004

May 31, 2009, 08:34:04 am #217 Last Edit: May 31, 2009, 08:42:11 am by reaper72004
Woot tyvm it works.

I think im gonna redo the menu lol cause now my equip option and quest option is unelectable ^^

Calintz

Just be careful, Lol ...

BTW:
Like your avy

reaper72004

May 31, 2009, 08:46:01 am #219 Last Edit: May 31, 2009, 10:18:27 am by reaper72004
Thx it's one of those old battle pic's I found long ago lol

and yeah any time I make a edit Im gonna back up the script now lol and mark where I edit ^^ stupid me lmao

blizz  :'( self.disable_item(1)

Spoiler: ShowHide


Oh and @equip_window should be @equips_window