Hello, is there anybody out there who can help me with the following script to match how Yanfly selfswitch does it?
I get a undefined x console error with this running, and its probably because yanfly changed how to call selfswitches?
im lost.
this is current code:
var key = [$gameMap._mapId,myCounter, 'C'];
$gameSelfSwitches.setValue(key, true);
Yanfly plugin says this: this.setSelfSwitchValue(mapId, eventId, switchId, true)
But I dunno how to combine this.
Instead of saying "I get a undefined x console error", please post an actual screenshot of the console, so we can see the exact error message (I don't know if it really says x or if you've just put that in there to avoid typing the whole thing) as well as the line that triggered it.
Why are you using a script call instead of a plugin command? Why aren't you just setting it up as a self switch and using Control Switches to change it?
What is myCounter? Is it the event id, or the self switch id? Where is the other one?
Please show a screenshot of your whole event - again so we can see exactly what you have, because you haven't provided enough to figure out what you're trying to do, and the bit you have provided obviously isn't right or you wouldn't be getting an error.
Moved to: Javascript/Plugin Support
Please edit your post to include a link to the web page where you got the relevent plugin(s). That way, if people need to check something before offering advice they don't have to go hunting.
Thanks.
That is just a plain self switch on an event. Nothing to do with the plugin. And the error message does not point to anything about the self switch commands.
It says x is undefined. Look at where you have used x. It's in determining the location of the events.
This is likely caused by you trying to access an event that's been erased. Either via an Erase Event command, or via putting it there in the editor, putting in more events, then deleting that one. It does not have an x property or a y property, because it does not exist.
Shaz, thank you! Now i know where to look! 😀 Really appreciated