[Finished] [RGSS] RGSSError

Started by Blizzard, March 26, 2011, 10:05:26 am

Previous topic - Next topic

Blizzard

March 26, 2011, 10:05:26 am Last Edit: September 10, 2011, 03:26:53 am by Blizzard
RGSSError




Description

Where is the RGSSError class used? This question seems simple but finding all the places is not easy.



Priority

Low.



Prerequisites

None.



Assigned

ForeverZer0



Everything else

Just find out where it is used, we only need a list of all uses for now.
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.

ForeverZer0

Damn, I never even thought about that. The only instances I know of off-hand are when attempting to access a disposed Bitmap, Viewport, or Sprite. It looks like I'm going to go try to throw some errors now...
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

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.

ForeverZer0

Well, after some extensive testing and searching google, I believe I have a complete list of what throws an RGSSError. It's is pretty much what you would expect, but here it is in summary:

An invocation of an instance method or attempted reference to a variable of Viewport, Bitmap, Sprite, Tilemap, or Window after they have been disposed.

There are couple of exceptions:

  • The "disposed?" method of each of these classes will always be safe to call.

  • The Sprite class will still be able to make references with the "bitmap" method, though trying to set the bitmap with "bitmap=" will still throw the error.

  • The "autotiles" of the Tilemap class is still safe.



One last occurrence of RGSSError is if you initialize an instance of the Bitmap class with a width/height less than 1.
Strangely enough, Viewports and Rects can be initialized using negative values for width and height without a problem, which I personally didn't know before. I really don't see the use, but it is possible.

Anyways, unless anyone sees can think of something I overlooked, I would call this task complete.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Blizzard

Quote from: ForeverZer0 on March 27, 2011, 12:28:17 am
Strangely enough, Viewports and Rects can be initialized using negative values for width and height without a problem, which I personally didn't know before. I really don't see the use, but it is possible.


I didn't know that either. Well, if it is possible, then we will leave it like that.

Quote from: ForeverZer0 on March 27, 2011, 12:28:17 am
One last occurrence of RGSSError is if you initialize an instance of the Bitmap class with a width/height less than 1.


I think you can get one as well if you initialize Window with width/height less than 33.
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.

ForeverZer0

No, you can create a window with negative values for width and height, as well (I went and tested to be sure). I believe the width and height of the window are simply used to set its viewport, which apparently doesn't care what its set to. This executed without any complaints:

window = Window_Base.new(0, 0, 4, -3)
window.contents = Bitmap.new(1, 7)


You will still get the error if you set the contents width/height values less than one, since it is a Bitmap, but it seems that it is a little more flexible than I first thought when it comes to what throws an error. The 32 pixel border is really just a convention in RGSS, I have actually deviated from it in a couple of scripts. Zer0 CMS actually uses a border of 24 pixels if I remember correctly. I personally always disliked the standard large font and large border, so when I made my own I kept it a little smaller.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Blizzard

One last question. Are there any specific error messages? If yes, which ones (e.g. for the bitmap with width/height less than 1)?
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.

ForeverZer0

Just a "failed to create bitmap" message that I'm sure you've seen before for the bitmap.

Everything else just gives a generic "disposed <CLASS NAME>" message.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.