TOW Objectives

Post your scripting questions / solutions here

Moderator: Moderators

nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

send me the .map!!!

yes i'm still alive, just depressed :)
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
Jack Ruby
General
Posts: 1443
Joined: Fri Feb 07, 2003 12:20 am
Location: london

Post by Jack Ruby »

I mailed you the .map
Philip II of Macedon sent a message to Sparta:
"If I win this war, you will be slaves forever."
The Spartan ephors sent back a one word reply: "If".
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

i've got it, not cracked it, but i've got it, leave it with me!!!
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
Jack Ruby
General
Posts: 1443
Joined: Fri Feb 07, 2003 12:20 am
Location: london

Post by Jack Ruby »

Someone mentioned that there were " Unbalanced brackets in "What's left "

Maybe this might help :wink:
Philip II of Macedon sent a message to Sparta:
"If I win this war, you will be slaves forever."
The Spartan ephors sent back a one word reply: "If".
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

/*don't b silly, no problems with brackets in my .scr's!!! it seems some1 4got to take out an undefined thread!!! :oops:

anyway... on a lighter note :D, it's 99% there!!!
*/

//the whole script
//you can just stick this whole script in

main:
level.script = "maps/obj/MP_peenemunde_TOWnuggets.scr"
exec global/tow_dm.scr
exec global/ambient.scr m5l1b

//level.gametype = int( getcvar( g_gametype ) ) //don't know where you got this from???
//gametype 5 = Tug of War
level.gametype = 5
if ( level.gametype == 5 )
{
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Cut factory electrics"
setcvar "g_obj_alliedtext2" "Turn fuel pumps on"
setcvar "g_obj_alliedtext3" "Disable tracking radar"
setcvar "g_obj_axistext1" "Get factory electrics on"
setcvar "g_obj_axistext2" "Turn the fuel pumps on"
setcvar "g_obj_axistext3" "Enable tracking radar"
}
else
{
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Peenemunde"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" "Death! or Glory?"
setcvar "g_obj_axistext1" "Peenemunde"
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" "Death! or Glory?"
//Not a TOW game remove the bombs
$allie_bomb remove
$axis_bomb remove
}

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

//////////////////////////
level waittill spawn
//////////////////////////
iprintlnbold_noloc "Welcome to [Spec Ops] JACK RUBY's house"
level.nuggetsObjectives = 0 //no objectives completed
level.switch1owner = 0 //0 meaning neutral
level.switch2owner = 0
level.switch3owner = 0
level.bRoundStarted = 0
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 = 3 // Number of objectives needed to

//////////////////////////
//level waittill roundstart
//////////////////////////
//If this is a tug of war game then we init all the TOW stuff
if( level.gametype == 5 )
{
//Initialize the bombs and lights
thread init_spawner_bombs
thread init_switch_lights
level.bRoundStarted = 1
}
end

////////////////////////////
// init the spawner bombs //
////////////////////////////

init_spawner_bombs:
//Allied spawner bomb
$axis_bomb thread global/tow_dm.scr::bomb_thinker "axis" maps/obj/MP_Tutorial_TOW.scr::alliesspawnpoint
$allie_bomb thread global/tow_dm.scr::bomb_thinker "allies" maps/obj/MP_Tutorial_TOW.scr::axisspawnpoint
end

//////////////////////
// hides the lights //
//////////////////////

init_switch_lights:
$obj2_light_allie hide
$obj2_light_axis hide
$obj3_light_allie hide
$obj3_light_axis hide
$obj4_light_allie hide
$obj4_light_axis hide
end

//////////////////
// the switches //
//////////////////

switch1:
if ( level.bRoundStarted == 1 )
{
if ( parm.other.dmteam == axis )
{
if (( level.switch1owner == 1 ) || ( level.switch1owner == 0 )) //1 meaning allies //0 meaning neutral
{
$obj2_light_allie hide
$obj2_light_axis show
iprintlnbold_noloc "The Axis turned on the factory electricity!"
setcvar "g_obj_alliedtext1" "Cut factory electrics"
setcvar "g_obj_axistext1" "Keep factory electrics on [x]"
level.switch1owner = -1
}
}
else
if ( parm.other.dmteam == allies )
{
if (( level.switch1owner == -1 ) || ( level.switch1owner == 0 )) //-1 meaning axis
{
$obj2_light_axis hide
$obj2_light_allie show
iprintlnbold_noloc "The Allies turned off the factory electricity!!"
setcvar "g_obj_alliedtext1" "Keep factory electrics off [x]"
setcvar "g_obj_axistext1" "Get factory electrics on"
level.switch1owner = 1
}
}
//Update team current objectives
waitthread nCheck_End_Match
}
end

