RPG Maker MZ

RPG Maker MZ

Sir Cobalt Aug 28, 2023 @ 11:23am
Turning switch on or off freezes game (sort of)
I have this switch set up to change the weather based on whether or not the player is indoors. It's literally the simplest common event ever, if switch is on then the rain stops, if it is off then it starts raining again. Each door that leads into an indoor location is programmed to turn the switch on and when the player leaves through interior doors they turn the switch off.

I quickly found out that messing with the switch in any way whatsoever completely freezes the game, the game still fades in from black and the music and background ambience still plays and the location name still appears in the top left corner and disappears but I can't move my character, I can't access the pause menu and the inventory icon has disappeared. The player is already set to spawn outside so I figured I'd play test the feature by entering an interior and just walking out again to trigger the rain. Walking into an indoor location froze the game, I removed the switch functionality from one of the doors and entering through it didn't result in a freeze. I tried running an event that was set to autorun to trigger the switch off as soon as the game starts and lo and behold, as soon as I click new game it freezes. I can't do anything with the switch or it breaks the game.

I tried setting the event type to parallel as it was autorun previously but that did nothing. It is literally the simplest design and it doesn't work at all and it's very frustrating. Thank you for any assistance or information you can provide in advance.
Last edited by Sir Cobalt; Aug 28, 2023 @ 1:19pm
< >
Showing 1-6 of 6 comments
Parsnip Aug 28, 2023 @ 1:11pm 
Auto-run events run in a loop. They also disallow other events, movement and even player input when running. Changing them to Parallel Process should fix your problem, but make sure all the events that are running to apply weather effects, check the switch, etc. are set to Parallel Process. That includes all the pages in said events. A single Auto-run event stuck on loop will freeze the game like such.
Sir Cobalt Aug 28, 2023 @ 1:28pm 
Ah I just edited out that section because it's stupid to complain about these things on a public forum, I was annoyed and wasn't thinking straight. Thanks for your responses, after I changed it to parallel it didn't occur to me to test the doors. It doesn't freeze player input anymore now but the weather effect isn't working.
Parsnip Aug 28, 2023 @ 9:38pm 
Originally posted by Sir Cobalt:
Ah I just edited out that section because it's stupid to complain about these things on a public forum, I was annoyed and wasn't thinking straight.

Just deleted my second response in case you didn't want that part to be visible.

Originally posted by Sir Cobalt:
after I changed it to parallel it didn't occur to me to test the doors. It doesn't freeze player input anymore now but the weather effect isn't working.

Is your event that calls the weather effect a Common Event? For some reason they always have to be tied to a switch, so they won't run unless the selected switch above is on. My workaround for that was that I made a Switched named "always on" and select that one for any Common Event that I want to run always, and at the map the player starts in, there's an event that turns the switch on.
Last edited by Parsnip; Aug 30, 2023 @ 9:32am
Zarmandis Aug 29, 2023 @ 12:33am 
May be you can try by using a variable instead of a common event:
Doors entering houses--- variable rain set on value=0 no rain.
Doors going outdoors--- variable rain set on value=1 rains.
Sir Cobalt Aug 29, 2023 @ 6:08am 
Yes it is a common event and I have used a switch. It's written is as such:

If : PlayerIndoors is OFF
Set Weather Effect : Rain, 5, 1 frame

: Else
Set Weather Effect : None, 1 frame (wait)

: End

I don't know how to make it controlled by a variable, I'm not particularly familiar with using them here.
Zarmandis Aug 30, 2023 @ 2:17am 
I made up myself to test it and it works the setting of the weather:
0-Create a variable called for example "weather on off".
1-Create an event trigger "parallel" outside the houses (in the city, town, forest, etc).
2-In that event create a conditional branch. Click also "create an else branch".
3-Click on variable*, select variable called "weather on off", click constant, value=0 and click below "create else branch" and then ok.
4-Inside the if: event commands, page 2, set weather effect, type rain, very important: Time to 1 frame, unclick wait for completition.
5-In the else branch select "set weather effect none".

*Note: In the conditional branch you may find the variable control on the second position in number 1.

Now you have the weather and you need to change it while going indoors and outdoors.
Inside houses: In the event transfer you need to add "control variables" and set to 0.
Doors leading to inside houses: In the event transfer you need to add "control variables" and set to 1.
Important use always "set" not add in this event. Set is like a position on a switch, add is a summatory in variables.
Variable on value=0 rains, in another value: 1, 2 3 etc doesn't rain.

Important: set the rain time to 1 frame. It will prevent few seconds of raining inside the building.
Last edited by Zarmandis; Aug 30, 2023 @ 2:51am
< >
Showing 1-6 of 6 comments
Per page: 1530 50

Date Posted: Aug 28, 2023 @ 11:23am
Posts: 6