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.

A calculation with a script

How can I operate game variables using not the variable command but using the script command in the third page of events command?
 
Code:
$game_variables[[I]id[/I]] [U]modifier[/U] [B]value[/B]
id is the variable id
modifier is an operator follwed by an equals sign. +=, -=, *=, /=, %=, or just plain =
value is self explanitory
 
Correct, those should work. Also if you simply want to add to a variable or multiply it by something, you can do what Yeyinde suggested and do something like:

Code:
$game_variables[8] += 10
(Adds 10 to game variable 8)
 

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