switch2:
if ( level.bRoundStarted == 1 )
{
if ( parm.other.dmteam == axis )
{
if (( level.switch2owner == 1 ) || ( level.switch2owner == 0 ))
{
$obj3_light_allie hide
$obj3_light_axis show
iprintlnbold_noloc "The Axis turned on the factory electricity!"
setcvar "g_obj_alliedtext2" "Turn fuel pumps off"
setcvar "g_obj_axistext2" "Keep fuel pumps on [x]"
level.switch2owner = -1
}
}
else
if ( parm.other.dmteam == allies )
{
if (( level.switch2owner == -1 ) || ( level.switch2owner == 0 ))
{
$obj2_light_axis hide
$obj2_light_allie show
iprintlnbold_noloc "The Allies turned off the factory electricity!!"
setcvar "g_obj_alliedtext2" "Keep fuel pumps off [x]"
setcvar "g_obj_axistext2" "Turn fuel pumps on"
level.switch2owner = 1
}
}
//Update team current objectives
waitthread nCheck_End_Match
}
end

switch3:
if ( level.bRoundStarted == 1 )
{
if ( parm.other.dmteam == axis )
{
if (( level.switch3owner == 1 ) || ( level.switch3owner == 0 ))
{
$obj3_light_allie hide
$obj3_light_axis show
iprintlnbold_noloc "The Axis turned on the factory electricity!"
setcvar "g_obj_alliedtext3" "Enable tracking radar"
setcvar "g_obj_axistext3" "Keep tracking radar off [x]"
level.switch3owner = -1
}
}
else
if ( parm.other.dmteam == allies )
{
if (( level.switch3owner == -1 ) || ( level.switch3owner == 0 )) //-1 meaning axis
{
$obj4_light_axis hide
$obj4_light_allie show
iprintlnbold_noloc "The Allies turned off the factory electricity!!"
setcvar "g_obj_alliedtext3" "Keep factory electrics on [x]"
setcvar "g_obj_axistext3" "Disable tracking radar"
level.switch3owner = 1
}
}
//Update team current objectives
waitthread nCheck_End_Match
}
end

/////////////////////
// objective check //
/////////////////////

nCheck_End_Match:
level.nuggetsObjectives = ( level.switch1owner + level.switch2owner + level.switch3owner )
//iprintlnbold_noloc "what's the magic number " level.nuggetsObjectives //if this never reaches 3 or -3 then i have a few more problems
if ( level.nuggetsObjectives == 3 ) //meaning allies have reached all their objectives
{
//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
teamwin allies
}
if ( level.nuggetsObjectives == -3 ) //meaning axis have reached all their objectives
{
//level ignoreclock 1
waitthread global/tow_dm.scr::StopBomb
teamwin axis
}
end

//-----------------------------------------------
// Blow up Allies Spawner
//-----------------------------------------------
axis_bomb_relay_explode:
iprintln "The Axis Spawn Point has been Destroyed!"
iprintln "The Axis Team Can No Longer Respawn!"
//$Obj_alliesspawnpoint TakeOver 1
end

//-----------------------------------------------
// Blow up Axis Spawner
//-----------------------------------------------
allie_bomb_relay_explode:
iprintln "The Allies Spawn Point has been Destroyed!"
iprintln "The Allies Team Can No Longer Respawn!"
//$Obj_axisspawnpoint TakeOver 0
end

/**
you can probably tell the bombs don't do anything as of yet... but you can win/lose now :D that's the main thing :D:D:D:D:D
*/
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
Jack Ruby
General
Posts: 1443
Joined: Fri Feb 07, 2003 12:20 am
Location: london

Post by Jack Ruby »

Top Man Nuggets, sorry I cant be more help, nice one mate .
Philip II of Macedon sent a message to Sparta:
"If I win this war, you will be slaves forever."
The Spartan ephors sent back a one word reply: "If".
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

