I would slightly change
@Shaz example to still being able to turn candles on or off at nighttime:
Its not the cleanest way but it works.
page 1, no conditions, candle is off, event commands turn on self switch A
page 2, conditioned by self switch A, candle is on, event commands turn off self switch A
page 3, conditioned by a global switch1, no Eventgraphic or candle off, event on parallel, event commmands:
Conditional Branch global switch2 is OFF (This Switch determines if all candles go out or on)
yes: Turn Self Switch A off, Wait 8 Frames (The Wait is to stop this Eventpage from repeating, before the Page condition will be turned off again in another Event)
else: Turn Self Switch A on, Wait 8 Frames
In the Event that changes all candles to On or Off(i assume in your Inn Bed), you insert this:
Turn Global Switch2 to On or Off (On = All candles turn On, Off = All candles turn Off)
Turn Global Switch1 to On (Now third Eventpage of all Candles is running)
Wait 4
Turn Global Switch1 to Off (3rd Page off all candles is turned off again, but they had time to execute the code)
Alternativly you could use a Script Line in the Event command that is called Script to manipulate a Self Switch of another Event:
This turns Self Switch A of Event 1 , 2 and 3 on this Map to On.
$gameSelfSwitches.setValue([$gameMap.mapId(), 1, 'A'], true)
$gameSelfSwitches.setValue([$gameMap.mapId(), 2, 'A'], true)
$gameSelfSwitches.setValue([$gameMap.mapId(), 3, 'A'], true)
This turns them Off again:
$gameSelfSwitches.setValue([$gameMap.mapId(), 1, 'A'], false)
$gameSelfSwitches.setValue([$gameMap.mapId(), 2, 'A'], false)
$gameSelfSwitches.setValue([$gameMap.mapId(), 3, 'A'], false)
Eventcommand Script on Command Page 3 and in many Eventcommands is helpfull to make the Editor more flexible to use. This list helped me:
This Script Call list applies to both RPG Maker MV and RPG Maker MZ. Link here to see the entire list. Supplementary Material for RPG Maker MZ: https://forums.rpgmakerweb.com/index.php?threads/rpg-maker-mz-script-call-reference.122501/ Have fun eventing~
forums.rpgmakerweb.com
No Plugins needed for this.
EDIT:
I forgot about the most simple solution:
If you have 10 Candles, you can use 10 different Global Switches for them. 1 for each of them.
Than it is also easy to turn all of them On or Off.