Page 1 of 1

TOW switch to make things move ?

Posted: Sat Feb 21, 2004 7:22 pm
by Jack Ruby
Well I need a switch I stole from Berlin to trigger a lock gate to move, it will move one way for allies then same switch will move it in the opposite direction if triggered by axis (well at least thats what I am hoping to do).

Heres a pic from radiant of the thing I want to move:
Image

Heres the script I am using for this switch:

//----------------------------------------------------------
//Turn on/off Flak88's (this will actually be the gate mover but for my purposes it can be called artillerystrike)
//----------------------------------------------------------
artillerystrike:

if( level.bRoundStarted == 1 )
{
if( parm.other.dmteam == axis )
{
if( $Obj_artillerystrike.ControlledBy != 0 )
{
//Flip the switch
thread artillerystrike_switch

//$artillery_radio_speaker playsound radio_on

$Obj_artillerystrike TakeOver 0
//$tower_lights_02 show

//Call in the artillery strike
thread call_artillery_strike

//Give 2 points for taking objective
parm.other AddKills 2

iprintln "The Axis have opened the tunnel blast doors!"
}
}
else if( parm.other.dmteam == allies )
{
if( $Obj_artillerystrike.ControlledBy != 1 )
{
//Flip the switch
thread artillerystrike_switch

$artillery_radio_speaker playsound radio_off

$Obj_artillerystrike TakeOver 1
$tower_lights_02 hide

//Give 2 points for taking objective
parm.other AddKills 2

iprintln "The Allies have closed the tunnel blast doors!"
}
}

//Did anyone win?
thread Check_End_Match

//Update team current objectives
thread set_objectives
}

end

The trigger use in the map right now works correctly as a tow objective but I also need it to move the lockgate.

The trigger_use has these key values:
classname trigger_use
setthread artillerystrike
targetname t879

Could someone adapt this script to move the gate for me ? It would be lovely if you could :wink:

thread

Posted: Sat Feb 21, 2004 11:43 pm
by tltrude
You can add the gate movement to the thread named "artillerystrike_switch:", which you did not show.


$lockgate moveSouth 500 // To open it
$lockgate move // or waitmove


$lockgate moveNorth 500 // To close it
$lockgate move // or waitmove

There should already be some lines for moving the switch, so just add these to make the gate open/close too.

Posted: Mon Feb 23, 2004 9:24 am
by Jack Ruby
Cheers Tom, that worked perfectly :)

Thanks a lot m8.

Posted: Mon Feb 23, 2004 10:26 am
by Jack Ruby
Now I have a couple of other problems.
I have a couple of speakers which were working now they are silent. They were working when they were the only thing in the script, I am now working with the tow script and I'm not sure where to insert the start sounds part.

Heres the start sounds thing:


start_sounds:
$speaker loopsound nutcracker
$speaker1 loopsound torture


Heres my complete script:


main:

level.script="maps/obj/MP_nazaire_TOW.scr"

setcvar "g_scoreboardpic" "none"

exec global/ambient.scr
exec global/exploder.scr

exec global/tow_dm.scr
exec global/dm_ai.scr
exec global/friendly.scr

level.gametype = int( getcvar( g_gametype ) )

//gametype 5 = Tug of War
if( level.gametype == 5 )
{
setcvar "g_obj_alliedtext1" "Protect Your Spawn!"
setcvar "g_obj_alliedtext2" "Lower the bridge!"
setcvar "g_obj_alliedtext3" "Blow the fuel tanks"
setcvar "g_obj_alliedtext4" "Close The Tunnel Blast Doors!"
setcvar "g_obj_alliedtext5" "Destroy Axis Transport!"

setcvar "g_obj_axistext1" "Protect Your Transport!"
setcvar "g_obj_axistext2" "Open The Tunnel Blast Doors!"
setcvar "g_obj_axistext3" "Switch Off The Generators!"
setcvar "g_obj_axistext4" "Shut Down The Air Pumps!"
setcvar "g_obj_axistext5" "Destroy Allied Spawn!"
}
else
{
//Not a TOW game remove the bombs
$gmc_bomb remove
$mg42_bomb remove
$bridge_bomb remove
$archway_bomb remove

// set scoreboard messages
setcvar "g_obj_alliedtext1" "The Maginot Line"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" "The Maginot Line"
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""

}

//////////////////////////
level waittill prespawn
//////////////////////////


//////////////////////////
level waittill spawn
//////////////////////////

iprintlnbold_noloc "Welcome to The Maginot Line."

level.bRoundStarted = 0

level.bArtillerySwitchUp = 1
level.bAirStrikeSwitchUp = 1
level.bRadarControlSwitchUp = 1
level.axisFire = 1

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

//bridge stuff
bridge_prep:

$bridge time 3.2
//end



//////////////////////////
//level waittill roundstart
//////////////////////////

//If this is a tug of war game then we init all the TOW stuff
if( level.gametype == 5 )
{
thread init_switches
thread init_spawner_bombs
thread init_tower_lights

//Setup the starting team objectives
thread set_objectives

level.bRoundStarted = 1
}

thread start_generator_sound

end



//----------------------------------------------------------
//Sound for Radar Generator
//----------------------------------------------------------
start_generator_sound:

$gen_sound_speaker loopsound sub_idle1
$gen_sound_speaker1 loopsound MachineLoop2

end


//----------------------------------------------------------
//Destroy the allied spawner here
//----------------------------------------------------------
alliesammodepot local.planter:

iprintln "The Allied spawn has been destroyed!"

//Take over the objective
$Obj_alliesammodepot TakeOver 0

iprintln "The Allied Team can no longer respawn!"

//Give the planter some points
if( local.planter != NULL && local.planter != NIL )
{
local.planter AddKills 5
}

thread Check_End_Match

end

//----------------------------------------------------------
//Destroy the axis spawner here
//----------------------------------------------------------
axisammodepot local.planter:

iprintln "The Axis spawn has been destroyed!"

$Obj_axisammodepot TakeOver 1

iprintln "The Axis Team can no longer respawn!"

//Give the planter some points
if( local.planter != NULL && local.planter != NIL )
{
local.planter AddKills 5
}

thread Check_End_Match

end

//----------------------------------------------------------
//Turn on/off Flak88's
//----------------------------------------------------------
artillerystrike:

if( level.bRoundStarted == 1 )
{
if( parm.other.dmteam == axis )
{
if( $Obj_artillerystrike.ControlledBy != 0 )
{
//Flip the switch
thread artillerystrike_switch

//$artillery_radio_speaker playsound radio_on

$Obj_artillerystrike TakeOver 0
//$tower_lights_02 show

//Call in the artillery strike
thread call_artillery_strike

//Give 2 points for taking objective
parm.other AddKills 2

iprintln "The Axis have opened the tunnel blast doors!"
}
}
else if( parm.other.dmteam == allies )
{
if( $Obj_artillerystrike.ControlledBy != 1 )
{
//Flip the switch
thread artillerystrike_switch

$artillery_radio_speaker playsound radio_off

$Obj_artillerystrike TakeOver 1
$tower_lights_02 hide

//Give 2 points for taking objective
parm.other AddKills 2

iprintln "The Allies have closed the tunnel blast doors!"
}
}

//Did anyone win?
thread Check_End_Match

//Update team current objectives
thread set_objectives
}

end

//----------------------------------------------------------
//Control Radar Dish
//----------------------------------------------------------
radarcontrol:

if( level.bRoundStarted == 1 )
{
if( parm.other.dmteam == axis )
{
if( $Obj_radarcontrol.ControlledBy != 0 )
{
//Flip the switch
thread radarcontrol_switch

$Obj_radarcontrol TakeOver 0

//Give 2 points for taking objective
parm.other AddKills 2

iprintln "The Axis have shut down the generators!"
}
}
else if( parm.other.dmteam == allies )
{
if( $Obj_radarcontrol.ControlledBy != 1 )
{
//Flip the switch
thread radarcontrol_switch

$Obj_radarcontrol TakeOver 1

//Give 2 points for taking objective
parm.other AddKills 2

iprintln "The Allies have turned on the generators!"
}
}

//Did anyone win?
thread Check_End_Match

//Update team current objectives
thread set_objectives
}

end

//----------------------------------------------------------
//Call on/off Airstrikes
//----------------------------------------------------------
airstrike:

if( level.bRoundStarted == 1 )
{
if( parm.other.dmteam == axis )
{
if( $Obj_airstrike.ControlledBy != 0 )
{
//Flip the switch
thread airstrike_switch

$airstrike_radio_speaker playsound radio_off

$Obj_airstrike TakeOver 0

//$tower_lights_01 hide

//Give 2 points for taking objective
parm.other AddKills 2

iprintln "The Axis have shut down the air pumps!"
}
}
else if( parm.other.dmteam == allies )
{
if( $Obj_airstrike.ControlledBy != 1 )
{
//Flip the switch
thread airstrike_switch

$airstrike_radio_speaker playsound radio_on

$Obj_airstrike TakeOver 1

$tower_lights_01 show

//call in the air strike
thread call_air_strike

//Give 2 points for taking objective
parm.other AddKills 2

iprintln "The Allies have powered up the air pumps!"
}

}

//Did anyone win?
thread Check_End_Match

//Update team current objectives
thread set_objectives
}

end


//----------------------------------------------------------
//Set the teams current objectives
//----------------------------------------------------------
set_objectives:

//First lets do the allies
if( $Obj_airstrike.ControlledBy == 0 )
{
$Obj_airstrike SetCurrent 1
}
else if( $Obj_radarcontrol.ControlledBy == 0 )
{
$Obj_radarcontrol SetCurrent 1
}
else if( $Obj_artillerystrike.ControlledBy == 0 )
{
$Obj_artillerystrike SetCurrent 1
}
else if( $Obj_axisammodepot.ControlledBy == 0 )
{
$Obj_axisammodepot SetCurrent 1
}

//Now the Axis
if( $Obj_artillerystrike.ControlledBy == 1 )
{
$Obj_artillerystrike SetCurrent 0
}
else if( $Obj_radarcontrol.ControlledBy == 1 )
{
$Obj_radarcontrol SetCurrent 0
}
else if( $Obj_airstrike.ControlledBy == 1 )
{
$Obj_airstrike SetCurrent 0
}
else if( $Obj_alliesammodepot.ControlledBy == 1 )
{
$Obj_alliesammodepot SetCurrent 0
}

end

//----------------------------------------------------------
//Called when a player tries to open a locked door
//----------------------------------------------------------
doorlocked:

self playsound door_wood_locked1

end

//--------------------------------------------------------------
//Init the switches
//--------------------------------------------------------------
init_switches:

$artillerystrike_switch bind $artillerystrike_origin
$airstrike_switch bind $airstrike_origin
$radarcontrol_switch bind $radarcontrol_origin

//Make the switches non solid so they don't hurt the player when triggered
$artillerystrike_switch notsolid
$artillerystrike_origin notsolid

$airstrike_switch notsolid
$airstrike_origin notsolid

$radarcontrol_switch notsolid
$radarcontrol_origin notsolid

end


//--------------------------------------------------------------
//Turns On/Off Artillery Fire
//--------------------------------------------------------------
artillerystrike_switch:

if( level.bArtillerySwitchUp == 1 )
{
$lockgate moveSouth 544 // To open it
$lockgate move // or waitmove
$artillerystrike_origin speed 1.0
$artillerystrike_origin rotatexdownto 180
$artillerystrike_origin waitmove
$artillerystrike_origin playsound switchbox
level.bArtillerySwitchUp = 0
}
else
{
$lockgate moveNorth 544 // To close it
$lockgate move // or waitmove
$artillerystrike_origin rotatexupto 0
$artillerystrike_origin waitmove
level.bArtillerySwitchUp = 1
}

end

//--------------------------------------------------------------
//Turns On/Off Airstike bombs
//--------------------------------------------------------------
airstrike_switch:

if( level.bAirStrikeSwitchUp == 1 )
{
$bridge rotateZdown 90
$bridge move
$airstrike_origin speed 1.0
$airstrike_origin rotatexdownto 180
$airstrike_origin waitmove
$airstrike_origin playsound switchbox
level.bAirStrikeSwitchUp = 0
}
else
{
$bridge rotateZup 90
$bridge move
$airstrike_origin rotatexupto 0
$airstrike_origin waitmove
level.bAirStrikeSwitchUp = 1
}

end

//--------------------------------------------------------------
//Take control fo Radar for more explosions
//--------------------------------------------------------------
radarcontrol_switch:

if( level.bRadarControlSwitchUp == 1 )
{
$radarcontrol_origin speed 1.0
$radarcontrol_origin rotatexdownto 180
$radarcontrol_origin waitmove
$radarcontrol_origin playsound switchbox
level.bRadarControlSwitchUp = 0
}
else
{
$radarcontrol_origin rotatexupto 0
$radarcontrol_origin waitmove
level.bRadarControlSwitchUp = 1
}

end

//--------------------------------------------------------------
//init the spawner bombs
//--------------------------------------------------------------
init_spawner_bombs:

//Allied spawner bomb
$gmc_bomb thread global/tow_dm.scr::bomb_thinker "axis" maps/obj/MP_nazaire_TOW.scr::alliesammodepot

$mg42_bomb thread global/tow_dm.scr::bomb_thinker "allies" maps/obj/MP_nazaire_TOW.scr::axisammodepot

//Allied bomb (Bridge, not a spawner bomb)
$bridge_bomb thread global/tow_dm.scr::bomb_thinker "axis" maps/obj/MP_nazaire_TOW.scr::bridge_bomb_relay_explode

//Axis bomb (Archway, not a spawner bomb)
$archway_bomb thread global/tow_dm.scr::bomb_thinker "allies" maps/obj/MP_nazaire_TOW.scr::archway_bomb_relay_explode
end

//-----------------------------------------------
// Blow up the truck (Allied Spawner)
//-----------------------------------------------
truck_bomb_relay_explode:

self waittill trigger
thread alliesammodepot

end

//-----------------------------------------------
// Blow up the MG42 (Axis Spawner)
//-----------------------------------------------
mg42_bomb_relay_explode:

self waittill trigger
thread axisammodepot

end

//-----------------------------------------------
// Blow up the bridge (Allied path reduce)
//-----------------------------------------------
bridge_bomb_relay_explode:

thread global/exploder.scr::explode 199

end

//-----------------------------------------------
// Blow up the archway (Axis path reduce)
//-----------------------------------------------
archway_bomb_relay_explode:

thread global/exploder.scr::explode 8

end

//-----------------------------------------------
// Call in the artillery strike
//-----------------------------------------------
call_artillery_strike:

if( self.fire_attack_thread != NIL && self.fire_attack_thread != NULL )
{
//switching targets
self.fire_attack_thread delete
wait 2
}

self.fire_attach_thread = local

while( $Obj_artillerystrike.ControlledBy == 0 )
{
local.rand = randomint $flak_axis_boom.size
if( local.rand <= 0 )
{
local.rand++
}

//local.ent = spawn models/projectiles/Berlin_Bombs.tik origin //$flak_axis_boom[local.rand].origin
local.ent explode

//Delay between explosions
wait 2
}

end

//-----------------------------------------------
// Call in the allied air strike
//-----------------------------------------------
call_air_strike:

if( self.fire_attack_thread != NIL && self.fire_attack_thread != NULL )
{
//switching targets
self.fire_attack_thread delete
wait 2
}

self.fire_attach_thread = local

while( $Obj_airstrike.ControlledBy == 1 )
{
//Plane 1 flypath
local.rand = randomint 3
switch( local.rand )
{
//local.flypath is the path the plane will follow
//local.wait is the delay before it drops it's bombs
case 0:
local.flypath = $plane_path1
local.wait = randomfloat 1.0
local.wait += 2
wait local.wait
break;

case 1:
local.flypath = $plane_path2
local.wait = randomfloat 1.0
local.wait += 2
wait local.wait
break;

case 2:
local.flypath = $plane_path3
local.wait = randomfloat 1.0
local.wait += 2
wait local.wait
break;

case 3:
local.flypath = $plane_path4
local.wait = randomfloat 1.0
local.wait += 2
wait local.wait
break;
}

//Plane 2 flypath
local.rand2 = randomint 3

//Make sure we get a different path.
while( local.rand2 == local.rand )
{
local.rand2 = randomint 3
}

switch( local.rand2 )
{
//local.flypath2 is the path the plane will follow
//local.wait2 is the delay before it drops it's bombs

case 0:
local.flypath2 = $plane_path1
local.wait2 = randomfloat 1.0
local.wait2 += 2
wait local.wait2
break;

case 1:
local.flypath2 = $plane_path2
local.wait2 = randomfloat 1.0
local.wait2 += 2
wait local.wait2
break;

case 2:
local.flypath2 = $plane_path3
local.wait2 = randomfloat 1.0
local.wait2 += 2
wait local.wait2
break;

case 3:
local.flypath2 = $plane_path4
local.wait2 = randomfloat 1.0
local.wait2 += 2
wait local.wait2
break;
}

thread spawn_plane "Plane1" "Plane1_bomb" "Plane1_bomb2" local.flypath local.wait

if( $Obj_radarcontrol.ControlledBy == 1 )
{
wait 1
thread spawn_plane "Plane2" "Plane2_bomb" "Plane2_bomb2" local.flypath2 local.wait2
}

//How long between plane runs
wait 15
}