check the setthreads on the triggers around the bombs

i've had 2 edit some of the lines in the objectives as they were too many characters

and if you really really want to make the bombs blow up each others spawn points i'll have to take apart a global script and create you a new one, there's only supposed 2 b 1 planting team and 1 defusing team :(

is TOW an option with SH??? i've also had 2 edit the code a bit so it will work the line
level.gametype = int ( getcvar ( g_gametype )) always returned NIL no matter what i was editing... :?:

anyway play away mate :D
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
Jack Ruby
General
Posts: 1443
Joined: Fri Feb 07, 2003 12:20 am
Location: london

Post by Jack Ruby »

Nice one mate. Yeah TOW is a SH option, below I have pasted a script from an original Spearhead TOW map, the maps called Flughafen ( think it means airport in German) theres 3 switches that can change hands and theres also a bomb at each teams respawn, not sure if this will help you out any but I am sure it will give you some idea as to what they are doing with them spawn bombs,

// MP_Flughafen_TOW
// Note: For objective function calls TakeOver and SetCurrent the
// teams are as such:
// 0 = Axis
// 1 = Allies
// 2 = Neutral

//----------------------------------------------------------
// Main
//----------------------------------------------------------
main:
exec global/ai.scr
exec global/friendly.scr

level.script="maps/obj/MP_Flughafen_TOW.scr"
level.music="MP_Flughafen_TOW"

setcvar "g_scoreboardpic" "mp_flughafen_tow"

exec global/tow_dm.scr
exec global/ambient.scr
exec global/door_locked.scr

level.gametype = int( getcvar( g_gametype ) )

//gametype 5 = Tug of War
if( level.gametype == 5 )
{
setcvar "g_obj_alliedtext1" "Protect Allied Transport"
setcvar "g_obj_alliedtext2" "Open 1st Hangar Doors"
setcvar "g_obj_alliedtext3" "Turn On the Runway Lights"
setcvar "g_obj_alliedtext4" "Open the 2nd Hangar Doors"
setcvar "g_obj_alliedtext5" "Detonate Axis Motorpool"

setcvar "g_obj_axistext1" "Protect Axis Motorpool"
setcvar "g_obj_axistext2" "Close the 2nd Hangar Doors"
setcvar "g_obj_axistext3" "Turn Off the Runway Lights"
setcvar "g_obj_axistext4" "Close the 1st Hangar Doors"
setcvar "g_obj_axistext5" "Destroy Allied Transport"
}
else
{
$gmc_bomb remove
$opel_bomb remove

// set scoreboard messages
setcvar "g_obj_alliedtext1" "Flughafen"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""
}

//set our farplane and culling parameters
$world farplane 3000
$world farplane_color ".03 .05 .09" //this matches eben's new sky
$world farplane_cull 2

//Open the hangar 1 doors
$hangar_doors_1 open $hangar_doors_1_entity

// open these doors at the start...
$cine_hangar_doors open $cine_hangar_doors_entity

//Turn off the lights!
thread init_runway_lights

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

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

//init aagun params
$aagun.collisionent = $aagun_collision
$aagun_turret0.collisionent = $aagun_turret_collision
$aagun thread global/stationaryweapons.scr::MountedStationaryWeaponWithCollision "models/statweapons/p_aagun_d.tik" $aagun_destroyed_collision

//init granatwefer 1 params

$granat_1.collisionent = $granatwerfer_collision
$granat_1_turret0.collisionent = $granatwerfer_turret_collision
$granat_1 thread global/stationaryweapons.scr::MountedStationaryWeaponWithCollision "models/statweapons/p_granatwerfer_d.tik" $granatwerfer_destroyed_collision
$granat_1_turret0 maxyawoffset "40"


//init granatwefer 2 params
$granat_2.collisionent = $granatwerfer_collision
$granat_2_turret0.collisionent = $granatwerfer_turret_collision
$granat_2 thread global/stationaryweapons.scr::MountedStationaryWeaponWithCollision "models/statweapons/p_granatwerfer_d.tik" $granatwerfer_destroyed_collision
$granat_2_turret0 maxyawoffset "40"



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

level.hangar1_switch_up = 1
level.hangar2_switch_up = 1
level.runway_switch_up = 1

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

//If we are in TOW mode setup the TOW stuff...
if( level.gametype == 5 )
{
thread init_switches
thread init_spawner_bombs

//Flip the hangar switch
thread toggle_hangar_1_doors_switch

//Setup the starting team objectives
thread set_objectives

level.bRoundStarted = 1
}

end


//----------------------------------------------------------
//Destroy the Allied spawner here
//----------------------------------------------------------
destroy_allied_spawner:

iprintln "The Allied transport has been destroyed!"

//Take over the objective
$obj_allied_spawner TakeOver 0

iprintln "The Allied Team can no longer respawn!"

thread Check_End_Match

end

//----------------------------------------------------------
//Destroy the Axis spawner here
//----------------------------------------------------------
destroy_axis_spawner:

iprintln "The Axis Motorpool has been destroyed!"

//Take over the objective
$obj_axis_spawner TakeOver 1

iprintln "The Axis Team can no longer respawn!"

thread Check_End_Match

end

//----------------------------------------------------------
//Open/close the 1st Hangar Doors here
//----------------------------------------------------------
toggle_hangar_doors_1:

if( level.bRoundStarted == 1 )
{
if( parm.other.dmteam == axis )
{
if( $obj_hangar_doors_1.ControlledBy != 0 )
{
//flip the switch
thread toggle_hangar_1_doors_switch

//Close the hangar doors
$hangar_doors_1 close $hangar_doors_1_entity
$hangar_doors_1 playsound hanger_closed

$obj_hangar_doors_1 TakeOver 0

iprintln "The Axis have closed the 1st Hangar Doors!"
}
}
else if( parm.other.dmteam == allies )
{
if( $obj_hangar_doors_1.ControlledBy != 1 )
{
//flip the switch
thread toggle_hangar_1_doors_switch

//Open the pen doors
$hangar_doors_1 open $hangar_doors_1_entity
$hangar_doors_1 playsound hanger_open

$obj_hangar_doors_1 TakeOver 1

iprintln "The Allies have opened the 1st Hangar Doors!"
}
}


//Did anyone win?
thread Check_End_Match

//Update team current objectives
thread set_objectives
}

end

//----------------------------------------------------------
//Open/close the 2st Hangar Doors here
//----------------------------------------------------------
toggle_hangar_doors_2:

if( level.bRoundStarted == 1 )
{
if( parm.other.dmteam == axis )
{
if( $obj_hangar_doors_2.ControlledBy != 0 )
{
//flip the switch
thread toggle_hangar_2_doors_switch

//Close the hangar doors
$hangar_doors_2 close $hangar_doors_2_entity
$hangar_doors_2 playsound hanger_closed

$obj_hangar_doors_2 TakeOver 0

iprintln "The Axis have closed the 2nd Hangar Doors!"
}
}
else if( parm.other.dmteam == allies )
{
if( $obj_hangar_doors_2.ControlledBy != 1 )
{
//flip the switch
thread toggle_hangar_2_doors_switch

//Open the hangar doors
$hangar_doors_2 open $hangar_doors_2_entity
$hangar_doors_2 playsound hanger_open

$obj_hangar_doors_2 TakeOver 1

iprintln "The Allies have opened the 2nd Hangar Doors!"
}
}

//Did anyone win?
thread Check_End_Match

//Update team current objectives
thread set_objectives
}

end

//----------------------------------------------------------
//Turn on/Shut down the runway lights
//----------------------------------------------------------
toggle_runway_lights:

if( level.bRoundStarted == 1 )
{
if( parm.other.dmteam == allies )
{
if( $obj_runway_lights.ControlledBy != 1 )
{
//flip the switch
thread toggle_runway_switch

waitthread turn_on_runway_lights

//Take the objective
$obj_runway_lights TakeOver 1

iprintln "The Allies have turned on the Runway Lights!"
}
}
else if( parm.other.dmteam == axis )
{
if( $obj_runway_lights.ControlledBy != 0 )
{
//flip the switch
thread toggle_runway_switch

waitthread turn_off_runway_lights

//Take the objective
$obj_runway_lights TakeOver 0

iprintln "The Axis have turned off the Runway Lights!"
}
}

//Did anyone win?
thread Check_End_Match

//Update team current objectives
thread set_objectives
}

end

//----------------------------------------------------------
//Initialize the runway lights
//----------------------------------------------------------
init_runway_lights:

$run_lights_01 hide
$run_lights_02 hide
$run_lights_03 hide
$run_lights_04 hide
$run_lights_05 hide
$run_lights_06 hide
$run_lights_07 hide
$run_lights_08 hide
$run_lights_09 hide
$run_lights_10 hide
$run_lights_11 hide
$run_lights_12 hide

end

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

//First lets do the allies
if( $obj_hangar_doors_1.ControlledBy == 0 )
{
$obj_hangar_doors_1 SetCurrent 1
}
else if( $obj_runway_lights.ControlledBy == 0 )
{
$obj_runway_lights SetCurrent 1
}
else if( $obj_hangar_doors_2.ControlledBy == 0 )
{
$obj_hangar_doors_2 SetCurrent 1
}
else if( $obj_axis_spawner.ControlledBy == 0 )
{
$obj_axis_spawner SetCurrent 1
}

//Now the Axis
if( $obj_hangar_doors_2.ControlledBy == 1 )
{
$obj_hangar_doors_2 SetCurrent 0
}
else if( $obj_runway_lights.ControlledBy == 1 )
{
$obj_runway_lights SetCurrent 0
}
else if( $obj_hangar_doors_1.ControlledBy == 1 )
{
$obj_hangar_doors_1 SetCurrent 0
}
else if( $obj_allied_spawner.ControlledBy == 1 )
{
$obj_allied_spawner SetCurrent 0
}

end

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

//Allied spawner bomb
$gmc_bomb thread global/tow_dm.scr::bomb_thinker "axis" maps/obj/MP_Flughafen_TOW.scr::destroy_allied_spawner
$opel_bomb thread global/tow_dm.scr::bomb_thinker "allies" maps/obj/MP_Flughafen_TOW.scr::destroy_axis_spawner

end


//----------------------------------------------------------
//init the trigger switches
//----------------------------------------------------------
init_switches:

$hangar_doors_1_switch bind $hangar_doors_1_switch_origin
$hangar_doors_2_switch bind $hangar_doors_2_switch_origin
$runway_switch bind $runway_switch_origin

//make all the switches non solid so as not to injure the player when triggered.
$hangar_doors_1_switch notsolid
$hangar_doors_1_switch_origin notsolid

$hangar_doors_2_switch notsolid
$hangar_doors_2_switch_origin notsolid

$runway_switch notsolid
$runway_switch_origin notsolid

end

//--------------------------------------------------------------
//Open hangar 1 doors
//--------------------------------------------------------------
toggle_hangar_1_doors_switch:

if( level.hangar1_switch_up == 1 )
{
$hangar_doors_1_switch_origin speed 1.0
$hangar_doors_1_switch_origin rotatezdownto 180
$hangar_doors_1_switch_origin waitmove
$hangar_doors_1_switch_origin playsound switchbox
level.hangar1_switch_up = 0
}
else
{
$hangar_doors_1_switch_origin speed 1.0
$hangar_doors_1_switch_origin rotatezupto 0
$hangar_doors_1_switch_origin waitmove
$hangar_doors_1_switch_origin playsound switchbox
level.hangar1_swith_up = 1
}

end

//--------------------------------------------------------------
//Open hangar 2 doors
//--------------------------------------------------------------
toggle_hangar_2_doors_switch:

if( level.hangar2_switch_up == 1 )
{
$hangar_doors_2_switch_origin speed 1.0
$hangar_doors_2_switch_origin rotatezdownto 180
$hangar_doors_2_switch_origin waitmove
$hangar_doors_2_switch_origin playsound switchbox
level.hangar2_switch_up = 0
}
else
{
$hangar_doors_2_switch_origin speed 1.0
$hangar_doors_2_switch_origin rotatezupto 0
$hangar_doors_2_switch_origin waitmove
$hangar_doors_2_switch_origin playsound switchbox
level.hangar2_switch_up = 1
}

end

//--------------------------------------------------------------
//Turn on Runway Lights
//--------------------------------------------------------------
toggle_runway_switch:

if( level.runway_switch_up == 1 )
{
$runway_switch_origin speed 1.0
$runway_switch_origin rotatezdownto 180
$runway_switch_origin waitmove
$runway_switch_origin playsound switchbox
level.runway_switch_up = 0
}
else
{
$runway_switch_origin speed 1.0
$runway_switch_origin rotatezupto 0
$runway_switch_origin waitmove
$runway_switch_origin playsound switchbox
level.runway_switch_up = 1
}

end

//-----------------------------------------------
// Turn off the runway lights
//-----------------------------------------------
turn_on_runway_lights:

//Turn on the lights
$run_lights_01 show
$run_lights_01 playsound runway_lights_on
wait .2
$run_lights_02 show
$run_lights_02 playsound runway_lights_on
wait .2
$run_lights_03 show
$run_lights_03 playsound runway_lights_on
wait .2
$run_lights_04 show
$run_lights_04 playsound runway_lights_on
wait .2
$run_lights_05 show
$run_lights_05 playsound runway_lights_on
wait .2
$run_lights_06 show
$run_lights_06 playsound runway_lights_on
wait .2
$run_lights_07 show
$run_lights_07 playsound runway_lights_on
wait .2
$run_lights_08 show
$run_lights_08 playsound runway_lights_on
wait .2
$run_lights_09 show
$run_lights_09 playsound runway_lights_on
wait .2
$run_lights_10 show
$run_lights_10 playsound runway_lights_on
wait .2
$run_lights_11 show
$run_lights_11 playsound runway_lights_on
wait .2
$run_lights_12 show
$run_lights_12 playsound runway_lights_on

end

//-----------------------------------------------
// Turn off the runway lights
//-----------------------------------------------
turn_off_runway_lights:

//Turn off the lights
$run_lights_01 hide
$run_lights_01 playsound runway_lights_off
wait .2
$run_lights_02 hide
$run_lights_02 playsound runway_lights_off
wait .2
$run_lights_03 hide
$run_lights_03 playsound runway_lights_off
wait .2
$run_lights_04 hide
$run_lights_04 playsound runway_lights_off
wait .2
$run_lights_05 hide
$run_lights_05 playsound runway_lights_off
wait .2
$run_lights_06 hide
$run_lights_06 playsound runway_lights_off
wait .2
$run_lights_07 hide
$run_lights_07 playsound runway_lights_off
wait .2
$run_lights_08 hide
$run_lights_08 playsound runway_lights_off
wait .2
$run_lights_09 hide
$run_lights_09 playsound runway_lights_off
wait .2
$run_lights_10 hide
$run_lights_10 playsound runway_lights_off
wait .2
$run_lights_11 hide
$run_lights_11 playsound runway_lights_off
wait .2
$run_lights_12 hide
$run_lights_12 playsound runway_lights_off

end

//-----------------------------------------------
// Check for end match condition
//-----------------------------------------------
Check_End_Match:

local.nAxis = 0

//Allied Spawner
if( $obj_allied_spawner.ControlledBy == 0 )
{
local.nAxis++
}

//Axis Spawner
if( $obj_axis_spawner.ControlledBy == 0 )
{
local.nAxis++
}

//Hangar Doors 1
if( $obj_hangar_doors_1.ControlledBy == 0 )
{
local.nAxis++
}

//Hangar Doors 2
if( $obj_hangar_doors_2.ControlledBy == 0 )
{
local.nAxis++
}

//Runway lights
if( $obj_runway_lights.ControlledBy == 0 )
{
local.nAxis++
}

//Allies first
if( $obj_runway_lights.ControlledBy == 1 && $obj_hangar_doors_1.ControlledBy == 1 && $obj_hangar_doors_2.ControlledBy == 1 )
{
//ignore the clock
level ignoreclock 1

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

//Allies win do the movie then end the map
thread AlliesWon
}
else if( local.nAxis == level.numObjectives )
{
//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 AxisWon
}

end

//-------------------------------------------------------------
// Do the Allied camera stuff
//-------------------------------------------------------------
DoAlliedCamera local.ent:

local.camera = spawn func_camera origin $cam01.origin angles $cam01.angles

local.camera fov 100
local.camera watch local.ent
local.camera cut
cuecamera local.camera

end

//-------------------------------------------------------------
// when allies win, we watch the two planes take off and do a
// fly-by passed each other....
//-------------------------------------------------------------
AlliesWon:

$player nodamage
$player hide
freezeplayer

level ignoreclock 1

forcemusic aux2 aux2

local.plane = spawn script_model model vehicles/ho-ix.tik origin $p00.origin angles $p00.angles
local.plane notsolid
local.plane thread TakeOff $p00

thread DoAlliedCamera local.plane

local.plane2 = spawn script_model model vehicles/ho-ix.tik origin $p_00.origin angles $p_00.angles
local.plane2 waitthread TakeOff $p_00

forcemusic aux3 aux3

teamwin allies

wait 5

end

//-------------------------------------------------------------
// have the plane take off
//-------------------------------------------------------------
TakeOff local.path:

self notsolid
self playsound plane // todo: more appropriate sound maybe?
thread RaiseLandingGear
self followpath local.path
self waitmove
self delete

end

//--------------------------------------------------------------
// Raise the landing gear
//--------------------------------------------------------------
RaiseLandingGear:
wait 2

self anim takeoff


end


//-------------------------------------------------------------
// Watch the allies run by while the germans shoot at them...
// much like berlin's ending....
// open hanger door?
//-------------------------------------------------------------
AxisWon:

$player nodamage
$player hide
freezeplayer

forcemusic aux4 aux4

local.camera = spawn func_camera origin $axiswincam.origin angles $axiswincam.angles

local.camera cut
cuecamera local.camera

waitthread global/ai.scr::spawnset 30 set30
waitthread global/ai.scr::spawnset 40 set40

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

wait 0.75
for (local.i=1;local.i<=$set40.size;local.i++)
{
$set40[local.i] thread Chase
}

wait 7

$cine_hangar_doors close $cine_hangar_doors_entity

wait 8

forcemusic aux5 aux5

teamwin axis

wait 5

end

//-------------------------------------------------------------
//RunAway dudes running away
//-------------------------------------------------------------
RunAway:

self exec global/disable_ai.scr
self nodamage
self runto self.target

end

//-------------------------------------------------------------
// Chase dudes chasing the dudes running away..
//-------------------------------------------------------------
Chase local.target:

self exec global/disable_ai.scr
self nodamage
self runto self.target

self thread FireShots $set30[1]

end

//-------------------------------------------------------------
// Fire!
//-------------------------------------------------------------
FireShots local.target:

self aimat local.target

while ( isAlive self )
{
local.rand = randomfloat 0.75
local.rand += 0.2

wait local.rand
self fire
}

end


Hope that helps man, I am gonna be busy for a couple weeks working on the Motorola website so if I dont make it back to speak much its just I am busy, I dont want to go to work :(

Again nice one Nuggets,
Philip II of Macedon sent a message to Sparta:
"If I win this war, you will be slaves forever."
The Spartan ephors sent back a one word reply: "If".
User avatar
Jack Ruby
General
Posts: 1443
Joined: Fri Feb 07, 2003 12:20 am
Location: london

Post by Jack Ruby »

Nuggets, in the new map page, someone has made a new TOW map, sure you saw it if not heres what he has done,

OBJECTIVES: This IS a TOW map. There are NO-NO-NO spawn related bombs! There are five objectives, including each sides 'HQ'. IF one side can occupy the opposing teams HQ and 'flip' the switch, they are able to 'prevent' reinforcements/new spawns...they then need to find and eliminate the remaining enemy players while STILL controlling the 'HQ'. The HQ can be repeatedly liberated and lost throughout the game. More of a see-saw battle in which you MUST attack and you MUST defend.

Sounds good to me man, we could forget those stressful spawn bombs and turn them into objectives, what ya reckon ?
Philip II of Macedon sent a message to Sparta:
"If I win this war, you will be slaves forever."
The Spartan ephors sent back a one word reply: "If".
Slyk
Lieutenant Colonel
Posts: 361
Joined: Sun Jul 14, 2002 12:42 am
Location: Elizabethtown, PA

Post by Slyk »

Ruby----That map in your last post is MINE. I decided to do away with the 'auto' spawn elimination thing. In this new map each team needs to 'occupy' the enemy HQ building and as long as they control the 'switch' in that building, the other team cannot respawn. IF either team can 'liberate' their HQ, then they can flip the switch and turn on their spawners again. I suggest that you go and download my zip file with the pk3 in it. Open up the script and look at what I did. It works, to the best of my knowledge 100% of the time. I had issues like you mentioned before with respawn/end conditions in my 'Tractor Works TOW' map too. Another reason I took this latest plan of action with spawners.

IF you use my script pieces, please give due credit. Need more help, let me know. The zip is a BETA and is here: http://www.paonline.com/marconia/sos1.zip
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

Bad Jack!
Live to map, not map to live.
-mohaa_rox, .map
moderator
User avatar
Jack Ruby
General
Posts: 1443
Joined: Fri Feb 07, 2003 12:20 am
Location: london

Post by Jack Ruby »

Thanks for your help and the zip Slyk, you may just have saved my map from never getting finished. Nuggets will have to look at the script for me as I am a total idiot when it comes to script ( though I can do ok with flash actionscript ) hopefully one day that light will switch on in my head and I will be able to see how it all works clearly.
Rox, yes I am bad, bad at scripting :)

Its a great idea you had there Slyk so if you dont want me to impose on your script tell me to $%** off. If we use any of it ( even the idea ) your name will be proudly put on the loading screen :)

