NilClass, FalseClass, and TrueClass

The three most vital classes in RGSS3 are NilClass, TrueClass, and FalseClass.

NilClass:

NilClass is the class for the nil value. Any undefined variable is nil until specified. When every you get “undefined method for nil NilClass” it means the variable you are trying to modify is nil. Nil can only be used when testing conditions(returning false), determining when an item is nil (nil?), or (under rare cercumstances) converted to another class(Array, Float, Integer, or String). NilClass does absolutly nothing as is a source of most if not all undefined method errors.

FalseClass is used by the term false and is used only to test weather a condition is true and will always return false.

NilClass and FalseClass are the only two times a class alone will return false.

TrueClass is for the true condition and will always return true. All other objects will return true as well, but you will see alot of true being used in scripts, especially in script settings.

For more information please look at the help file provided with Ace.

Advertisements
Categories: Scripting Basics | Leave a comment

Post navigation

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: