TOW Objectives

Post your scripting questions / solutions here

Moderator: Moderators

User avatar
Jack Ruby
General
Posts: 1443
Joined: Fri Feb 07, 2003 12:20 am
Location: london

TOW Objectives

Post by Jack Ruby »

Well I fixed the map not loading on other peoples machine problem, it was the battery that rox told me to remove. I was testing it with my friend, the objectives..spawn bombs and tow objectives all seem to work except that after the player spawn is blown up you can still respawn and even when you complete all objectives no one wins the match.

I am useless at scripting so I stole the objectives and bombs from the tow tutorial map in the sdk folders. I just changed the text to be displayed in the scr.
Below is the text from the scr I am using, could anyone tell me why its not working ?
Or Nuggets I know you love this type of thing so is there any chance you could rewrite the whole script for me ? I can send you the .map if you need to change settings inside there. I have no clue how to set it all up.
Of course you would have full credit for your work,
please someone help

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

//----------------------------------------------------------
// Main
//----------------------------------------------------------
main:

level.script="maps/obj/MP_peenemunde_TOW.scr"
exec global/tow_dm.scr
exec global/ambient.scr m5l1b

level.gametype = int( getcvar( g_gametype ) )

//gametype 5 = Tug of War
if( level.gametype == 5 )
{
setcvar "g_obj_alliedtext1" "Protect Spawn Point"
setcvar "g_obj_alliedtext2" "Disable the factory electricity"
setcvar "g_obj_alliedtext3" "Disable the fuel pumps"
setcvar "g_obj_alliedtext4" "Disable the tracking radar"
setcvar "g_obj_alliedtext5" "Detonate Axis Spawn Point"

setcvar "g_obj_axistext1" "Protect Spawn Point"
setcvar "g_obj_axistext2" "Connect the factory electricity"
setcvar "g_obj_axistext3" "Turn on the fuel pumps"
setcvar "g_obj_axistext4" "Enable the tracking radar"
setcvar "g_obj_axistext5" "Destroy Allied Spawn Point"
}
else
{
//Not a TOW game remove the bombs
$allie_bomb remove
$axis_bomb remove


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

}

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


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

level.bRoundStarted = 0

// level.bswitch1SwitchUp = 1
// level.bswitch2SwitchUp = 1
// level.bswitch3SwitchUp = 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
level.numAxisObjectives = 0 // Number of objectives taken by the axis
level.numAlliedObjectives = 0 // Number of objectives taken by the allies


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

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

thread init_spawner_bombs
thread init_switch_lights

//Setup the starting team objectives
thread set_objectives

level.bRoundStarted = 1
}


end


//----------------------------------------------------------
//Destroy the allied spawner here
//----------------------------------------------------------
alliesspawnpoint:

iprintln "The Allied Spawn Point has been Destroyed!"

//Take over the objective
$Obj_alliespawnpoint TakeOver 0
level.numAxisObjectives++
level.numAlliedObjectives--

iprintln "The Allied Team Can No Longer Respawn!"

waitthread Check_End_Match

end

//----------------------------------------------------------
//Destroy the axis spawner here
//----------------------------------------------------------
axisspawnpoint:

iprintln "The Axis Spawn Point has been Destroyed!"

$Obj_axisspawnpoint TakeOver 1
level.numAlliedObjectives++
level.numAxisObjectives--

iprintln "The Axis Team Can No Longer Respawn!"

waitthread Check_End_Match

end

//----------------------------------------------------------
//control switch 1 green/red
//----------------------------------------------------------
switch1:

if( level.bRoundStarted == 1 )
{
if( parm.other.dmteam == axis )
{
if( $Obj_switch1.ControlledBy != 0 )
{
$Obj_switch1 TakeOver 0
level.numAxisObjectives++
level.numAlliedObjectives--
$obj2_light_allie hide
$obj2_light_axis show
iprintln "The Axis turned on the factory electricity!"

waitthread Check_End_Match
}
}
else if( parm.other.dmteam == allies )
{
if( $Obj_switch1.ControlledBy != 1 )
{
$Obj_switch1 TakeOver 1
level.numAlliedObjectives++
level.numAxisObjectives--
$obj2_light_axis hide
$obj2_light_allie show

iprintln "The Allies turned off the factory electricity!!"

waitthread Check_End_Match
}
}

//Update team current objectives
thread set_objectives
}

end

//----------------------------------------------------------
//control switch 2 green/red
//----------------------------------------------------------
switch2:

