Scripts / Script that plays several random soundfiles

Author
Message
R.E.Z.
9
Years of Service
User Offline
Joined: 9th Apr 2015
Location:
Posted: 3rd May 2015 08:28
Hello,

might someone know a Lua-script for GameGuru, that plays 5 or 10 different RANDOM Soundfiles?
Taking these soundfiles from a own, extra folder at the audiobank?

Might someone know help to this issue?

Regards,
R.E.Z.
PM
R.E.Z.
9
Years of Service
User Offline
Joined: 9th Apr 2015
Location:
Posted: 3rd May 2015 08:33
@moderator: please do edit The Headline into : "Looking for Script that plays several random soundfiles"

Could not edit this.

Regards,
R.E.Z.
PM
R.E.Z.
9
Years of Service
User Offline
Joined: 9th Apr 2015
Location:
Posted: 3rd May 2015 09:03
Hello,

to clearify for what a script I am looking:

I do mean, when the player enters a special Sound-Trigger-Zone, to that the script is attached, only one sound is played. This sound is randomly chosen out off 5-10 sounds at an own folder at the audiobank.

Regards,
R.E.Z.
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 3rd May 2015 16:58
currently you will need to use character sound sets for this as you can only specify 1 or 2 sounds per object.

so you can't use a zone directly but you can tell the zone to play the sounds linked to a character with those sounds

inside audiobank is a character folder, you need to create a new one and copy the format from the others, place your sounds inside one of the folders (i recommend sticking to the ones that are used by the stock entities - such as onAggro or onHurt)
name your files 0.wav, 1.wav, 2.wav etc
now set a character which calls this folder in it's script's init(e)
SetCharacterSound(e,"name of folder inside character folder")

then place your zone and tell it to play the sound from the desired folder and character
PlayCharacterSound(*character entity number*, "name of folder inside your own folder - onHurt etc")

it will automatically pick one at random i believe
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
R.E.Z.
9
Years of Service
User Offline
Joined: 9th Apr 2015
Location:
Posted: 4th May 2015 18:25 Edited at: 4th May 2015 18:25
Hello smallg,

thank You for Your answer and help ))
I will go for this hint.

Regards,
R.E.Z.
PM
!nullptr
Forum Support
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 7th May 2015 04:10
I've recently started playing with Omega Core from Magique Productions and if you are half reasonable with script you can generate any number of sfx and play them on demand without zone or entity (although using it within a zone would be relatively simple also.)

https://magiqueprod.wordpress.com/2014/10/31/omega-core-v1-07a-released/

Be keen to see if this is developed further because the sound and input functions alone cover so many of my core needs with GG that it's my new goto atm.

(If it is inappropriate to link this site, please be gentle with me )
Development/ Gaming Rigs
Sys 1: i7-4770 (3.5)/16Gb/128 SSD/3Tb/970gtx/2 x 23, 1 x 27 LCD - Sys 2: i7/8Gb/670gtx/1.5Tb/1 x 23 LCD - Sys 3: Amd Quad/8Gb/645gtx/1Tb/30" LCD
PM

Login to post a reply

Server time is: 2024-12-22 01:25:28
Your offset time is: 2024-12-22 01:25:28