Main Menu
  • Welcome to The RPG Maker Resource Kit.

[Resolved]Storing text to game variables to use in text

Started by VianoceGames, February 05, 2016, 10:38:18 PM

0 Members and 1 Guest are viewing this topic.

VianoceGames

In VXA I could do a script call saying something like:
$game_variables[1] = "Hello"
$game_variables[2] = "World"

Then I could call those variables in a message box like:
\V[1] \V[2]

and it would come out "Hello World".

I have no idea how I would do this with js in the MV version. Any help would be greatly appreciated.

VianoceGames

I found a great link for a list of script calls which I will share here: RMMV Script Calls. Below is the call I was looking for.

$gameVariables.setValue(var, value);

Where you see the abbreviation "var" you put the number of the variable you wish to store the text (or string). Then where you see "value" is where you place the text. Make sure you put quotation marks around the text in the "value" part or it will run an error.

So it should read something like:
$gameVariables.setValue(1, "Hello World");

Using the variable hasn't changed, thankfully.

&&&&&&&&&&&&&

Thank you for sharing the answer. :)
Anybody interested in learning a bit of JS can also check this out - https://www.codecademy.com/learn/javascript
&&&&&&&&&&&&&&&&

VianoceGames

Quote from: boe on February 06, 2016, 12:20:31 AM
Thank you for sharing the answer. :)
Anybody interested in learning a bit of JS can also check this out - https://www.codecademy.com/learn/javascript

Thanks boe, I'll be checking that link out soon! :blizj:

facembani2232