The RPG Maker Resource Kit

RMRK RPG Maker Creation => MV => Topic started by: VianoceGames on February 05, 2016, 10:38:18 PM

Title: [Resolved]Storing text to game variables to use in text
Post by: VianoceGames on February 05, 2016, 10:38:18 PM
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.
Title: Re: [Help]Storing text to game variables to use in text
Post by: VianoceGames on February 06, 2016, 12:09:15 AM
I found a great link for a list of script calls which I will share here: RMMV Script Calls. (https://docs.google.com/spreadsheets/d/1-Oa0cRGpjC8L5JO8vdMwOaYMKO75dtfKDOetnvh7OHs/edit#gid=0) 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.
Title: Re: [Resolved]Storing text to game variables to use in text
Post by: &&&&&&&&&&&&& 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
Title: Re: [Resolved]Storing text to game variables to use in text
Post by: VianoceGames on February 06, 2016, 12:36:05 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:
Title: Re: [Resolved]Storing text to game variables to use in text
Post by: facembani2232 on May 09, 2016, 04:56:46 PM
thanks that a good tutorial ! :D