World time sound effects?

aerobesk

Warper
Member
Joined
Feb 20, 2020
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
(Hopefully this is the place to put this. Sorry, I'm new.)
I recently added a common event for a 24 hour time clock into my game. Every 15 minutes it will register that 6 hours has gone by. I'm using the method where you have a certain amount of frames tick a variable up, representing a minute, and then that variable will reset at a certain number and tick up a different one, for an hour. Every 6 hours I have switches to change the lightning, and at 24 hours, it resets completely. Pretty simple.
My problem is that I would like to have it where a bell toll goes off once every time it changes. I have the sound effect for it, but when it hits that point, it just keeps repeating the sound faster and faster without even the full cycle going through. I thought that maybe it was because I was using greater than/equal to on the variables, but even if I set it to = and have it wait the entire hour until it shouldn't be the same number, it continues going off at its regular pace.
I've tried adding the sound to remote events (both common and on a map) and controlling it with switches, having the switch start the sound and then turn itself off (or having the main event shut it off right after starting it), but the same thing happens. It still happens even when I add Erase Event after the sound goes off. I've tried adding Stop SE, but if I do it directly after, the sound doesn't go off at all, and if I put in wait lines up to the length of the event and then tell it to shut off, it will just repeat it.
I've messed around a bit with normal parallel triggers, but not much with Common Event ones. Is there a way to have something trigger once in a common event and then shut off until the next cycle?
EDIT: Here's some screenshots showing the main things I've tried. Hope this helps.
1.png3.png
 
Last edited:

stickyka

Veteran
Veteran
Joined
Oct 15, 2017
Messages
30
Reaction score
3
First Language
english
Primarily Uses
RMVXA
Can you screenshot the event setup so we can see how you arranged your logic?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,757
Reaction score
12,199
First Language
English
Primarily Uses
RMMV
Sounds like maybe you haven't used any ELSE conditions. But we need to see screenshots, because a description won't show us where it's going wrong.
 

stickyka

Veteran
Veteran
Joined
Oct 15, 2017
Messages
30
Reaction score
3
First Language
english
Primarily Uses
RMVXA
Well, two things here:
1. Your hour event is set to if >= 0, which means that every time it finishes that event sequence and starts over, it is going to set that condition as soon as hour goes over 0, then change again when it hits 6; you might add a if hour < 6 under that condition before the events so it essentially reads, if hour greater than or equal to 0 AND less than 6 (EDIT: meaning, that how you have it set up currently, once the event sequences repeat, it will very briefly turn morning back on because hour is >= 0, until it processes hour = 6, then it will turn morning back off - repeatedly, very fast)

2. The second event page literally plays the bell sound as long as the switch is on - remember, once the event is finished running, if it's set to parallel, it will repeat and run again. Which brings us back to why I said what I said in the first point.

So, to fix the second part, you can add a "if day = on, jump to label [set up a label after the conditional for if hour = 6]; else [perform these things]" which would make it run the hour=6 stuff only if day is not on - which is turned on only within that segment. there's a few other ways you could do it, but this is just what I might do to simply edit what you already have.


EDIT: That might sound confusing, let me know if you need a screenshot of what I mean
 

aerobesk

Warper
Member
Joined
Feb 20, 2020
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
Well, two things here:
1. Your hour event is set to if >= 0, which means that every time it finishes that event sequence and starts over, it is going to set that condition as soon as hour goes over 0, then change again when it hits 6; you might add a if hour < 6 under that condition before the events so it essentially reads, if hour greater than or equal to 0 AND less than 6 (EDIT: meaning, that how you have it set up currently, once the event sequences repeat, it will very briefly turn morning back on because hour is >= 0, until it processes hour = 6, then it will turn morning back off - repeatedly, very fast)

2. The second event page literally plays the bell sound as long as the switch is on - remember, once the event is finished running, if it's set to parallel, it will repeat and run again. Which brings us back to why I said what I said in the first point.

So, to fix the second part, you can add a "if day = on, jump to label [set up a label after the conditional for if hour = 6]; else [perform these things]" which would make it run the hour=6 stuff only if day is not on - which is turned on only within that segment. there's a few other ways you could do it, but this is just what I might do to simply edit what you already have.


EDIT: That might sound confusing, let me know if you need a screenshot of what I mean
I think that makes sense. The screenshots were kind of a mix of all of the things I tried so I wasn't sure if they would make sense. I tried the first one you said, and it still plays it repeatedly right after it turns on, even with wait conditions or stop se. The second part was something that I was trying after the first one didn't work. I'd like two different sound effects to play, one at 0 and 12 and one at 6 and 18 (if possible), so I don't know if that would work.
The main thing that confuses me I think is that if I set it to hour = 0 I can't get it to play the sound effect only the once, even if I tell it not to do anything else until hour no longer is 0. I hope that makes sense, and if I didn't get what you were saying I'm sorry.
 

stickyka

Veteran
Veteran
Joined
Oct 15, 2017
Messages
30
Reaction score
3
First Language
english
Primarily Uses
RMVXA
EDIT: I realised I may not have made my screenshots apparent: There's a spoiler button below this sentence! lol


Basically, what I was saying is the root cause of your problems is that in parallel events, the event automatically runs, then it repeats.

So, follow this logic:
do minute and hour calculations
If hour is greater than 0, turn morning on, turn all else off
if hour is equal to 6, turn day on, turn all else off, [turn on switch to play sound], [turn off switch to play sound]
Repeat the above
and the cpu runs it pretty fast
So, it runs it the first time, morning gets turned on, other switches off (because hour is greater than or equal to 0)
it skips hour is = to 6 because hour hasn't ticked up to that yet
Then it runs it again, turning morning on, other switches off, skipping hour = 6 condition
and again, and again, etc, each time, performing the same thing UNTIL hour does = 6

it turns morning on, other switches off, but this time, it also does the hour = 6 condition as well, which is turning day on, other switches off, and the sound switch (which incidentally plays the sound)

BUT, it runs it again immediately when it finishes, turning morning on, other switches off, because hour >= 0
AND AGAIN, it turns day on and other switches off (as long as hour = 6), does the sound switch, causing the bell

and then it runs the above AGAIN once it's finished the rest of the events in the lineup and it keeps playing that bell UNTIL hour does NOT = 6; then when it repeats, it will skip that part

Parallel process says: Run this series of events and once you've gone through them, run them again, and again, and again, etc; so you need some conditions to tell it when NOT to do something;

fyi, with the way I set it up above, you shouldn't need the switch turned on to play the SE

lemme know if there's an issue
 

aerobesk

Warper
Member
Joined
Feb 20, 2020
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
EDIT: I realised I may not have made my screenshots apparent: There's a spoiler button below this sentence! lol


Basically, what I was saying is the root cause of your problems is that in parallel events, the event automatically runs, then it repeats.

So, follow this logic:
do minute and hour calculations
If hour is greater than 0, turn morning on, turn all else off
if hour is equal to 6, turn day on, turn all else off, [turn on switch to play sound], [turn off switch to play sound]
Repeat the above
and the cpu runs it pretty fast
So, it runs it the first time, morning gets turned on, other switches off (because hour is greater than or equal to 0)
it skips hour is = to 6 because hour hasn't ticked up to that yet
Then it runs it again, turning morning on, other switches off, skipping hour = 6 condition
and again, and again, etc, each time, performing the same thing UNTIL hour does = 6

it turns morning on, other switches off, but this time, it also does the hour = 6 condition as well, which is turning day on, other switches off, and the sound switch (which incidentally plays the sound)

BUT, it runs it again immediately when it finishes, turning morning on, other switches off, because hour >= 0
AND AGAIN, it turns day on and other switches off (as long as hour = 6), does the sound switch, causing the bell

and then it runs the above AGAIN once it's finished the rest of the events in the lineup and it keeps playing that bell UNTIL hour does NOT = 6; then when it repeats, it will skip that part

Parallel process says: Run this series of events and once you've gone through them, run them again, and again, and again, etc; so you need some conditions to tell it when NOT to do something;

fyi, with the way I set it up above, you shouldn't need the switch turned on to play the SE

lemme know if there's an issue
Looks like that worked! I guess I didn't know what you were saying lol.
This works perfectly; thank you so much!!
 

stickyka

Veteran
Veteran
Joined
Oct 15, 2017
Messages
30
Reaction score
3
First Language
english
Primarily Uses
RMVXA
No worries, Mog Hunter also has a time hud and time system that includes a visual and several other elements you can use, but might be a little advanced.
 

aerobesk

Warper
Member
Joined
Feb 20, 2020
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
No worries, Mog Hunter also has a time hud and time system that includes a visual and several other elements you can use, but might be a little advanced.
I did, it just had far more than I was looking for. I only wanted the sound effects and day cycle; time isn't going to be too prominent of a feature and I didn't want to have to remove all of the hud stuff and seasons and everything just for this, if that makes sense.
 

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

Latest Threads

Latest Profile Posts

CG tile rendering, take 3: windows.
which section you guys think looks more accurate to the perspective? left or right?

for reference, this is what it looks like "at street level"
Okay, Animal Crossing is remarkably addictive and exceptionally calming. I've been playing it pretty exclusively... like... 6 hours a day. Been a while since I've been this engrossed.
Realized a tad too late that lighting scripts are the main culprit in performance nosedive. Guess the flashlight had to go.
wat is ERROR:registration_protocol_win cc(56) . any way to fix it

Forum statistics

Threads
95,393
Messages
928,847
Members
125,606
Latest member
abbey_lavish
Top