Scripts / [SOLVED] Simple sound queue script?

Author
Message
Gladkhelek
7
Years of Service
User Offline
Joined: 2nd Aug 2016
Location:
Posted: 25th Jul 2019 07:00
I don't want to pick a sound from the entity's sound list:

Sound(e,1)

I would rather something that functions as follows

"Sound = "audiobank\misc\poop.wav"

There has to be a simple sound queue command, right?
I tried to find an example but every script seems to do something within a certain context like so:

;Sound
soundset = audiobank\misc\health.wav

or

PlaySound(e,0)

I tried
PlaySoundFile("audiobank\\misc\\mysound.wav")
But it didn't work (also tried with single backslashes but it didn't like the escape sequence.

The author of this post has marked a post as an answer.

Go to answer
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 25th Jul 2019 11:10
Do you really need more than 5 sounds for one entity?

If you want non-entity sounds, like ambience/music, use GlobalSound commands, you can load as many samples as you want.
Been there, done that, got all the T-Shirts!
PM
Gladkhelek
7
Years of Service
User Offline
Joined: 2nd Aug 2016
Location:
Posted: 25th Jul 2019 18:26
Quote: "Do you really need more than 5 sounds for one entity?

If you want non-entity sounds, like ambience/music, use GlobalSound commands, you can load as many samples as you want."


I don't need more than five, I simply don't want to fill in the slots by giving context in the custom AI for the sound.
What might an example of a global sound command be? Again I thought PlaySoundFile was one but it didn't work.
PM
Gladkhelek
7
Years of Service
User Offline
Joined: 2nd Aug 2016
Location:
Posted: 25th Jul 2019 18:45


Nothing played, its there in the folder with the exact name and everything so idk.

PM
Gladkhelek
7
Years of Service
User Offline
Joined: 2nd Aug 2016
Location:
Posted: 25th Jul 2019 18:50
This post has been marked by the post author as the answer.
Oh, I am so silly!



This is the working script, I don't really know much about coding let alone Lua so this took me a bit haha. But its here if anyone else as inept as me wants to use it. Sorry if I wasted anyone's time.
PM

Login to post a reply

Server time is: 2024-05-05 02:44:20
Your offset time is: 2024-05-05 02:44:20