if( level.bRoundStarted == 1 )
{
if( parm.other.dmteam == axis )
{
if( $Obj_switch2.ControlledBy != 0 )
{
$Obj_switch2 TakeOver 0
level.numAxisObjectives++
level.numAlliedObjectives--
$obj3_light_allie hide
$obj3_light_axis show

iprintln "The Axis turned on the fuel pumps!"

waitthread Check_End_Match
}
}
else if( parm.other.dmteam == allies )
{
if( $Obj_switch2.ControlledBy != 1 )
{
$Obj_switch2 TakeOver 1
level.numAlliedObjectives++
level.numAxisObjectives--
$obj3_light_axis hide
$obj3_light_allie show

iprintln "The Allies turned off the fuel pumps!"

waitthread Check_End_Match
}
}

//Update team current objectives
thread set_objectives
}

end

//----------------------------------------------------------
//control switch 3 green/red
//----------------------------------------------------------
switch3:

if( level.bRoundStarted == 1 )
{
if( parm.other.dmteam == axis )
{
if( $Obj_switch3.ControlledBy != 0 )
{
$Obj_switch3 TakeOver 0
level.numAxisObjectives++
level.numAlliedObjectives--
$obj4_light_allie hide
$obj4_light_axis show

iprintln "The Axis started the tracking radar!"

waitthread Check_End_Match
}
}
else if( parm.other.dmteam == allies )
{
if( $Obj_switch3.ControlledBy != 1 )
{
$Obj_switch3 TakeOver 1
level.numAlliedObjectives++
level.numAxisObjectives--
$obj4_light_axis hide
$obj4_light_allie show

iprintln "The Allies disabled the tracking radar!"

waitthread 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_switch3.ControlledBy == 0 )
{
$Obj_switch3 SetCurrent 1
}
else if( $Obj_switch2.ControlledBy == 0 )
{
$Obj_switch2 SetCurrent 1
}
else if( $Obj_switch1.ControlledBy == 0 )
{
$Obj_switch1 SetCurrent 1
}
else if( $Obj_axisspawnpoint.ControlledBy == 0 )
{
$Obj_axisspawnpoint SetCurrent 1
}

//Now the Axis
if( $Obj_switch1.ControlledBy == 1 )
{
$Obj_switch1 SetCurrent 0
}
else if( $Obj_switch2.ControlledBy == 1 )
{
$Obj_switch2 SetCurrent 0
}
else if( $Obj_switch3.ControlledBy == 1 )
{
$Obj_switch3 SetCurrent 0
}
else if( $Obj_alliespawnpoint.ControlledBy == 1 )
{
$Obj_alliespawnpoint SetCurrent 0
}

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

//-----------------------------------------------
// Blow up Allied Spawner
//-----------------------------------------------
axis_bomb_relay_explode:

self waittill trigger
thread alliesspawnpoint
end

//-----------------------------------------------
// Blow up Axis Spawner
//-----------------------------------------------
allie_bomb_relay_explode:

self waittill trigger
thread axisspawnpoint
end

//----------------------------------------------------------
//Initialize the switch lights (start all lights off)
//----------------------------------------------------------
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

//-----------------------------------------------
// init the objectives
//-----------------------------------------------
init_objectives:

//Allied spawn point
if( $Obj_alliespawnpoint.ControlledBy == 0 )
{
level.numAxisObjectives++
}
else if( $Obj_alliespawnpoint.ControlledBy == 1 )
{
level.numAlliedObjectives++
}

//Axis spawn point
if( $Obj_axisspawnpoint.ControlledBy == 0 )
{
level.numAxisObjectives++
}
else if( $Obj_axisspawnpoint.ControlledBy == 1 )
{
level.numAlliedObjectivse++
}

//switch 1
if( $Obj_switch1.ControlledBy == 0 )
{
level.numAxisObjectives++
}
else if( $Obj_switch1.ControlledBy == 1 )
{
level.numAlliedObjectives++
}

//switch 2
if( $Obj_switch2.ControlledBy == 0 )
{
level.numAxisObjectives++
}
else if( $Obj_switch2.ControlledBy == 1 )
{
level.numAlliedObjectives++
}

//switch 3
if( $Obj_switch3.ControlledBy == 0 )
{
level.numAxisObjectives++
}
else if( $Obj_switch3.ControlledBy == 1 )
{
level.numAlliedObjectives--
}

end

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

//Allies first
if( level.numAlliedObjectives == level.numObjectives )
{
//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
}
else if( level.numAxisObjectives == 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
teamwin axis
}

end



Thanks in advance

Jack
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 »

cheers buddy :P i'll see it in the post then, i prefer to have the .map there just to solve any minor issues like spelling terrut wrong, doesn't seem to obvious straight away but we'll get there ;)

I LOVE BIG SCRIPTS :?
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 »

Well Nuggets, I made two files for you, a zip with some screenshots from Radiant, so you can find where I have put stuff and the .map file.

Also the compiled bsp inside a .pk3 with the no good script that I have been trying to use.

Heres a link to each file seperately so you can grab whichever file you want,

http://www.westmount.co.uk/simons/nuggets.zip

http://www.westmount.co.uk/simons/user_ ... de_tow.pk3

If this is too much to ask tell me to go to hell :wink:

Jack
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 »

lol, awww u made a nuggets.zip, it makes me so emotional, i've had a few beers 2nite and i'm having a few more 2moro night after work, i'll look at it then, ;)

please note if this doesn't seem easy, GO TO HELL!!! :lol:
hope this helps, prob not cos it's all foreign 2 me :-/
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 »

here it is, i haven't tested it yet as there was a problem with the .bsp but fingers crossed should work once you've made a few alterations :P just replace the relevant areas,

one big problem though!!!, if both spawn points get destroyed, they can't be reinstated, meaning both teams failed and will never accomplish their missions (protect spawn points) therefore the number of objectives will remain null, if you remove that objective then all should work :D but you will need to modify the //<--- areas at the bottom to 4 and -4 ;) at 3 points

otherwise the spawnpoints will need to be reactivated, i haven't scripted either, but 1 will have to be done otherwise the mission will never be won (unless it stays protected) but surely that'll be the enemies 1st target if it means the opposition can't win :?

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

level.gametype = int( getcvar( g_gametype ) )
//gametype 5 = Tug of War
if( level.gametype == 5 )
{
setcvar "g_obj_alliedtext1" "Protect Spawn Point"
setcvar "g_obj_alliedtext2" "Disable the factory electricity"
setcvar "g_obj_alliedtext3" "Disable the fuel pumps"
setcvar "g_obj_alliedtext4" "Disable the tracking radar"
setcvar "g_obj_alliedtext5" "Detonate Axis Spawn Point"

setcvar "g_obj_axistext1" "Protect Spawn Point"
setcvar "g_obj_axistext2" "Connect the factory electricity"
setcvar "g_obj_axistext3" "Turn on the fuel pumps"
setcvar "g_obj_axistext4" "Enable the tracking radar"
setcvar "g_obj_axistext5" "Destroy Allied Spawn Point"
}
else
{
//Not a TOW game remove the bombs
$allie_bomb remove
$axis_bomb remove

// set scoreboard messages
setcvar "g_obj_alliedtext1" "Peenemunde"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" "Peenemunde"
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""
}
//////////////////////////
level waittill prespawn
//////////////////////////

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

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.nuggetsObjectives = 5 // Number of objectives needed to win
((<--- 4))

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

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

//Setup the starting team objectives
thread set_objectives
level.bRoundStarted = 1
}

level.numObjectives = 0 //no objectives completed
level.switch1owner = 0 //0 meaning neutral
level.switch2owner = 0
level.switch3owner = 0
level.alliedspawn = 1 //i'll add more info on this once u've decided the protect spawnpoint objective
level.axisspawn = -1
end


//REPEAT THIS FOR ALL SWITCHES
//objective flags
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
iprintln "The Axis turned on the factory electricity!"
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
iprintln "The Allies turned off the factory electricity!!"
level.switch1owner = 1
}
}
//Update team current objectives
waitthread Check_End_Match
}end

