For switches: $gameSwitches.value(x) == true
For variables: $gameVariables.value(x) == n
Whoa nice2, tried it out and works well with the plugin. Thank you!
I just found this... and realized that what you are describing i am already trying...
Can this code be used in a plugin's "scene" and still affect the game-at-large?
I can't get, in my case, switch 20 to set to true (or false) ... and when i Use the console, i can put the same command and it works
example :
$gameSwitches.setValue(20, true); won't work in my script (everything else functions beautifully and fully, and no error is provided in the console log)
but
the same command in the console command section will set switch 20 to true, like i'd expect
$gameSwitches should be accessible anywhere because it's global. Try putting a console.log("stuff here") directly above or below your $gameSwitches.setvalue() to make sure it's even being reached in the first place. If nothing shows up in the console after that, then you found your problem.
I'll try that to make sure... but what i meant when i said that everything else is performing beautifully is that the other pieces in the same scope (immediately above and below) are being performed without error.
however, I would be stupid to not try and see if this shows off something i didn't expect... I'll update this when i have tried, thanks So MUCH for helping!
Thanks .... i DID put your thing in there...
and, it did get there...
I chose top make my "console.log" useful, so i dumped the variable i was attempting to set into the console, along with some text...
that's when i realized i had a misstep somewhere in "what switch i was using"..... which feels really dumb...
without your help in making me rethink what i was doing, i would have just beat my head against a wall, so THANKS
This is my code snippet that showed me that i had the wrong number... you were right, it was working the whole time
if (wincondition) {
this._log.setText(victoryText[0], victoryText[1]);
console.log(pnum("Win Switch Number"));
$gameSwitches.setValue(pnum("Win Switch Number"), true);
console.log("This is after Win Switch Number");
justWon=true;
if (actorChoiceId) {
$gameActors._data[actorChoiceId].gainExp(100);
}