[RPG MAKER VX ACE] Crash on battle when setting resolution low

For the game I'm creating I'm trying to acheive a very specific look, that of games made with rpgmaker 2000 but I also want to use the scripts and some of the fancier aspects/conveniences of rpgmaker vx ace, so in order to do that I tried to set the resolution to the default resolution of rpgmaker 2000 (320x240) and then upscaling it 2x like 2000 does, but I'm running into a pretty serious snag, when using the code

Graphics.resize_screen(320, 240)In my Main script, I crash with this error when a battle starts:

[IMG]http://i.imgur.com/9YixFjj.png[/IMG]

also, when fullscreened, it's stretched horozontally and i get strange artifacting, is there a way to acheive what I'm aiming for or was it just not meant to be?

Thanks for any responses.
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.

That error message tells you the problem is in the Window_Base script, on line 472.  That line says icons.each_with_index, which tells you that the error message has nothing to do with your Graphics.resize command.

Line 471 says icons is built from the actor's state icons and buff icons.

The NilClass is telling you it didn't find any.

So I'm guessing you have also made a change somewhere to the way states and buffs are saved.  Have you added any other scripts, by any chance?  Are you starting a new game when this happens or continuing from a saved game, and was that saved game originally saved prior to you adding any scripts?
I tested this out on a clean project and it gave me the same error, so no.

[edit]  Also battles do work when I take out the graphics.resize command so I'm sure it's something to do with the resolution.
That's a very strange bug, are you sure you had actors in the party when this bug happened?

Also, it would be nice if you provided us a demo project, with all the same scripts.
Yeah, I think that'd be helpful. If you can zip up your "fresh project" where this also occurs and load it up somewhere, we'll be able to take a look.
Alright, here's the project, The only thing I've done to this is added that command, some land and a monster:

Project2.zip
It crashes because that crappy method to determine how many state icons can be drawn.


It is tied to the width of the state drawing method, and that width will be negative on that low resolution in the battle, which results in getting a 'nil' for the 'icons' local variable in the state drawing method.


Just get rid of the contents of that method (the 2 lines between the 'def draw_actor_icons(actor, x, y, width = 96)' and 'end' lines), and the crash should cease to happen.


Note that this will get rid of the method altogether, so no states will be drawn on any window.


If you want to keep the states on the other scenes, you can add this line at the beginning of the mentioned method:

return if SceneManager.scene_is?(Scene_Battle)If you want to show those icons in battle too, you will have to rewrite the mentioned method to a proper one.
You can also just change a part of that method, this:

[0, width / 24]To something like this:
Code:
[0,2]
The 2 means that only 2 state icons will be drawn.
I have no idea how will you even draw anything on that small screen, but that is yours to figure out, I guess. 😛
Thanks a bunch for the fix, Sixth, though to be completely honest since the thread went quiet for a few days I've worked around the issue and remade everything I was using in Rpgmaker 2000 sprite size and then just doubled the sprite image size and changed the game resolution 640x480 to achieve the a similar look. Pretty underhanded way of getting it done but it works, and seems that it'll be more compatible than what I was trying to do anyways. Hopefully this information can help someone in the future though!

Original thread: https://forums.rpgmakerweb.com/threads/rpg-maker-vx-ace-crash-on-battle-when-setting-resolution-low.45451/