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.

Live variable update display

I am trying to recreate a virtual enviroment for virtual creatures and I require a simple window on the map that displays variables 1 and 2 on top of each other and refreshes constantly so it will change when the variables change.
Thanks to anyone who does this.
 

poccil

Sponsor

I've already made something like this;  see this post:

http://www.rmxp.org/forums/index.php?topic=31931.msg320375#msg320375

The function to display the variables the way you want is:

Code:
def displayVariables(display,param)
 return $game_variables[1].inspect+" / "+$game_variables[2].inspect
end

Example for displaying the variables:

Code:
#Displays window 0 with X of 200 and Y of 100
showVarDisplay(0,200,100)
setVarDisplayUpdate(0,"displayVariables")
 

poccil

Sponsor

Then let me explain.

In the link just mentioned above [ http://www.rmxp.org/forums/http://dev.r ... 75#p320375 ], copy the
first big block of code there to a new script section (just before the last one).

Notice the top of the code found there.  It contains options you can set to change the appearance
of the display such as font, size, color, and picture of the display.

Then add the following code to the bottom of the script section just created:
Code:
def displayVariables(display,param)
 return $game_variables[1].inspect+" / "+$game_variables[2].inspect
end
To display the variables, use the code below in a Script event command:
Code:
#Displays window 0 with X of 200
#and Y of 100
showVarDisplay(0,200,100)
setVarDisplayUpdate(0,
  "displayVariables")
 

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