The short version. Im screwing around with a script where I have to set some of the variables by the script.
player.variable = 1 as an Event Script. How do I set a Game Variable to that value? I tried player.variable = $game_variables
- where X is the ID of the Game Variable. \v[99] also only works for displaying that as text as far as I can tell...
$game_variables[VARIABLE_ID] = VALUE
Quote from: ForeverZero on June 06, 2011, 02:33:28 AM
$game_variables[VARIABLE_ID] = VALUE
Thats what I thought. I just want to temporarily override what I am calling a user defined variable...
message.text_speed = $game_variables[99]
I doubt this has anything to do with it, but the script window keeps putting the [99] on a new line. When I try to run it, I get:
QuoteScript 'Multiple Message Windows SDK' line 1176: NoMethodError occured.
Undefined Method `-' for #<Game_Variables: 0xSomeCrap @data=[]>
/scratches_head
Common problem with using the Script... call under Advanced.
Each line is separately processed as its own line. Try something like:
var = $game_variables[99]
message.text_speed = var
Shortening the line length by creating variables with smaller names is pretty much the quick and easy (probably the only) way to deal with that issue.
So if the script doesn't all fit on the same line, it doesn't compile the variable or class names the same way? Like its inserting a \r or \n character between $var
- and $var\n
- are not the same?
Thats one Goofy bug but thanks for letting me know!
Only for the Event based Script called (under the Advanced section of the Event Commands list).
If you mean in the actual scripts database section, there shouldn't be any issue regarding how long each line is, as long as each line is its own statement (this isn't completely true, but for simplicity's sake it's a good thing to follow).
Quote from: LoganForrests on June 06, 2011, 11:54:02 AM
Only for the Event based Script called (under the Advanced section of the Event Commands list).
If you mean in the actual scripts database section, there shouldn't be any issue regarding how long each line is, as long as each line is its own statement (this isn't completely true, but for simplicity's sake it's a good thing to follow).
It was an Event Based Script...
You can also escape the line-feed character that the editor puts in for you...
message.text_speed = \
$game_variables[99]
just make sure there are no spaces after the backslash