Thanks a lot mate, nice one
Philip II of Macedon sent a message to Sparta:
"If I win this war, you will be slaves forever."
The Spartan ephors sent back a one word reply: "If".
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

not more work, i'm trying 2 get my own maps outta the way... strange objectives that have never been done b4, it's very basic mapping, i'm just pissing about with scripting it at the moment... if Wacko would do me the honours of remapping it, that'll be a new taster for u all :D

as far as that example script goes, it's not the easiest thing in the world when ur just reading it, without actually playtesting the map and see if it works while ur going, it's almost impossible to understand what bits doing what

i'll look back into it soon though, i'm trying my best, but as 4 now, ur script is working... if a taem can turn off the enemy spawners, they would need to of already had an advantage, thus turning the spawners off an even greater advantage... wouldn't this tun out to be the main aim of every1 in the map, thus making the rest of the objectives almost irrelevant until all enemy have been destroyed? :?
hope this helps, prob not cos it's all foreign 2 me :-/
Slyk
Lieutenant Colonel
Posts: 361
Joined: Sun Jul 14, 2002 12:42 am
Location: Elizabethtown, PA

Post by Slyk »

You still have two play objectives. Depends on WHERE you set up the spawner controls. In my version you can win one of two ways:

FIRST: control all five objectives at the same time or
SECOND: capture and hold the enemy spawner and kill all the enemy players. This isn't as easy as it sounds as both spawner switches are in vulnerable positions.

