Looping speaker?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Looping speaker?

Post by Bjarne BZR »

In a post earlier:
jv_map wrote:while(1)
{
$speaker playsound mysound
wait 1.5 // length of sound file
}
... is it possibrle to loop the sound with a command? Maby using
$speaker loopsound mysound
instead?

...trying to time the sound and manually loop it sounds dangerous...

I tried to use the loopsound without a while statement, but it did not work...

( But I get the sound when using the while loop above, just a bad looping )
Admin .MAP Forums
Image
Head above heels.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

loopsound should work :?.
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Now Im really confused...

When I use the playsound with a while loop: the sound plays, but I get lots of messages in the log saying:
^~^~^ Not playing sound 'sound/amb/amb_lighthum_01.wav'

When I use the loopsound only, I get no sound and a message in the log saying:
ERROR: Entity::LoopSound: transformer_hum needs an alias in ubersound.scr or uberdialog.scr - Please fix.

( transformer_hum is an alias for 'sound/amb/amb_lighthum_01.wav' that i have in a .tik file that is loaded in the _precache script )
Admin .MAP Forums
Image
Head above heels.
Slyk
Lieutenant Colonel
Posts: 361
Joined: Sun Jul 14, 2002 12:42 am
Location: Elizabethtown, PA

Post by Slyk »

I did a similar thing with just this:

$speaker loopsound yoursound------my actual line:

$generator loopsound power_generator

I have had TONS of problems getting other speakers to play anything at all though....tough to figure out what sounds will and won't play, even copying their syntax/text directly from stock maps.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

I have realized something... I got it to work, but as jv_map pointed out: I does not matter because it WONT work on a dedicated server... so there is no use to try it at all on a multiplayer map... ( unless U plan to add jv_map's BOT's an play it by your self :wink: )
Admin .MAP Forums
Image
Head above heels.
Post Reply