Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Xander Davis on July 04, 2017, 03:32:46 PM

Title: Play Random Sound Plays Same Order Every Time
Post by: Xander Davis on July 04, 2017, 03:32:46 PM
Hi, I'm using Play Random Sound.  It works-- except it doesn't.

It chooses a random sound from the list (164, all with Weight set to 1), but on every single play through, it plays them in the exact same order...  (they're voice over barks)

Advice?
Title: Re: Play Random Sound Plays Same Order Every Time
Post by: Xander Davis on July 05, 2017, 01:18:52 AM
PS: Incidentally, Weight is the only thing completely absent from the Play Random Sound documentation.

???

Is this a bug?  Should be super simple...
Title: Re: Play Random Sound Plays Same Order Every Time
Post by: djaydino on July 05, 2017, 10:24:05 AM
Hi,
I cant test right now, but can you try 'Play Random Audio' instead (test with 4 sounds or so)
You can find the action on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181)
Title: Re: Play Random Sound Plays Same Order Every Time
Post by: Ofonna on July 05, 2017, 03:58:30 PM
hi, create an object array, insert all the sounds you need in the array, use the array get random action and in the next state play audio and then loop back and forh between the states, that's the best way to do this
Title: Re: Play Random Sound Plays Same Order Every Time
Post by: djaydino on July 05, 2017, 07:54:39 PM
Hi,
@Carmichael Actually i have to disagree with you.

"Play Random Audio" is using 'List' which works faster than 'Array'

Quote
List<T> should generally be preferred over Array

faster for value types as it avoids boxing.
strongly typed elements

But then again you will only start to notice this when you have like 100.000 Lists/Arrays

So it both ways would be fine :)