#Sound efect Timing
1 messages · Page 1 of 1 (latest)
use uhh
cooldown thingy
and
1 hz event reciver
30hz - Int variable (Time)
Time get universal seconds
Event receiver (Time Changed)
Remainder 601
Greater or equal to 600
If --(Play sound)
what?
thats like
the worst way of doing this
all you need
is float variable less than and add and an if chip
They would both work given an if value in there too, to reset.
That will play the sound many times in a second
@rich dust @gloomy pike Thank you guys 🖤 I’ll try
no it wont
make the exact thing i made
Just tested it you're right pretty cool, but tried mines out and mines uses less cpu
And it's 6 chips
that dosent look like it would use less cpu
Try
okay
I'm actually curious lol
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
pain
Yeah, but in the switch you can have it exec on diff times within 10 seconds like at 3, or 6
Or anytime
I thought the same but it can be helpful sometimes in rare casses
idk why in gods name your using integers
I find it easier than everything in between, solid number like 1, 2,3 does the trick
not most of the time with cooldown related stuff
There's always more than one way to do stuff and I love it.
usually something like 0.5 would be more helpful
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
Lol
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
then why not use floats
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
then use my system
floats and what your using will literally never work
For something like that yeah with floats
I appreciate your time, I think we already helped this person out already.
wait
if the variables being set to the time every single second then what do you mean changing it
changing it will do basically nothing
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
what..
Why not just use a delay…?
Delay to 600 seconds that’s literally all😭
delays are prone to just failing alot of the time and cause horrid lag
for small things it good but for others you basically have to use variables and stuff
I'm with social rep wizard, sometimes they can fail. Delays can be helpful but not reliable for some things
I was gonna suggest this too (but dividing the universal seconds instead of using remainder afterwards) but the problem with it is, it will always activate once upon room load (or room joined if whatever it triggers is local) and then also once every 𝑥 seconds since the beginning of 1970, meaning it can sometimes trigger more often than it should upon room load.
This will spam activate on the desired second. Rushie uses the "variable changed" event because it only activates once on the desired second.
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
no it wont
its using 1h 1h is once every second
why divide
what does divide do
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
what...
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.
why would you EVER want that
it uses not even 0.01% cpu
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
?
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.
Could sync the variable and only run on room authority
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
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.
change where the add chip is
This sound that plays every 10 minutes, is it just a relatively short sound effect? Or something longer like a song?
It’s a sound effect, 6 seconds
Ah, then yeah this should do. You'll also wanna make whatever plays the sound effect to be unsynced. @tall rune
Yo just use room loaded and connect it into a delay