Having so many switches for each NPC and some being redundant and discovering the power of common events, I wanted to use arrays to move flags for each NPC character.
But, I'm having trouble using the syntax with script calls. I have zero Javascripting experience, but with Python I'm fair so program syntax is not lost on me. I referenced JavaScripts with examples, but this being inside an engine I might be doing something wrong.
I haven't gotten past the basic if $gameVariables.Value(1,[0]) == 0) then $gameSwitch.setValue(1, true)
I can set switches on and off, but cannot for the life of me get if then else statements to work, or if I'm doing the arrays correctly since technically like injecting text into variables using scripts, I'm sort of going outside the normal realm.
The initial string is:
Then basically try a basic if then as such.
Then I just go with Condition in the menus for Switch 1, and it doesn't work.
The other function is a loop, is it wise to put it in script form during a common event call? And would $gameVariables(1.length) retrieve the length of the array.
What is the syntax when I want to let a variable define the index or even the $gameVariable/Switch ?
Thanks,
Jomei
But, I'm having trouble using the syntax with script calls. I have zero Javascripting experience, but with Python I'm fair so program syntax is not lost on me. I referenced JavaScripts with examples, but this being inside an engine I might be doing something wrong.
I haven't gotten past the basic if $gameVariables.Value(1,[0]) == 0) then $gameSwitch.setValue(1, true)
I can set switches on and off, but cannot for the life of me get if then else statements to work, or if I'm doing the arrays correctly since technically like injecting text into variables using scripts, I'm sort of going outside the normal realm.
The initial string is:
JavaScript:
$gameVariables.setValue(1, [1, 0, 0, 0, 0])
Then basically try a basic if then as such.
JavaScript:
If ($gameVariables.Value(1, [0]) == 1) {
$gameSwitches.setValue(1, true);
}
Then I just go with Condition in the menus for Switch 1, and it doesn't work.
The other function is a loop, is it wise to put it in script form during a common event call? And would $gameVariables(1.length) retrieve the length of the array.
What is the syntax when I want to let a variable define the index or even the $gameVariable/Switch ?
Thanks,
Jomei