end



//----------------------------------------------------------
FacingFix:
//
//
// jsl--> Make the axis face the correct way...
//----------------------------------------------------------

self angles "0 0 0"

end


//----------------------------------------------------------
// Allies are enemyspawners with #set 20 with a leader #set 25
// Axis are enemyspawners with #set 10 with a leader #set 15
// all spawners are targeting info_pathnodes
// 2 cameras placed $targetname alliewincamera_1 & alliewincamera_2
//----------------------------------------------------------
win_game_allie:

//hide and freeze the players
$player nodamage
$player hide
freezeplayer

//spawn the allies
waitthread global/dm_ai.scr::spawnset 20 set20
waitthread global/dm_ai.scr::spawnset 25 cappy

//spawn the axis
waitthread global/dm_ai.scr::spawnset 10 set10
waitthread global/dm_ai.scr::spawnset 15 set15

$set10 waitthread FacingFix
$set15 waitthread FacingFix

for( local.i = 1; local.i <= $set10.size; local.i++ )
{
$set10[local.i] thread Do_Loser_End
}

$set15 thread Do_Loser_End

//Turn on the winning music
forcemusic aux2 aux2

//Turn off the hud for the movie
drawhud 0

$alliewincamera_1 watch $alliewincamera_2
$alliewincamera_1 cut
cuecamera $alliewincamera_1

wait 3

for( local.i = 1; local.i <= $set20.size; local.i++ )
{
local.rand = randomfloat .5
local.rand += .5

if( local.i <= $set10.size )
{
$set20[local.i] thread Do_Winner_End local.rand $set10[local.i]
}
else
{
$set20[local.i] thread Do_Winner_End local.rand NULL
}
}

$cappy thread Do_Winner_Allied_Cappy_End 5 $set15

end

//----------------------------------------------------------
// Allies are enemyspawners with #set 30 with a leader #set 35
// Axis are enemyspawners with #set 40 with a leader #set 45
// all spawners are targeting info_pathnodes
// 2 cameras placed $targetname axiswincamera_1 & axiswincamera_2
//----------------------------------------------------------
win_game_axis:

//hide and freeze the players
$player nodamage
$player hide
freezeplayer

//spawn the axis
waitthread global/dm_ai.scr::spawnset 40 set40
waitthread global/dm_ai.scr::spawnset 45 cappy

//spawn the allies
waitthread global/dm_ai.scr::spawnset 30 set30
waitthread global/dm_ai.scr::spawnset 35 set35

drawhud 0

//Start the music
forcemusic aux4 aux4

$axiswincamera_1 speed .3
$axiswincamera_1 fov 70
$axiswincamera_1 follow $axiswincamera_spline $axiswincamera_target
$axiswincamera_1 cut
cuecamera $axiswincamera_1

wait 2.0

//Run the winner threads
for( local.i = 1; local.i <= $set40.size; local.i++ )
{
local.rand = randomfloat 3.0
local.rand += 2.5

if( local.i <= $set30.size )
{
$set40[local.i] thread Do_Winner_End local.rand $set30[local.i]
}
else
{
$set40[local.i] thread Do_Winner_End local.rand NULL
}
}

//run the winners captain thread
$cappy thread Do_Winner_Axis_Cappy_End 5 $set35

wait 1

//run the losers threads
for( local.i = 1; local.i <= $set30.size; local.i++ )
{
$set30[local.i] thread Do_Allie_Loser_End
}

$set35 thread Do_Allie_Loser_End


end


//----------------------------------------------------------
//Do the winner anims and stuff
//----------------------------------------------------------
Do_Winner_End local.wait local.target:

self nodamage
self runto self.target

wait local.wait

self fire

