Light switch Graphic Change?

valasek

Warper
Member
Joined
Jan 8, 2014
Messages
2
Reaction score
0
First Language
English
Primarily Uses
I have a lighting event set up wherein you interact with a switch on the wall and it gives you a choice (On / Off); the choice you make affects the lighting accordingly. Okay, a light switch. Simple enough. I am using a switch sprite (or graphic), however I can not get it to switch from "every time the action button is pressed" to "only when the choice is made" - i.e. light is on, switch is up and vice-versa.

The switch starts out in the "off" position - makes sense since you start off in a darkened room. When you interact with the switch it gives you the aforementioned On / Off option. Okay... everything is set up correctly, however every time you interact with the switch, it moves anyway, hence it's always going to be in the "off" position - first press moves the sprite to where the "on" position should be and brings up the choice box, second press takes it back down regardless of your choice. I don't know why I can't figure this out, really. I just need it to toggle back and forth depending on your choice.

Sorry if I worded this horribly, still a bit flustered from working this out for an unforgivable amount of time...
 

Sharm

Pixel Tile Artist
Veteran
Joined
Nov 15, 2012
Messages
12,760
Reaction score
10,884
First Language
English
Primarily Uses
N/A
Could you show a screencap of your code? It's kind of hard to see the problem without seeing the actual code. My guess is that you've got the image change outside of the conditional branch but I'm not a code person. Seems like an odd way to do it anyway. When I walk up to a switch and click on it I'm intending to flip it, not think about it first.
 

MasterLagger

Odder than Odd
Veteran
Joined
Dec 28, 2013
Messages
58
Reaction score
5
First Language
English
Primarily Uses
I know what he's talking about (I think) This situation would be an event something like this:

Show Choices (ON, OFF)

when ON

Screen Tint (Normal)

Set Move Route: Change Graphic to Light Switch (ON position)

Exit Event Process

when OFF

Screen Tint (Dark)

Set Move Route: Change Graphic to Light Switch (OFF position)

Exit Event Process

This is how I'd do it (if it works). Set Move Route will help you with your graphic changing problem.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
set direction fix to true
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You don't want to exit event process and use a move route to change the graphic - when you leave the room and come back, they'll be back to their original state.


When you turn the light switch on, also turn on a REAL switch. Then add a second page conditioned by that switch, with the switch sprite in the ON position. If you want to, give it an option to turn the light back OFF again, and that option will turn the REAL switch off.
 

MasterLagger

Odder than Odd
Veteran
Joined
Dec 28, 2013
Messages
58
Reaction score
5
First Language
English
Primarily Uses
You don't want to exit event process and use a move route to change the graphic - when you leave the room and come back, they'll be back to their original state.

When you turn the light switch on, also turn on a REAL switch. Then add a second page conditioned by that switch, with the switch sprite in the ON position. If you want to, give it an option to turn the light back OFF again, and that option will turn the REAL switch off.
Oh yeah, I completely forgot about leaving a map. Forget what I mentioned.
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,050
Members
137,571
Latest member
grr
Top