A "Delay/Wait" and "Repeat" function for event triggers, OR, an option to make a sound loop

Started by Squishybrick on

Topic category: Help with MCreator software

Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
A "Delay/Wait" and "Repeat" function for event triggers, OR, an option to make a sound loop
Tue, 09/24/2019 - 00:43 (edited)

I have a mod I'm making that requires that a certain block function as an ambient sound generator, as in, it needs to constantly play the same sound on a loop.

There is an event trigger that allows the block to do this, but either only once, or multiple times AT once, which causes the sound effect to play over itself repeatedly.

An option to "wait" a certain amount of time within the event trigger would be very convenient.. It would look something like this.

Event Trigger
(( Play at x:[x] y:[y] z:[z] level:[1] pitch:[1] sound:[CUSTOM:MySound] ))    <-- The sound being played
(( Wait tics:[1500] ))  <--- The suggested function
(( [Replay Event Trigger] ))  <--- The suggested function

If something along the lines of this has already been implemented, or if there already is a way to make a sound only be played once at a time, please let me know.

Edited by Squishybrick on Tue, 09/24/2019 - 00:43
Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can already create a…
Tue, 09/24/2019 - 10:52

You can already create a timer yourself and make the sound only play if that timer > duration of sound

I suggest you check our…
Tue, 09/24/2019 - 17:15

I suggest you check our tutorials collection playlist on our YouTube channel which contains many examples and tutorials that can help you get started with MCreator: https://www.youtube.com/playlist?list=PLAeL-oIFIEngE6jRgFYeFMfuj8WQsO3Ei

Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oooh wait.. If I set the…
Tue, 09/24/2019 - 19:03

Oooh wait.. If I set the event to activate every tick, a timer WOULD work! I'd just have to calculate how many ticks would equal the length of the sound file I wish to play, and then add an

(( If (Variable: [Number] > [#]
then (( Play at x:[x] y:[y] z:[z] level:[1] pitch:[1] sound:[CUSTOM:MySound] ))
Else (Variable: [Number] + [1] ))

Like that, right?

Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(( If (Variable: [Number] > …
Tue, 09/24/2019 - 19:08

(( If (Variable: [Number] > [#]
then (( Play at x:[x] y:[y] z:[z] level:[1] pitch:[1] sound:[CUSTOM:MySound] ))

set variable to 0.
Else (Variable: [Number] + [1] ))

 

Don't forget to set the variable back to 0 when using the sound! This makes sure it is on cooldown. (:

 

Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't see an "edit post"…
Tue, 09/24/2019 - 20:16

I don't see an "edit post" button so I'll just have to make another post..

The video "MCreatur Tutorial | How to make a global timer" was exactly what I needed, and with that, I was
able to make a block that executes a function based on a timer!

Thank you!

Ticks are full numbers, this…
Wed, 11/24/2021 - 17:26

Ticks are full numbers, this will wait 0 ticks, also wait is asynchronous, it will trigger all 220 at the same time.

Wait can't be blocking.