Page 1 of 1

Speaker using vis_leafgroups - tltrude tut

Posted: Tue Sep 06, 2005 10:04 am
by Hell_Soldier
i made a speaker inside a building and covered everything else with vis_leafgroup.

when i load the map the speaker doesnt work, but if i type 'restart' in console it starts working.

so what i am asking is why does the speaker only starts working after a restart?

speaker

Posted: Tue Sep 06, 2005 10:42 am
by tltrude
I have seen this before, and I think it is a bug in the game. Try adding a delay before the sound begins playing.

level waittill prespawn

Thread start_sounds

end

//----------------------------------

start_sounds:

wait 1
$myspeaker loopsound soundname

end

Posted: Tue Sep 06, 2005 12:29 pm
by Hell_Soldier
i copied the start_sounds thread from the tutorial readme and it alreayd includes the 'wait 1' command.

maybe i need a ubersound file like in the ubersound workaround tut?

Code: Select all

// HIDDENVALLEY 
// ARCHITECTURE: Hell_Soldier 
// SCRIPTING: Hell_Soldier 

main: 

// set scoreboard messages 
setcvar "g_obj_alliedtext1" "Hidden Valley" 
setcvar "g_obj_alliedtext2" "" 
setcvar "g_obj_alliedtext3" "" 
setcvar "g_obj_axistext1" "" 
setcvar "g_obj_axistext2" "" 
setcvar "g_obj_axistext3" "" 

setcvar "g_scoreboardpic" "none" 

// Ubersound workaround lines
local.master = spawn ScriptMaster
local.master aliascache outside_snd sound/amb/Amb_WindTrees4.wav soundparms 0.5 0.0 1.0 0.0 600 10000 auto loaded maps "dm moh obj train"

$world farplane 4000 
$world farplane_color (0.675 0.663 0.651) 
$world farplane_cull 0 

   // call additional stuff for playing this map round based is needed 
   if(level.roundbased) 
      thread roundbasedthread 

   level waittill prespawn  
  
   //*** Precache Dm Stuff 
   exec global/DMprecache.scr 

   exec global/door_locked.scr::lock 
   level.script = maps/dm/hiddenvalley.scr 
   exec global/ambientsound.scr hiddenvalley  //Using your map name only works if you have made a .mus file--use stock map name like mohdm7 (just wind). 

   exec global/ai.scr 
   //exec global/loadout.scr maps/dm/hiddenvalley.scr //probably wont work in multiplayer 
   //exec global/friendly.scr //probably wont work in multiplayer 

   $dooropenerin nottriggerable 
   $dooropenerout nottriggerable 
   $lift_inswitch bind $elevator 

   thread start_sounds
   thread truck_start 

   level waittill spawn 

end 

//----------------------------------------------------------------------------- 

roundbasedthread: 

   // Can specify different scoreboard messages for round based here. 


   level waitTill prespawn 

   level waittill spawn 

   // set the parameters for this round based match 
   level.dmrespawning = 0 // 1 or 0 
   level.dmroundlimit = 5 // round time limit in minutes 
   level.clockside = kills // set to axis, allies, kills, or draw 

   level waittill roundstart 

end 

//------------------------------------------------> 
//sound thread
//------------------------------------------------>

start_sounds:

	wait 1
	$lounge_speaker1 loopsound outside_snd

end

//----------------------------------------------------------------------------- 

truck_start: 
  
   wait 10 
   $trk drive $wap 
   $trk waittill drive 
   $trk stop 

   goto truck 

end 

//----------------------------------------------------------------------------- 

traptrigger: 

   $traptrigger volumedamage 1000 
   iprintlnbold_noloc "a sucker fell down from the skies" 

end 

//----------------------------------------------------------------------------- 

firetrigger: 
  
   $firetrigger volumedamage 10 

end 

//----------------------------------------------------------------------------- 

doorlock: 
  
   $outsidelock nottriggerable // don't let it trigger until thread is finished 
   $insidelock nottriggerable 
   $dooropenerin triggerable // door is now unlocked 
   $dooropenerout triggerable 
   wait 1 
   $dooropenerin nottriggerable // lock it 
   $dooropenerout nottriggerable // lock it 
   $outsidelock triggerable // turn on unlock triggers 
   $insidelock triggerable 

end 

//----------------------------------------------------------------------------- 

pushtrigger: 
  
   iprintlnbold_noloc "a Human Rocket has been LAUNCHED!" 

end 

//----------------------------------------------------------------------------- 

Hmmm

Posted: Tue Sep 06, 2005 1:56 pm
by tltrude
Maybe starting the sound after level waittill spawn will work.

Code: Select all

// HIDDENVALLEY 
// ARCHITECTURE: Hell_Soldier 
// SCRIPTING: Hell_Soldier 

main: 

