So I'm working with Chrono Trigger CMS, so for I did all customization to my project, but this CMS has a deadly flaw. The ''Items Menu'' don't actually have any kind of cursor which
you can select the items within it. It just goes through the items in the menu blindly, with the cursor sound, but no cursor over the items. For the everything else the cursor work fine,
its just in the Items Menu that this thing happens. I tryed some work, but my skills with ruby are still very noob for that, so I would ask if anyone could help making the Items Menu cursor work for
me? My edited Chrono Trigger CMS link is bellow. Note some of the players position in there could be a little out of position, thats because of my project, so don't botter with that. Just need the cursor
work for Items Menu. I would be thankfull if anyone could do look to that and see if this is possible, and help customizing it.
Chrono Trigger CMS Edited: http://www.4shared.com/rar/rYgaGPAhba/Chrono_Trigger__CMS_Windowskin.html
My thanks!
Was curious what these lines were doing so I commented them out.
#--------------------------------------------------------------------------
# ● update_cursor_rect
#--------------------------------------------------------------------------
def update_cursor_rect
...
#unless $scene.is_a?(Scene_Menu)
self.cursor_rect.set(x, y, cursor_width, 32)
#end
end
It seems like this worked, but I don't know at what cost. Note that it wasn't just the item window--the equipment list and skills were also doing the same thing.
I'd also like to add to your bug list that the item window needs to be refreshed after the player unequips a weapon/armor. The said equip will be missing from the item window until the menu is reopened.
So I supposed do change change every "#Cursor Rectangle Update" sections, which theres is seven in total, or should I add a new line?
Edit: I think this may be a pain to correct, its a good menu script which fit on my project, but it has too many flaws.
That depends if commenting out those couple of lines do any real harm or not.
It don't work for me, it just give out SyntaxErrors somewhere, don't matter if I change that ''...'' thing or ajust the #end. I tryed to work out these lines and it just don't work here.
Ellipses aren't part of the code...that's just my short-hand way of saying "I'm ignoring all the lines of code that should be here so that I can address the REAL issue of the problem".
All you have to do is just comment out the two lines I indicated in the code.
Could you please post here the Chrono Trigger CMS script? I mean the whole script as you have changed, if you have done it there.
It has nothing to do with the CMS. It's only the Cursor script that needs changing. I guess it has something to do with not updating the cursor's location in relation to the window's index.
Oh do forgive me, I thought it was the CMS. I commented the lines and it worked as you have said, but theres a small problem. The Items Menu has 2 columns, the changes only allow the cursor to work with the left column, but it interprets as if the cursor selected the itens of the right column. Guess the only thing that needs now is to try to eliminate the second column, allowing just one for all items. Its possible to work on that?
It's alright. I know you're new to scripting whereas I've been doing it for years. I get lazy with explanations.
Replace Window_Item in the CMS with this. It will add another column plus fixes the drawing coordinates.
#==============================================================================
# ** Window_Item
#------------------------------------------------------------------------------
# This window displays items in possession on the item and battle screens.
#==============================================================================
class Window_Item < Window_Selectable
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def initialize
super(38, 125, 602, 320)
self.index = 0
self.z = 150
@column_max = 2
# If in battle, move window to center of screen
# and make it semi-transparent
if $game_temp.in_battle
@column_max = 1
self.y = 64
self.x = 0
self.y = 64
self.width = 640
self.height = 256
self.back_opacity = 160
end
refresh
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if item.is_a?(RPG::Item) and $game_party.item_can_use?(item.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
if $game_temp.in_battle
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
else
self.contents.font.size = 18
self.contents.font.bold = true
x = 4 + index % 2 * 301
y = index / 2 * 32
end
rect = Rect.new(x, y, self.width / @column_max - 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 $game_temp.in_battle
self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
else
self.contents.draw_text(x + 220, y, 16, 32, ":", 1)
self.contents.draw_text(x + 230, y, 24, 32, number.to_s, 2)
end
end
end
Ohhh I have found the solution for that. Its here:
#--------------------------------------------------------------------------
# ● initialize
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
#Here I changed the value 1 to 2 of 2 lines bellow
@item_max = 2
@column_max = 2
@index = 0
@cursor = Sprite_Cursor.new(x, y)
unless $scene.is_a?(Scene_Menu)
@cursor.opacity = 0
end
update_cursor
end
Worked as it should have. I wounder why it didn't worked as it is in the first place.
Thanks for the great help again!
Edit: Sorry, I was posting my solution while you have posted yours, thats cool. Also your solution was different than mine, but worked better than mine.
My change also made impossible to select the second actor in the "Equip Menu", and in the "Skill Menu" it creates a second column where there none. Your change was the
solution. I'll study your change to understand what happened.
My thanks!
Without having the scripts to reference to right now (at school), I can guess that you're probably editing Window_Selectable. This is a parent class and is used as a "base" for other classes to branch off of. Window_Skill for example is an extension of Window_Selectable; if you make changes to Window_Selectable, Window_Skill will inherit the changes as well.
The problem was just Window_Item and just it alone, which is what I did. If it was a problem that existed in other windows that extend Window_Selectable, THEN you would infer that Window_Selectable should be the one that needs fixing.
Also, setting @item_max to 2 will only draw at most 2 selectable items in the window. In other words, if your party had 100 different kinds of potions, it'd only draw something like a Potion and a Greater Potion in your inventory window.
I see that. Thanks for the tips.
I could work alignment problems easly on each Menu Classes, extended it to my resolution and the position of the selectables within it, but thats my limit of Ruby work for now. I'll continue studying it.
I found another bizarre problem. Now its on "Skill Menu".
The icons for the skills only show for the first 2 skills, the rest is totaly hidden, but the skills are still there. It just don't show the icons of the skills. I'm looking in the script trying to find out
what happened, so far I got no luck. I would be gratefull if you can look out this issue. Also when theres more than 4 or 5 skills, it pulls the icon of some skill bellow over the icon the actual position skill, showing
3 icons, but the third is the icon of the forth skill. Its a mess. Please Help me!
My demo is working fine. You probably messed around with @item_max and/or @column_max somewhere, either in Window_Selectable or Window_Skill.
I tryed on the demo CMS here and the problems still there, so I tryed the demo with my customized CMS and it worked just fine. I can only guess that there is another custom script thats interfering with CMS.
I'll find out.
My thanks for the help.
Edit: Found the problem. It was one of battle system custom script. I just changed Chrono Trigger CMS bellow it, and everything worked. But, as everything comes with a price, the battle skill manu background disappeared, all the skills, icons, description, etc, are still there work normaly, its just the window itself that disapeared. It was the Windows Class of the custom battle script tha was causing the icon problem. I'll try some work on these now.