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.

How To Assign Types of Variables?

Okay, I know a bit about programming but am fairly new to RGSS. I know all about variables (global, temporary, local etc.), but I don't know how to assign different variable types in RGSS.
I know a few of them, but I would appreciate if someone could just list them so I don't have to spend several minutes using the search button on this site when I'm scripting :lol:

Basically what i mean is... $ = global
                                  + = temporary
                                  ^ = local
(i'm just using the + and ^ as placeholders since I am quite clueless)

Call me a dumbass if you will...  :wink:

Thanks,
RM
 
Thanks ALord, yeah i sort of figured that @ was local (since those are the only one's I'm using so far and it's not crashing)
Are these the only two types? (i mean excluding booleans, integer,strings etc... Since they can all be created with $ or @)
 
@ is not local.  @ is instance.

$global
@@class (static)
@instance
local

Also, Ruby (RGSS) is a dynamic language.  You don't need to tell it what kind of type a variable uses.
 
Yeyinde":2yw2d7bh said:
@ is not local.  @ is instance.

$global
@@class (static)
@instance
local
Thanks a heap! Appreciate it.

Yeyinde":2yw2d7bh said:
Also, Ruby (RGSS) is a dynamic language.  You don't need to tell it what kind of type a variable uses.
I tried to say that in my last post, but thanks for explaining it better.

MODS: Enjoy the lock-fest!
 

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