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.

Tables?

The table class is another version of multi-dimensioned arrays for numbers.

You use it very similar to a multi-dimensioned array. It isn't highly used, as arrays work fine, but it is used a lot in the map handeling like the tile ids and such.

(Enforces my idea that the scripts were wrote by several authors as this is very differently done than other things. You can also just look at the interpreter methods and the difference in parameter setup for proof of this.)
 

Aran

Member

But Tables are completely new to me. could you give me an example of how I'd use it, because since you mentioned it's good for handling id's (which is what i'm trying to do) i'd really like to know
EDIT: is Table even one of Ruby's default classes?
 
No. It is specifically a RGSS class.

The Help File (why does no one use this...)":2x4gxwz6 said:
Table
The multidimensional array class. Each element takes up 2 signed bytes, ranging from -32,768 to 32,767.

Ruby's Array class does not run efficiently when handling large amounts of data, hence the inclusion of this class.

SuperclassObject
Class MethodTable.new(xsize[, ysize[, zsize]])
Creates a Table object. Specifies the size of each dimension in the multidimensional array. 1-, 2-, and 3-dimensional arrays are possible. Arrays with no parameters are also permitted.

Methodsresize(xsize[, ysize[, zsize]])
Change the size of the array. All data from before the size change is retained.

xsize
ysize
zsize
Gets the sizes of each of the array's dimensions.

Propertiesself 
 
 
table is to array as man is to male human.

in other words, they are the same thing, just different name.

A rose by any other name would still prick your finger....

EDIT: or rather it is a
multidimensional array class
It is an array that holds more than a normal array???

table is to array as cardboard box is to cardboard sheet?

Nevermind, I don't really know. that's just what I'm getting from Sephirothspawn's answer.
 
Basically yes. You can check the Method & Class Library as Selwyn actually recreated this class himself. It is not really a specialized array. It is specialized class that holds information similar to an array.

I can't really tell you how to use it (I could, but it is a long boring process). You are better off really just using arrays until you get the full hang of them.
 

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