if( local.target != NULL )
{
local.target takedamage
local.target damage NULL 1000 NULL (0 0 0) (0 0 0) (0 0 0) 0 9 0 0
}

end

//----------------------------------------------------------
//Do the winners captain end sequence
//----------------------------------------------------------
Do_Winner_Allied_Cappy_End local.wait local.target:

self nodamage
self runto self.target

local.rand = randomfloat 1.5
local.rand += .5

self fire

level.axisFire = 0

if( local.target != NULL )
{
local.target takedamage
local.target damage NULL 1000 NULL (0 0 0) (0 0 0) (0 0 0) 0 9 0 0
}

wait 3.5

$alliewincamera_2 watch $cappy
$alliewincamera_2 fov 40
$alliewincamera_2 cut
cuecamera $alliewincamera_2

wait 2

//dprintln "Playing Cappy end anim"
self anim 00A001_victory

wait 2

//Allies have won
teamwin allies

//fade out the music
forcemusic aux3 aux3

wait 5

end


//----------------------------------------------------------
//Do the winners captain end sequence
//----------------------------------------------------------
Do_Winner_Axis_Cappy_End local.wait local.target:

self nodamage
self runto self.target

wait local.wait

self fire

if( local.target != NULL )
{
local.target takedamage
local.target damage NULL 1000 NULL (0 0 0) (0 0 0) (0 0 0) 0 9 0 0
}

wait 5

self anim 00A001_victory

//Axis have won
teamwin axis

//fade out the music
forcemusic aux5 aux5

wait 5

end


//----------------------------------------------------------
//Axis end, they fire and die
//----------------------------------------------------------
Do_Loser_End:

self nodamage
self aimat $airstrike_origin

//self runto self.target
while ( level.axisFire == 1 )
{
local.delay = randomfloat 1.5
local.delay += .5

wait local.delay
self fire
}

end

//----------------------------------------------------------
//Allies run away
//----------------------------------------------------------
Do_Allie_Loser_End:

self nodamage
self runto self.target

end

//-----------------------------------------------
// init the objectives
//-----------------------------------------------
Check_End_Match:

local.nAxis = 0
local.nAllied = 0

//Allied ammo depot
if( $Obj_alliesammodepot.ControlledBy == 0 )
{
local.nAxis++
}
else if( $Obj_alliesammodepot.ControlledBy == 1 )
{
local.nAllied++
}

//Axis ammo depot
if( $Obj_axisammodepot.ControlledBy == 0 )
{
local.nAxis++
}
else if( $Obj_axisammodepot.ControlledBy == 1 )
{
local.nAllied++
}

//Artillery Strike
if( $Obj_artillerystrike.ControlledBy == 0 )
{
local.nAxis++
}
else if( $Obj_artillerystrike.ControlledBy == 1 )
{
local.nAllied++
}

//Radar
if( $Obj_radarcontrol.ControlledBy == 0 )
{
local.nAxis++
}
else if( $Obj_radarcontrol.ControlledBy == 1 )
{
local.nAllied++
}

//Air strike
if( $Obj_airstrike.ControlledBy == 0 )
{
local.nAxis++
}
else if( $Obj_airstrike.ControlledBy == 1 )
{
local.nAllied++
}

//Allies first
if( local.nAllied == level.numObjectives )
{
//Only show the movie if the wingame cvar has not been set yet.
local.winstate = int( getcvar( g_TOW_winstate ) )
if( local.winstate == 0 )
{
setcvar "g_TOW_winstate" "1"

//ignore the clock
level ignoreclock 1

//if there is a bomb ticking stop it.
waitthread global/tow_dm.scr::StopBomb

//Allies win play the movie
thread win_game_allie
}
}
else if( local.nAxis == level.numObjectives )
{
//Only show the movie if the wingame cvar has not been set yet.
local.winstate = int( getcvar( g_TOW_winstate ) )
if( local.winstate == 0 )
{
setcvar "g_TOW_winstate" "1"

//ignore the clock
level ignoreclock 1

//if there is a bomb ticking stop it.
waitthread global/tow_dm.scr::StopBomb

//Axis win do their movie and end the map
thread win_game_axis
}
}

end


Posted: Tue Feb 24, 2004 5:00 am
by nuggets
is any of the script working? if not post the logfile

one thing i noticed

//Make sure we get a different path.
while( local.rand2 == local.rand )
{
local.rand2 = randomint 3
}

