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.

accessing and storing variables

Scripting noob here, so please be a little easy on me.

What I want to do, is to let rmxp calculate a formula with the variables stored in variables from events. The solution of said formula should be stored in a variable that can be accessed through the event window again.

So the question is: How do I acces variables through rgss?
And how would I store the solution inside a normal variable?

Thank you for your help

~Dalton~
 
Why? You can do your calculation inside an event: +,-,*,/, mod.
Do you need to calculate a root or x square, or something?
Anyway, in a script, variable 3 is
$game_variables[3]
So, you can do:
$game_variables[3] = $game_variables[2] * $game_variables[4]
 
Ah thank you very much.

Lets just say it would get rather complicated to do all the calculation inside events, since it would use about 5 variables, random variables, squares... wich would be a hassle to do with events.
Thank you again, this helps me out of quite some problem.
 

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