[XP] My Light Switch became a Power Fuse - Help?

Good morning.

Today I decided to go back to work on one of the first projects I began when I purchased RPG Maker XP, a horror game, and I ran into a small problem.

[before we begin, I would like to say I have not used custom script in XP yet. I'm only useful with eventing.]

This is a custom light switch I created myself. Look in the pictures below:

Light Switch 1.pngLight Switch 2.pngLight Switch 3.pngLight Switch 4.pngLight Switch 5.png

In the photos, they contain the events for the light switch. In the last two, they are the result of that light switch. I envisioned turning the light switch off in the bedroom and then leaving into the hallway, finding that light on, and then coming back in the bedroom and finding the light still off. Although, the problem is, this light switch acts as a power fuse box and cuts every light off in the house.

I even also put light switches in all rooms but they contradict each other. [Example: When I left the light off in the bedroom. I walked into the hallway and found the light off in the hallway and turned it on, which in turn, turned on all the lights in the house and in the bedroom.]

Any suggestions or recommendations are appreciated. 😀

Thank you for your time,

Tornado Summoner
I cannot see any problem with your event at the moment since you are using "Self-Switches", but at his moment, I can tell you this:

- You only need two pages for your light switch event, and one self switch.

- On page 2, set "Self-Switch A" to OFF. Page 3 is completely redundant.

- Also, the trigger for page one should be the same as the other triggers (Page 1 is activated through "Player Touch", whereas Page 2 and 3 are activated through "Action Button".

Are the screenshots you posted showing the exact same eventing you made for all the light switches?

Edit:

Wait, I do notice something.

You have to reset your screen tone every time you leave/enter a room.

You can do this by setting up a "parallel process" event, whether by a map event, or a common event.
Yes, I copied and pasted the event to be placed in every single room in the house.

Also, thanks for giving me feedback on how to shorten my Light Switch Event! 😀
You're welcome! ^^

Just to direct you back to my first post, which I had just edited (probably after you started reading it).

If you want each room to have a different light/dark screen tones, it may be better to have a map event with a parallel process trigger, rather than a common event, since you can control separate light/dark screen tones that way. You would need the script call for checking a map event's self-switch. Let me see if I can find out what that is, since you are using RMXP.

Other than that, you may need to use a global switch, instead of a self switch, as a check.
A 'Global' Switch? I've never heard of that before... Do you mean, not the "Control Self-Switches" but the "Control Switches", or is that wrong?
 

Also, thanks for looking into it for me. I'll try to modify my light switch using your feedback and see if it helps.
Yes, you are correct.

Okay, I found the script call for self-switches:

$game_self_switches[[mapID, eventID, 'self_switch']] == true/false

This a sample of how you would use it:

For your light switch event:

Spoiler
7TSJJyy.png


7QfH20C.png
For your map parallel process event:

Spoiler
upGYQ0r.png


In this case, my "map ID" is "1", the "event ID" for the light switch is "2".

True/false stands for ON/OFF.

So it became:

[SIZE=13.63636302948px]$game_self_switches[[1, 2, 'A']] == true[/SIZE]

[SIZE=13.63636302948px]Notes:[/SIZE]

[SIZE=13.63636302948px]- You will need to change map ID and event ID for each map and switch.[/SIZE]

[SIZE=13.63636302948px]- If you have multiple light switches on one map, use || like this :[/SIZE]

[SIZE=13.63636302948px]$game_self_switches[[1, 2, 'A']] == true || [/SIZE][SIZE=13.63636302948px]$game_self_switches[[1, 3, 'A']] == true[/SIZE]

[SIZE=13.63636302948px]Please let me know if you need further clarification.[/SIZE]
Thank you so much for this information. I really appreciate it. 😀

In my case, my event numbers (The Light Switch) is ID:006 and (Parallel Process) is ID:007; These events are in the bedroom. Then, I copied and pasted it into the hallway, the ID numbers turned into (Light Switch) ID:007 and the (Parallel Process) turned into ID:009. Or would you recommend me to create two entirely new events and just paste the eventing in them?

Sorry about that, that question wasn't properly phrased. I'm having a bit of trouble. The switch works in the bedroom, but when I get to the hallway, it does nothing. I'll continue to try and work it out.

Do I have to copy the Parallel Process into each room as well?
Copy and pasting events would not be a problem.

You just need to adjust your script call for every map.

Following your example.

Bedroom map:

Spoiler
Bedroom map ID is 14 (example).

Light switch event ID is 6.

Self switch for event ID 6 is 'A' (example).

Parallel process event is irrelevant since we are not going to reference that.

Your script call in your 'Parallel Process' event's conditional branch would be:

$game_self_switches[[14, 6, 'A']] == true

Hallway map:

Spoiler
Bedroom map ID is 21 (example).

Light switch event ID is 7.

Self switch for event ID 7 is 'C' (example).

[SIZE=13.63636302948px]Parallel process event is irrelevant since we are not going to reference that.[/SIZE]

[SIZE=13.63636302948px]Your script call in your 'Parallel Process' event's conditional branch would be:[/SIZE]

$game_self_switches[[21, 7, 'C']] == true

Extra map:



Let's say you have 2 light switches in a map.

Map ID is 25 (example).

Light switch one event ID is 3 (example).

Light switch two event ID is 11 (example).

Self switch for both events are 'A' (example).

[SIZE=13.63636302948px]Parallel process event is irrelevant since we are not going to reference that.[/SIZE]

[SIZE=13.63636302948px]Your script call in your 'Parallel Process' event's conditional branch would be:[/SIZE]

$game_self_switches[[25, 3, 'A']] == true || $game_self_switches[[25, 11, 'A']] == true



Hope this helps. ^^

Please let me know if you need further clarification.
OK, I finally got the bedroom switch to work. [When I turn it off and leave and come back, it's still off/and when I leave the room and its off and go into the hallway, the hallway light is on. That works. Thanks! 😀 ] Although, the problem I was having, it was a fault on my part. (On both pages of the Light Switch: I left Self Switch A on Twice. Forgot to turn it off). Now, I must configure the hallway to do the same.

[Thank you for the above post. It really helped me figure out what was going on with the self-switch problem.] 😀
You are most welcome! ^^

Oh, and I just saw your edit.

Yes, you have to copy the parallel process onto every map.

Just as a side note, the reason why I did not ask you to use a "Parallel Process" common event, is because it can get a little problematic, since you are adjust the screen tone for each individual map. Common event has a lot of uses, but for this screen tone event, I would not recommend using it.
I'm running into some syntax script errors and having a glitch where pressing the enter button to access "New Game" is inaccessible. I'll update this post whenever something happens...
Double check your script calls again in your editor. Most likely you are missing something somewhere, a ' or ] or [.

Having just one light switch per map is better, since you are dealing with an entire map's screen tone, rather than isolated areas.
OK. I finally got it to work. Thank you SO much for sticking around and helping me with it. I took long because my computer had froze a moment ago (unrelated to RMXP) and I had to redo part of what I did.

I had messed up through a lot of the steps: Putting on wrong switches, forgetting letters and numbers in scripts, etc. but now, I finally fixed everything and everything works now. Thanks for all your help. 😀

Sorry it took so long though. You gave me simple instructions and I had failed to perform it correctly.

I can put you in the credits of the game if you wish. 🙂

Thanks a million,

- Tornado Summoner
You are welcome! I'm glad that it all worked out for you in the end.

And don't worry about it, it happens to the best of us, especially when it's something new. ^^

No need to put me in the credits. I'm just glad that you managed to get it working. It's been a pleasure working with you. ^^

Good luck with your project! ^^
Thanks! Also good luck with your game endeavors as well! 😀

Have a good day!
- Tornado Summoner

Original thread: https://forums.rpgmakerweb.com/threads/xp-my-light-switch-became-a-power-fuse-help.36041/