Jump to content

Home

Looping Sound in Scripts


Obsidian-Jovani

Recommended Posts

I made this script for a force_push wall that moves down a hall that takes 15 seconds to stop, but my sound only plays once which lasts for about 2 seconds.

 

Does anyone know why this loop isn't working? Is there something I forgot to add?

 

 

//Generated by BehavEd

 

rem ( "forcepushwall01.IBI" );

rem ( "Force Push Wall Script" );

rem ( "Script by: Obsidian-Jovani" );

rem ( "When Force Push move the door" );

 

affect ( "pushwall01", /*@AFFECT_TYPE*/ FLUSH )

{

move ( $tag("pushwall01_open", ORIGIN)$, $< 0 0 0 >$, 15000.000 );

wait ( -1.000 );

}

 

rem ( "Play sound file door_stone_move.wav" );

 

loop ( 7 )

{

sound ( /*@CHANNELS*/ CHAN_AUTO, "sound/movers/doors/door_stone_move.wav" );

}

 

 

I know I could edit this sound and make it into a 15 second clip, but that would just make my total file size bigger. I need a better solution. Any ideas? Thanks for your input.

Link to comment
Share on other sites

I did this and I know it works, the only thing I see different in your script is that you loop the actual sound instead of a task. Excuse the script code below...I just cut and pasted it from a script I made for a similar thing.

 

So, try defining the task first:

--------------------------------------

affect ( "lift01", FLUSH )

{

task ( "snd_move" )

{

sound ( CHAN_AUTO, "sound/movers/doors/lift_loop03.mp3" );

}

--------------------------------------

 

Then loop the task itself (I added a little delay in mine because the loop started cutting itself off):

--------------------------------------

loop ( 15 )

{

dowait ( "snd_move" );

wait ( 850 );

}

--------------------------------------

 

Also I wasn't sure what the "wait ( -1.000 );" was doing in your script.

 

Hope this helps.

 

-clu

Link to comment
Share on other sites

Thanks for the advice clu. I'll give that a try.

 

Also I wasn't sure what the "wait ( -1.000 );" was doing in your script.

 

The wait (-1.000) is just in there so the wall door never returns. Hmm. Now that I think about it I don't think I need that in there because the wall door is a func_static not a func_door and the func_static won't return unless I tell it too with another move command.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...