How to make a simple candle turn on and off?

Hayden

Veteran
Veteran
Joined
Jan 14, 2018
Messages
142
Reaction score
20
First Language
English
Primarily Uses
RMMV
This is real basic event stuff, I'm sure, but I just can't remember how to set it up.

I've got candle events that I want the player to be able to walk up and turn on and off.

I can't use a switch because it'll turn off all the other candles.

Is there a way to do this with only two pages?

EDIT: I realized you can just turn on and off a self switch. That's easy enough, but what about if I want all the lights to turn on. Is there a way to do that? Let's say its day time and the player goes to sleep in a bed. I'd like them to then wake up with all the candles set to on.
 
Last edited:

Mrs_Allykat

Failsauce
Veteran
Joined
Oct 13, 2017
Messages
484
Reaction score
2,060
First Language
English
Primarily Uses
RMMV
You can easily control multiple events on a map using "OuterSelfSwitch" a plugin that comes packaged with MV. There are other plugins that do the same ( I even have one around here myself...)

F.EX.: OuterSelfSwitch on 9 A

What you'll really want to do is make the decision of what your priority of on-vs-off is. You could use multiple switches and a self switch too. I would probably stick to self-switches, and use whatever is set to make the game-time go from day to night activate the different candles in the room. Then, if the player activates the candle it will turn it off or on.
 

V_Aero

Veteran
Veteran
Joined
Apr 23, 2019
Messages
199
Reaction score
147
First Language
german
Primarily Uses
RMMV
You dont need a plugin. Start with the Self Switches. Then, if you want to make a global condition which overrides the state of the candle, lets say day, then make a new event tab with a global switch as condition. The event tab with highest priority(3) is shown, regardless of what the Self Switch on tab(2) is
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,147
Reaction score
12,420
First Language
English
Primarily Uses
RMMV
That's what I'd do -
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 switch, candle is on, no event commands (assuming you want to force the candles to all be on at night time)

Then when it becomes day time again (global switch is off), the candles will revert to on/off - whatever they were the last time the player actively changed them.
 

fizzly

Veteran
Veteran
Joined
Mar 23, 2012
Messages
597
Reaction score
368
First Language
Polish
Primarily Uses
RMMV
The simplest way without using a script/script comands would be to create page 3 for every candle with switch "all candles" on.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,350
Reaction score
333
First Language
German
Primarily Uses
RMMV
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:
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.
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Let's purchase th... WAIT! Just in time ehehehe.
Excited with the idea of a new maker, but I imagine I'll probably be disappointed.
super disappointed there will be a new RPG Maker without the current one being "finished"(we all know it wont get any more updates)
That's cool there's a new version coming. But I can't leave MV now. I think I'm just starting to get the hang of it.

Forum statistics

Threads
98,142
Messages
949,666
Members
129,429
Latest member
daagmilk
Top