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.

Bugs in RMVX's Window scripts?

Taylor

Sponsor

I'm not quite sure what the bugs are or why they are occurring to my windows I create/edit, but the issues have been all similarly affecting windows and/or worked around - well, almost; which makes me wonder if there are bugs in RMVX's window scripts causing this.

Let me explain through things that happened to me...

Window "viewports" don't update with size:
The viewports I am talking about here are the areas that are visible in windows, not the scripting element known as "viewport" itself. Viewport is just the best word to describe it.
I added lines to points where Window_BattleMessage is called for victory/defeat/fleeing in battle to make it 50px high. This is the same size as Window_Help (at least, in my game), and despite a few more experiments to finally get the window to use only one line ... I receive those annoying little arrows at the bottom of the window as if there is more content - like a scrollable list. Yet I am certain this is not true.
A second example of this is Window_BattleStatus. I created three different layouts for it depending on a variable - one was like the default, another slightly taller, and another was much taller to fit it's vertical alignment on the side of the screen.
At first, when I tried the tall alignment, I could only see the first two character's stats - slightly cut off that is. What appeared to have happened here was despite the window being at least twice as tall because of a basic "self.height" in a if branch, the content was being displayed according to the original height in super( x, y, h, w). The way around this was to make the original height as big as it would get. But this recreated the problem with Window_BattleMessage - those damn scroll arrows. DX

Window content sometimes doesn't follow .visible setting:
Another strange bug, I created a window known as Window_AFace. It gets called in create_info_viewport of Scene_Battle. At first the "face window" appeared too early, so I thought: easy enough, just make it not visible initially then call it to be visible when the player can act. What happens? I see an empty window. No face graphic visible. I even tried updating the window whenever Window_ActorCommand was, still nothing.
I did the reverse. Tried making the window visible initially then turn it off right in battle, then turn it on again when I want it. This time, it wouldn't disappear! The thing that really confused me was that by placing @actor_face.visible = @actor_command_window.visible in update of Scene_Battle and having the window visible initially was that it worked. What was preventing it from changing visibility before. More importantly, why was the window visible but content not?
The very same thing was occurring when trying to edit Dargor's Action Order script into a basic enemy list (bwahaha it's probably easier to just do it from scratch), but by removing any changes to visibility of that window in battle, having it visible initially, seems to have made it behave.


Wait a sec, if you've fixed these problems, why the hell are you posting?:
I want to inform people of what occoured and maybe get explanations for why/what happened. Plus the first bug with the "viewports" isn't fixed. I took the lazy route and created an alternate window scheme without the arrows and applied it to problematic windows. I don't really like doing that, even though I've done it so many times before.

If you need any more information, just say. Although I think I've covered pretty much everything I can remember about the bugs (especially the first one/two).
 

poccil

Sponsor

Here's a solution to the first problem.

In Window_BattleMessage, add the following lines of code after setting the window's width and height (assuming the code is within a method in Window_BattleMessage):
Code:
self.contents.dispose if self.contents
self.contents=Bitmap.new([self.width-32,1].max,[self.height-32,1].max)
refresh
The code refreshes the bitmap by disposing the old bitmap and creating a new bitmap that exactly fits the window's new width and height.

I hope this helps.
 

poccil

Sponsor

It is not actually useful to apply that technique to all windows, since some windows (such as lists, where the player must make a choice) depend on the bitmap's size in order to scroll the bitmap and show scroll arrows properly.  This is where scroll arrows are the most useful.
 

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