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.

Scripts and ingame variables

I have a quick question about variables.
is there a way to access variables from a script
lets say for example i want to make a Window and within that window i want to have a certain number of buttons (list of buttons), but how many buttons is determined by the variable 0001:Example.

OR

a script that would take three variables (from the list of ingame variables) and find the smallest one
note: i know the basics of ruby and i know how to find the smallest of three numbers, so all i need to know if it is possible to pass variables from the game into a script and then return value from a script into a ingame variable

little diagram:

ingame variable[1] > script > [process the variable] > ingame variable[2]

thank in advance
 
i'm not sure what you are looking for. BUT.

$game_variables[id] = $game_variables[id]

where id, is the vairbales id, so 1, or 54, or 1004 etc..
will make the two variables equal.


yeah, its possable to move a variable to the script and back again. you just need the specific command.
Could you explain a little further?
 
thanks, that was enough to solve my problem, all i needed was a way to move variables to the script so i could multiply, divide, add and do other stuff with them,

thanks AceJP
 

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