#Sound efect Timing

1 messages · Page 1 of 1 (latest)

tall rune
#

How do I make a sound play from time to time? For example, if I want it to play the sound every 10 minutes

gloomy pike
#

cooldown thingy

#

and

#

1 hz event reciver

rich dust
#

30hz - Int variable (Time)
Time get universal seconds

Event receiver (Time Changed)
Remainder 601
Greater or equal to 600
If --(Play sound)

gloomy pike
#

thats like

#

the worst way of doing this

#

all you need

#

is float variable less than and add and an if chip

rich dust
#

They would both work given an if value in there too, to reset.

gloomy pike
#

6 chips

#

this will never fail like delays

#

this wont cause lag like delays

rich dust
#

That will play the sound many times in a second

tall rune
#

@rich dust @gloomy pike Thank you guys 🖤 I’ll try

gloomy pike
#

make the exact thing i made

rich dust
#

And it's 6 chips

gloomy pike
gloomy pike
#

okay

rich dust
#

I'm actually curious lol

gloomy pike
#

your setup looks like it would use more than double the cpu

#

i find constantly setting a variable and using two event thingys is alot more laggy than just one

#

so im gonna try it

rich dust
#

Or anytime

rich dust
gloomy pike
#

idk why in gods name your using integers

rich dust
#

I find it easier than everything in between, solid number like 1, 2,3 does the trick

gloomy pike
rich dust
#

There's always more than one way to do stuff and I love it.

gloomy pike
#

usually something like 0.5 would be more helpful

rich dust
#

Yeah! For something like that is diff

#

Then my setup wouldn't work for that not really

gloomy pike
#

okay

#

mine uses 0.02% more cpu

#

but i have no clue what you were thinking when you made your setup

#

this is literally using such little cpu its absurd

#

and it does THE EXACT SAME THING

#

its such a small change that the number dosent even move

rich dust
#

Even less chips! Lol, But I think I have it setup cause Im on a project that changes that variable so I'm used to using the variable

rich dust
#

I do use floats, to save a certain number to the exact.

#

Just depends what I use It for or whoever but yeah

#

Float sometimes it skips over the number I think?

#

Maybe idk

gloomy pike
#

floats and what your using will literally never work

rich dust
rich dust
gloomy pike
#

if the variables being set to the time every single second then what do you mean changing it

#

changing it will do basically nothing

rich dust
#

I have an if before it so "if" something is on then don't update.

#

And if that is off then change to 0

#

By something else

#

Specifically timestamps, if not playing don't update. If restarted song then go back to 0 and not update until the song is playing

gloomy pike
#

what..

rich dust
#

I was talking about why I used the variable

#

But anywho, it was nice talking to you :3

gloomy pike
#

0- 0.01% cpu

young prism
#

Why not just use a delay…?

gaunt crater
#

Delay to 600 seconds that’s literally all😭

gloomy pike
#

for small things it good but for others you basically have to use variables and stuff

rich dust
#

I'm with social rep wizard, sometimes they can fail. Delays can be helpful but not reliable for some things

orchid veldt
#

yap

#

cool circuits tho

snow vine
snow vine
#

Oh my bad, misread the event, 1hz is alot more reliable for that setup, but it does also mean that if a player happens to have some kind of lag/freeze for more than 1 second, they could skip the designated second you're checking for and not trigger an execution at all. Safest bet is
Event receiver (Update) > divide > int variable > Event receiver (int variable changed)
(or use a float variable if you're looking for intervals shorter than 1 second not longer)

#

This way it would only skip the execution if a player somehow missed the whooole 𝑥 seconds interval without lagging out of the game, which is far less likely than missing the 1 second

gloomy pike
#

its using 1h 1h is once every second

gloomy pike
#

what does divide do

snow vine
#

Makes the value smaller so the "int variable changed" event triggers less often

#

If you divide it by 30 for example, it is squishing that span of 30 values down to 1 value, since ints automatically round to whole numbers

gloomy pike
#

what...

snow vine
#

Then instead of triggering every second and then checking where it's up to, it only triggers once every desired amount of seconds, no need for checking if its the right second.

gloomy pike
#

it uses not even 0.01% cpu

snow vine
#

It uses 4 chips, probably similar CPU, and doesn't scale up in chips and CPU usage a bunch if you want to use it in multiple places

gloomy pike
#

?

snow vine
#

Well what if you want to use it in several places?

#

You would have to make the whole setup everywhere, or send an event that you can use anywhere, but if you just do update > divide > int variable, anywhere can use that one (int variable changed) event already

#

0.06% on an Update event (more accurate timing), or 0.00% on a 1hz event

#

The 0.00% i believe is just something to do with how Rec Room averages CPU usage over time to display it to you

#

Though again, these solutions that use time get universal seconds all still come with the problem that they have a chance to trigger twice within a single interval on room load or player joined, as it always triggers once when first used, then whenever the natural 𝑥 second interval is too, as that interval is not tied to your room in any way, it's just how many seconds have passed since 1/1/1970, so you could have a 30 second repeating signal, and join on the 29th second, causing it to activate upon joining, then immediately again on that 30th second.

rich dust
#

Could sync the variable and only run on room authority

snow vine
# gloomy pike

That still comes with the same issue, unfortunately. You'd have to save an offset of how many seconds away from the natural 30 second interval you were when loading the room, to add to the universal seconds before doing anything with it. This one i'm replying to is a little more costly but does get around that issue without needing to save the offset

snow vine
#

For stuff like little checks with circuits it doesn't really matter all that much, but for something like audio, if it's something long like music it could cause issues, either the song would overlap for attempting to play a second time before it had finished, or it wouldn't overlap and there would be a long period of silence after the first playing where it wouldn't play until the next interval.

gloomy pike
snow vine
tall rune
snow vine
hushed quail
#

Yo just use room loaded and connect it into a delay