Hopefully what it will do is force players to attack AND defend locations or atleast try to use teamwork to advance a 'line' of attack/defense. In my 'Streets of Stalingrad' map you will see how you can use terrain to hold a 'front' with teamwork, of course. That, to me, is where most people win and loose in TOW maps. IF they work together, they win a lot more of the time. It's all going to be in the map layout as to how easy the enemy spawner can be taken.

Another option is to have the enemy spawners automatically reset to 'ON' every 30 seconds after being triggered, that would force the other team to stay alive and continue to keep the switch 'OFF'.........hmmmm....

ABOUT MY SCRIPT... use it IF you give me the credit for the basic idea, and please wait until AFTER I release my 'SoS1' map. That should be in a couple days or less as I just did the 'Final' compile. I'm working out the farplane color now.
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

nice idea about turning the spawn points back on after a set time, this could solve the problem where some maps will fall down, but it also leaves the map open to find snipers while in spectator mode, and then them becoming the prey, although this is possible anyway, it'll be what people do while they sit there unable to spawn for the set time

i haven't looked at the script yet, but i ahve got the basic fundamentals of using the spawn point to each teams advantage

as i said in my previous thread, i have lots of work 2 do at the moment, without including actual real work or college, so 4 know i'll have 2 put it on the burner

if u wanna take up the challenge of finishing the script then i'll appreciate it more than [coo=red]Jack Ruby[/color] will :D
hope this helps, prob not cos it's all foreign 2 me :-/
Post Reply