So I have made an event where the player can turn a lamp on and off and it will switch between two sprites. This event is triggered by Player Action. I have a separate event where when the player finds an item the lamp light surges and goes out. The one thing I cannot figure out is how to switch the sprite back to off if the lamp is triggered by the Player.
Is there a script call to erase an event? If I can erase the event in a separate parallel event it will solve my problem, I think.
I assume you use a switch or self switch to control the lamp's on/off state, correct? If so, just use a script call to manipulate it from the other event.
If the lamp is using a switch, use the following script call:
$gameSwitches.setValue(num, true/false).
If the lamp is using a self switch, use this script call:
$gameSelfSwitches.setValue([mapId, eventId, self switch], value)
Some bonuses to throw in for you:
1) that script to remotely change an events script call is really valuable. I'd keep that one in mind as it can be used in many different settings.
2) if you are changing a sprite, you could keep put the turned on lamp and the turned off lamp on the same sprite sheet.
Enabling direction fix will prevent it from changing when the player interacts with it.
Then use a move route: (event),
Direction fix off
Turn (direction the "off" lamp is set to on the sprite sheet)
Direction fix on
This would accomplish the same thing visually as having 2 event pages and switching between them with a self switch.
Good luck with your game make!
This thread is closed due to being solved. If you need it reopened, let us know. Thank you!