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.

Quick Question about calling scripts

Status
Not open for further replies.
I know how to call a script with events, but how could i change a value in a script from an event? I realise that this is probabaly incredibly simple, but i have never come across it until now.
 
Assuming the value is a variable you could create a method to change the variable and use a call script. Alternately, if the variable is in Game_System (or any other class with a global variable for it) and it has an attr_accessor or attr_writer method for it you can use:
Code:
$game_system.(variable name) = value
to change the variable's value.
 
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