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

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 29
RMRK Junior
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.
« Last Edit: February 06, 2016, 12:10:30 AM by VianoceGames »

***
Rep:
Level 29
RMRK Junior
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.

*
i am satin die lol
Rep:
Level 96
welcom to hel
GIAW 14: 2nd Place (Hard Mode)2013 Biggest Drama Whore2013 Zero to HeroParticipant - GIAW 11Secret Santa 2013 ParticipantFor taking arms in the name of your breakfast.
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

***
Rep:
Level 29
RMRK Junior
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:

**
Rep:
Level 16
HF GL
thanks that a good tutorial ! :D