[SCRIPTING] [RMMV] SHOW TEXT/VARIABLE IN SCRIPT SOLVED

Posts

Pages: 1
I'm trying to make a simulation game, but don't know js. I want to make something where the player can train and gain 2-3 def. I got it work:

var i = Math.randomInt(1)+2;
$gameActors.actor(1).addParam(3,i);

But I want it to tell the player how much DEF he got. So I need to either pass addParam an in-game variable from the database, or have a textbox "You gained \v Defense"
Marrend
Guardian of the Description Thread
21806
I might be wrong about the exact code. However, using the above example, the code might be modified to look...

var i = Math.randomInt(1)+2;
$gameVariables[1].value = i;
$gameActors.actor(1).addParam(3,i);

...something like that. The idea here being that you would use "You gained \v[1] Defense!" via the textbox.
Great, thanks! Yeah, that was what I was looking for. Just wasn't sure how to use game variables in scripts.

EDIT: oh it's actually
$gameVariables.setValue(1,i);

for anyone else who is wondering.
Pages: 1