Nature audio looping randomly

Say, I want to have a Crow , squeaking randomly. 

How would I use variable to do that?

I don't want to have it play at 4 seconds, then 10, then 15 and then repeat..because it wouldn't sound random. 

Any ideas?
There are several ways.

I'd do something like this in a parallel process event on the map:

Wait 30 framesControl Variables [001: Player Steps] = StepsConditional Branch: Variable [001: Player Steps] >= Variable [002: Target Steps] Control Variables [002: Target Steps] = Variable [001: Player Steps] Control Variables [002: Target Steps] += Random(30..50)Branch EndThen set up another parallel process that does this:
Code:
Control Variables [002: Target Steps] = StepsErase Event
So you have an event that's checking every half second whether or not it should play the SE. The trigger is whether they have taken a random number of steps between 30 and 50 since the last time the SE was played. Just change those numbers around depending on how long you want to wait between SEs, and how closely you want them to be spaced. The other event just ensures that the SE doesn't play immediately when you load the map, because at the start, target steps would be 0, and later on you could leave the map and accrue the required number of steps on another map so the condition will already be met when you come back here.You could also use Play Time instead of steps, so if the player pauses for a long time in the one place, the SE will continue to play every now and then.
You can also use a plugin to make your life easier 😛

I created a plugin for Random Number Generation and I added suupport to the wait command, If you combine both (very easy) then you get what you want.

I also created a topic for this plugin, but it needs to be approved by a moderator first, so I post the link here for you.

Plugin link:

http://www.mediafire.com/view/0jadyb3a3cp9v3t/TF_RandomNumberGenerator.js

Example link:

http://www.mediafire.com/download/xeci2qaiorqgetg/RandomNumberExample.rar

The example shows it in action + it's combination with wait. You can open the example in RPG Maker and view the event to see how to use. Everything is also explained in help section of the plugin.
a newbie question then, where do I put the SE ? I inserted a chicken SE right under wait 30 and now the chicken chirps non-stop
Can you show a screenshot of the event, and one of the move route?
ok I have to say now..I was able to set something that looks similar to your idea but I obviously need a screenshot of what you are doing
This is the alternative I spoke about, using play time rather than number of steps, so it will still work even if the player stands still for a long time. It plays the sound at 5-10 second intervals. Change the numbers in both events to whatever minimum/maximum you want. Play Time comes under the Game Data slot in Control Variables.


e6110245c4.png



148a89b66d.png
If you use my plugin, then it will look like this: (Note that it uses Variable #10, you can change that of course)

Spoiler
lIJll.png
It's up to you, how you want to get it: by eventing alone or with help from a plugin (both ways are good)
thanks to both of you. Now this game of mine sounds alive.

Original thread: https://forums.rpgmakerweb.com/threads/nature-audio-looping-randomly.51847/