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.

[Resolved] Variables & Scripts: Possible?

Status
Not open for further replies.
Is it possible to refer to variables within a script? The kind of variables I mean are the ones that are usually used with events. The thing is I'm an eventer, not a scripter and I'm using variables for my custom health, fatigue, and other systems which need to be utilised in a battle. Now, I could make a battle system with events, but it would be much better if it could be done with scripting.
I just need to know this info before I either download a CBS or request one.
Thank you!:)
 

ccoa

Member

When typing in the variable id, do not use the leading 0's. For example, Variable 0001 should be accessed as:

$game_variables[1]

Numbers starting with a 0 are read by the Ruby interpreter as octals, which can produce some interesting bugs once you get beyond 08. For example, 025 is 21 in base 10.
 
Status
Not open for further replies.

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