//REPEAT THIS FOR ALL SWITCHES


alliesspawnpoint:
iprintln "The Allied Spawn Point has been Destroyed!"
//Take over the objective
$Obj_alliespawnpoint TakeOver 0
level.alliedspawn = -1
iprintln "The Allied Team Can No Longer Respawn!"
waitthread Check_End_Match
end

axisspawnpoint:
iprintln "The Axis Spawn Point has been Destroyed!"
//Take over the objective
$Obj_axispawnpoint TakeOver 1
level.axisspawn = 1
iprintln "The Axis Team Can No Longer Respawn!"
waitthread Check_End_Match
end


//the finalisation
Check_End_Match:
level.nuggetsObjectives = ( level.switch1owner + level.switch2owner + level.switch3owner + level.alliedspawn + level.axisspawn )
//meaning if allies will win level.nuggetsObjectives = (1 switch1ally+ 1 switch2ally + 1 switch3ally + 1 allyspawn protected + 1 axisspawn destroyed)
//will do complete check
if ( level.nuggetsObjectives == 5 ) //meaning allies have reached all their objectives
((<--- 4))
{
//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 == -5 ) //meaning axis have reached all their objectives
((<--- -4))
{
level ignoreclock 1
waitthread global/tow_dm.scr::StopBomb
teamwin axis
}
thread set_objectives
end


i have quickly checked for spelling mistakes, but didn't find any (have to go to work now) but i'll post this anyway (as you can well see) :P
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 »

Nuggets, TOP MAN, I will see if I can get it working, If we pull this off I will send you a 6 pack of Stellas :)