// set scoreboard messages 
setcvar "g_obj_alliedtext1" "Hidden Valley" 
setcvar "g_obj_alliedtext2" "" 
setcvar "g_obj_alliedtext3" "" 
setcvar "g_obj_axistext1" "" 
setcvar "g_obj_axistext2" "" 
setcvar "g_obj_axistext3" "" 

setcvar "g_scoreboardpic" "none" 

// Ubersound workaround lines 
local.master = spawn ScriptMaster 
local.master aliascache outside_snd sound/amb/Amb_WindTrees4.wav soundparms 0.5 0.0 1.0 0.0 600 10000 auto loaded maps "dm moh obj train" 

$world farplane 4000 
$world farplane_color (0.675 0.663 0.651) 
$world farplane_cull 0 

   // call additional stuff for playing this map round based is needed 
   if(level.roundbased) 
      thread roundbasedthread 

   level waittill prespawn  
  
   //*** Precache Dm Stuff 
   exec global/DMprecache.scr 

   exec global/door_locked.scr::lock 
   level.script = maps/dm/hiddenvalley.scr 
   exec global/ambientsound.scr hiddenvalley  //Using your map name only works if you have made a .mus file--use stock map name like mohdm7 (just wind). 

   exec global/ai.scr 
   //exec global/loadout.scr maps/dm/hiddenvalley.scr //probably wont work in multiplayer 
   //exec global/friendly.scr //probably wont work in multiplayer 

   $dooropenerin nottriggerable 
   $dooropenerout nottriggerable 
   $lift_inswitch bind $elevator 

   thread truck_start 

   level waittill spawn 

   thread start_sounds 

end 

//----------------------------------------------------------------------------- 

roundbasedthread: 

   // Can specify different scoreboard messages for round based here. 


   level waitTill prespawn 

   level waittill spawn 

   // set the parameters for this round based match 
   level.dmrespawning = 0 // 1 or 0 
   level.dmroundlimit = 5 // round time limit in minutes 
   level.clockside = kills // set to axis, allies, kills, or draw 

   level waittill roundstart 

end 

//------------------------------------------------> 
//sound thread 
//------------------------------------------------> 

start_sounds: 

   wait 1 
   $lounge_speaker1 loopsound outside_snd 

end 

//----------------------------------------------------------------------------- 

truck_start: 
  
   wait 10 
   $trk drive $wap 
   $trk waittill drive 
   $trk stop 

   goto truck 

end 

//----------------------------------------------------------------------------- 

traptrigger: 

   $traptrigger volumedamage 1000 
   iprintlnbold_noloc "a sucker fell down from the skies" 

end 

//----------------------------------------------------------------------------- 

firetrigger: 
  
   $firetrigger volumedamage 10 

end 

//----------------------------------------------------------------------------- 

doorlock: 
  
   $outsidelock nottriggerable // don't let it trigger until thread is finished 
   $insidelock nottriggerable 
   $dooropenerin triggerable // door is now unlocked 
   $dooropenerout triggerable 
   wait 1 
   $dooropenerin nottriggerable // lock it 
   $dooropenerout nottriggerable // lock it 
   $outsidelock triggerable // turn on unlock triggers 
   $insidelock triggerable 

end 

//----------------------------------------------------------------------------- 

pushtrigger: 
  
   iprintlnbold_noloc "a Human Rocket has been LAUNCHED!" 

end 

//----------------------------------------------------------------------------- 
Are you sure you have the vis_leafgroups correct? They must be correct if it works on restart. You can also try increasing the wait time in the thread.

This is for Mohaa and not spearhead, right?

Posted: Tue Sep 06, 2005 2:56 pm
by Hell_Soldier
the things u suggested didnt worked, even tried taking off the 'wait' command.

its Spearhead, not Mohaa.

by the way, do u know any radio entities i can use?

mohaa

Posted: Tue Sep 06, 2005 10:38 pm
by tltrude
Try it in mohaa and see if you still have the problem. The ubersound work around has always had problems in Spearhead. You will have to make a custom ubersound script like the one Spearhead uses. I can't help with that because I don't have SH installed, but it has been discussed in the forum before.

Static > Decor > Radio Civilian


Btw, You can also pick a sound alias that works, in multiplayer--without a work around. Although in your case, YOu might want to find one in the spearhead ubersound script.

Posted: Wed Sep 07, 2005 4:23 pm
by Hell_Soldier
ok i fixed the problem.

heres the ubersound code i used:

Code: Select all

//
//UBERSOUND file

settiki none

aliascache team_snd sound/music/Amb_team1.mp3 soundparms 3.0 0.0 1.0 0.0 600 10000 auto loaded maps "dm moh obj train"
aliascache zero_snd sound/music/Amb_zero1.mp3 soundparms 3.0 0.0 1.0 0.0 600 10000 auto loaded maps "dm moh obj train"

end
thx for all the help