Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Actor Command Window problem[SOLVED]

What I'm trying to do is add more than four commands to the Window_ActorCommand, which is the window that in battle shows the options 'fight', 'skill', 'guard', 'item'. I'm currently just as a test trying to get it to show an extra 'item' command after the last one.

I have modified Window_ActorCommand.setup to include an extra string s5, have included this in @commands, and have updated @item_max to 5. I have also modified Scene_Battle.update_actor_command_selection accordingly.

Technically it works fine, you can scroll down past the 4th command and press confirm, and the item selection window opens. However, the text that should read 'Item' in the fifth slot does not appear! I haven't been able to get my head around the draw_item method completely so I don't know whether it is something in there I need to change. Or I don't know whether I am missing something obvious here.

If anybody has any ideas it would be a great help!
 
Hi, thanks for the reply.

Perhaps I wasn't clear enough :P What I intend to achieve is for the same size window that still shows 4 commands, but you can scroll down to show, for example, commands 2 to 5 rather than 1 to 4, and scroll back up again. This functionality currently works as I just described it, except the final command is invisible. The cursor hovers over it correctly, and I can even confirm that command. So, I shouldn't need to make the window taller.

The bitmap image in the window though, this sounds like something I might have missed.
***
Just had a look at the bitmap, it seems that was the problem! After adding in the following lines to Window_ActorCommand.setup:

self.contents.dispose
self.contents = Bitmap.new(width - 32, [height - 32, @item_max * WLH].max)

which has been copied out of Window_Selectable, but with row_max replaced with @item_max.

Problem solved! Thank you for your help :D
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top