Jack
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 »

lol, i think i'll need 2 do a little more scripting b4 the thing comes to life depending on how you want this "protect spawn point" objective to work

but anyway!!! who told you i have a passion for stella??? i'm not a drunk you know *burp*
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 »

The spawn points, hmmm, well I wanted the 3 switches to be able to change hands TOW style, the spawn points should work like this, if I am say an allie and I blow the axis spawn, the axis should not be able to respawn, but if the remaining axis players manage to flip all 3 tow switches they can still win the match.
Protecting the spawn is not a game winning objective, just helps to keep your players spawning.
If the remaining axis players get shot trying to flip the three switches while the allies have not switched them all their selves the game should be a draw, like if the axis hold one switch while the allies have two then all the germans get killed the match should be drawn.

I think I got that right, can we do it ?

Jack
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 »

I got the loading screen working, looks good ( to my eye anyway )

<img src="http://www.westmount.co.uk/simons/loading_shot.jpg">
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 »

yep we can do it, and yep the loading screen does look good, however...

unfortunaltely, i've had more beers 2nite so i'll post the outcome 2moro :D
hope this helps, prob not cos it's all foreign 2 me :-/
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 »

//the whole script :D
//you can just stick this whole script in ;)

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

level.gametype = int( getcvar( g_gametype ) )
//gametype 5 = Tug of War
if( level.gametype == 5 )
{
setcvar "g_obj_alliedtext1" "Protect Spawn Point"
setcvar "g_obj_alliedtext2" "Disable the factory electricity"
setcvar "g_obj_alliedtext3" "Disable the fuel pumps"
setcvar "g_obj_alliedtext4" "Disable the tracking radar"
setcvar "g_obj_alliedtext5" "Detonate Axis Spawn Point"

setcvar "g_obj_axistext1" "Protect Spawn Point"
setcvar "g_obj_axistext2" "Connect the factory electricity"
setcvar "g_obj_axistext3" "Turn on the fuel pumps"
setcvar "g_obj_axistext4" "Enable the tracking radar"
setcvar "g_obj_axistext5" "Destroy Allied Spawn Point"
}
else
{
//Not a TOW game remove the bombs
$allie_bomb remove
$axis_bomb remove

// set scoreboard messages
setcvar "g_obj_alliedtext1" "Peenemunde"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" "Peenemunde"
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""
}
//////////////////////////
level waittill prespawn
//////////////////////////

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

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.nuggetsObjectives = 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 )
{
//init the objectives
thread init_objectives
thread init_spawner_bombs
thread init_switch_lights

//Setup the starting team objectives
thread set_objectives
level.bRoundStarted = 1
}

level.numObjectives = 0 //no objectives completed
level.switch1owner = 0 //0 meaning neutral
level.switch2owner = 0
level.switch3owner = 0
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
iprintln "The Axis turned on the factory electricity!"
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
iprintln "The Allies turned off the factory electricity!!"
level.switch1owner = 1
}
}
//Update team current objectives
waitthread Check_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
iprintln "The Axis turned on the factory electricity!"
level.switch2owner = -1
}
}
else
if ( parm.other.dmteam == allies )
{
if ( level.switch2owner == -1 ) || ( level.switch2owner == 0 )
{
$obj2_light_axis hide
$obj2_light_allie show
iprintln "The Allies turned off the factory electricity!!"
level.switch2owner = 1
}
}
//Update team current objectives
waitthread Check_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
iprintln "The Axis turned on the factory electricity!"
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
iprintln "The Allies turned off the factory electricity!!"
level.switch3owner = 1
}
}
//Update team current objectives
waitthread Check_End_Match
}end

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

Check_End_Match:
level.nuggetsObjectives = ( level.switch1owner + level.switch2owner + level.switch3owner )
//will do complete check
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
}
thread whats_left //i've added this to show on screen the remaining objectives
end


/////////////////
// what's left //
/////////////////

whats_left:

if ( switch1owner == -1 )
{ iprintlnbold_noloc "for you to edit" } //1 owned by axis
else
{ if ( switch1owner == 0 )
{ iprintlnbold_noloc "for you to edit" } //1 still neutral
else
{ if ( switch1owner == 1 )
{iprintlnbold_noloc ""for you to edit" } //1 owned by allies
}}
if ( switch2owner == -1 )
{ iprintlnbold_noloc "for you to edit" } //2 owned by axis
else
{ if ( switch2owner == 0 )
{ iprintlnbold_noloc "for you to edit" } //2 still neutral
else
{ if ( switch2owner == 1 )
{iprintlnbold_noloc ""for you to edit" } //2 owned by allies
}}
if ( switch3owner == -1 )
{ iprintlnbold_noloc "for you to edit" } //3 owned by axis
else
{ if ( switch3owner == 0 )
{ iprintlnbold_noloc "for you to edit" } //3 still neutral
else
{ if ( switch3owner == 1 )
{iprintlnbold_noloc ""for you to edit" } //3 owned by allies
}}

////////////////////
// who's got what // won't work!!! :(
////////////////////
/*
set_objectives:

//First lets do the allies
if( $Obj_switch3.ControlledBy == 0 )
{
$Obj_switch3 SetCurrent 1
}
else if( $Obj_switch2.ControlledBy == 0 )
{
$Obj_switch2 SetCurrent 1
}
else if( $Obj_switch1.ControlledBy == 0 )
{
$Obj_switch1 SetCurrent 1
}
else if( $Obj_axisspawnpoint.ControlledBy == 0 )
{
$Obj_axisspawnpoint SetCurrent 1
}

//Now the Axis
if( $Obj_switch1.ControlledBy == 1 )
{
$Obj_switch1 SetCurrent 0
}
else if( $Obj_switch2.ControlledBy == 1 )
{
$Obj_switch2 SetCurrent 0
}
else if( $Obj_switch3.ControlledBy == 1 )
{
$Obj_switch3 SetCurrent 0
}
else if( $Obj_alliespawnpoint.ControlledBy == 1 )
{
$Obj_alliespawnpoint SetCurrent 0
}
end
// none of this will work as it can't find whether things have been achieved
// by axis sides, if the allies don't own the lights then the axis must own
// them it's only a boolean option meaning only 2 possible outcomes can
// arise (if axis don't own it, allies own it) even though this is the case it
// won't change the outcome and the objectives will still work, it just won't
// be able to know if both teams don't own something,
*/

////////////////////////////
// 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

/*
please remember though!!! :P i haven't tested this so i can't check
properly for errors or even spelling mistakes, if you can email the .bsp if
it doens't work it'd be a bit easier :D

fingers crossed though this will do the job, i've removed the previous
spawnpoints from being destroyed as objectives but i'll put the new ones
in here if you still want them possible to be overtaken
*/

//-----------------------------------------------
// Blow up Allies Spawner
//-----------------------------------------------
axis_bomb_relay_explode:
self waittill trigger
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:
self waittill trigger
iprintln "The Allies Spawn Point has been Destroyed!"
iprintln "The Allies Team Can No Longer Respawn!"
$Obj_axisspawnpoint TakeOver 0
end
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 »

Excellent work mate, I will test it tomorrow, will let you know the outcome, I owe you big time, I very much apreciate all your help on this one, I have had a couple of beers tonight,

Nice one ( seeming more and more like I need to send a crate of Stella )

: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 »

ahh u needn't bother :D nevermind with the crate, just a truckful will do :P
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 »

Nuggets, sorry mate but I couldnt get it to work, I was playing with a few mates last night, it was very amusing even though we could only kill eachother, I was gonna mail the .bsp to you but hotmail only lets me have 2mb of space so I figured you have the same, didnt want to flood your email so I have put it up on a server, its the .pk3 that we were playing with last night, everything is in there, would you mind taking a look ?

http://www.westmount.co.uk/simons/peenemunde.pk3

Nice one

Jack
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'm still getting the same problem with the .bsp file :?

ERROR: CM_Loadmap: maps/obj/MP_peenemunde_TOW.bsp has wrong version number (21 should be between 19 and 19)

what the bloody hell does that mean??? :? i'll post it in the forum for errors and c if any1 knows, otherwise change this bit of ur script

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

Check_End_Match:
level.nuggetsObjectives = ( level.switch1owner + level.switch2owner + level.switch3owner )
//will do complete check

iprintlnbold "what's the magic number" evel.nuggetsObjectives //if this never reaches 3 or -3 then i have a few more problems :P
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
}
thread whats_left //i've added this to show on screen the remaining objectives
end
hope this helps, prob not cos it's all foreign 2 me :-/
Post Reply