should be

//Make sure we get a different path.
while( local.rand2 == local.rand )
{
local.rand2 = randomint 4
}


otherwise it won't choose the final path route

Posted: Tue Feb 24, 2004 11:08 am
by Jack Ruby
Cheers for your interest Nuggets :)

I stole that whole script from berlin and have now used it for Peenemunde and Maginot now its gonna be Saint Nazaire too. I am crap at scripting and hardly any of it makes sense to me so I am not sure what the part you posted is meant to do, all I can say is the script I posted seems to be working perfectly.

However :) One of the tow objectives, the Radar one, its a regular tow style switch that can change hands between teams ( they have to control it to win the match ). This is not what I need, I want to convert that switch into a bomb to destroy some fuel tanks that I have not built yet.

If you look at the spawn bombs they register as tow objectives, is there any way to change that Radar one into something similar to the spawn bombs ?

Also that start sounds thing, where should I insert that into the script ?

Thanks a lot for your help :)

prespawn

Posted: Tue Feb 24, 2004 11:45 am
by tltrude
Try starting your sound thread under prespawn and then add a one second wait in the thread before they start. The bottom of the page will be fine.

start_sounds:
wait 1
$speaker loopsound nutcracker
$speaker1 loopsound torture
end

Posted: Tue Feb 24, 2004 2:34 pm
by Jack Ruby
Tom I cant get that sounds thing to work.

Would it be possible for you to take a look at this zip ?

Also I am having another problem, when the winners animation sequence comes on there should be a piece of music played ( not custom just regular mohaa music) but it does not seem to be working. In fact the winners animations are pretty plain and boring, I would love you or someone to spice them up a bit, could I twist your arm to tweak this for me ?

heres a zip incase you have the time and inclination to play around with it. Grab it HERE 3.5mb

Nice one.

Posted: Tue Feb 24, 2004 7:38 pm
by Jack Ruby
:oops: I am an idiot, all this time I didnt have the precache.scr in there. So the custom sounds are working fine now.

The winning animation music still does not see to be present :(

ok

Posted: Wed Feb 25, 2004 8:07 am
by tltrude
I'll have a look.

aux2

Posted: Wed Feb 25, 2004 10:37 am
by tltrude
Ok, your line "forcemusic aux2 aux2" is calling for aux2 from the m1l3a.mus file to be played--sound of a higgens boat. And, of course, that is a Mohaa file. It is looking for that file becuse of this line at the top of your script.

exec global/ambient.scr m1l3a


You can make your own .mus file, or try using one for Spearhead. This is how it is set up in the Druckkammern script.

level.music="MP_Druckkammern_TOW"
exec global/ambient.scr

Hope that helps!

Posted: Wed Feb 25, 2004 10:55 am
by Jack Ruby
Thanks Tom.

I have been trying to get that winning sequence music to play using a .mus file. Its copied from the Berlin.mus. Still not having any success with it.

Heres the script:

path sound/amb_stereo

path sound/music
aux2 mus_allies_success.mp3
aux3 mus_allies_success.mp3
aux4 mus_axis_success.mp3
aux5 mus_axis_success.mp3

!normal volume 1.0
!normal loop
!normal fadetime 1.0

!aux1 volume 1.0
!aux1 loop

!aux2 volume 1.0
!aux2 fadetime 5.0
!aux2 restart

!aux3 volume 0.0
!aux3 fadetime 5.0

!aux4 volume 1.0
!aux4 fadetime 5.0
!aux4 restart

!aux5 volume 0.0
!aux5 fadetime 5.0

Spearhead

Posted: Wed Feb 25, 2004 11:46 am
by tltrude
I don't have all the Spearhead files or have the game installed, so I can't test it.

What is the difference between your file and the berlin.mus file?
What is your .mus file named?
How is your .mus file called in the main script?
Are those music file in sound/amb_stereo or are they in sound/music?--you have two paths.

Your .mus file should also have, "normal normal" because that is the background sound.

As a test, try these lines at the top of your script.

level.music="MP_Berlin_TOW"
exec global/ambient.scr

Posted: Wed Feb 25, 2004 1:54 pm
by Jack Ruby
Tom, your idea of using the level.music="MP_Berlin_TOW" worked perfectly.

Cant tell you how grateful I am for your help

thanks BIG time :)