This is part of one of my old map's script for a Steal-the-Document objective. It worked, but for my new map I want to make it work for 3 different documents. How would I do this?
//***--------------------------------------------
//*** "Document Checks"
//*** --------------------------------------------
desk_document_check:
while(1)
{ $documents_trigger waittill trigger // Dont execute past this line until triggered
if (parm.other.dmteam == axis)
{ // parm.other is the triggerer
$documents hide
break // exit the while loop
}
waitframe
}
teamwin axis
end
level waittill spawn
level.num_docs_to_steal = 3 //obviously the 3 docs you have to rob
level.docs_in_possession = 0 //and what you ve robbed (nuthin )
$documents1 thread objective1
$documents2 thread objective2
$documents3 thread objective3
end
objective1:
$documents1_trigger waittill trigger
if (parm.other.dmteam == axis)//chose the team
{
$documents1 hide
level.docs_in_possession++ //That will add 1 point
}
thread win_status//check if the 3docs has been stealed
end
objective2:
$documents2_trigger waittill trigger
if (parm.other.dmteam == axis)//chose the team
{
$documents2 hide
level.docs_in_possession++ //That will add 1 point
}
thread win_status//check if the 3docs has been stealed
end
objective3:
$documents3_trigger waittill trigger
if (parm.other.dmteam == axis)//chose the team
{
$documents1 hide
level.docs_in_possession++ //That will add 1 point
}
thread win_status//check if the 3docs has been stealed
end
win_status:
if(level.num_docs_to_steal == level.docs_in_possession)
{
teamwin axis
}
end
Thanks. To win, the allies not only have to steal all three documents, but also destroy a flak canon (the flak canon script works as well). How would I combine the two so the script knows the allies have to complete both objectives, not just the flak or the documents seperately? Here's what the script looks like all-together:
// Obj_Bunkers
// ARCHITECTURE: GoldenEye
// SCRIPTING: GoldenEye
main:
setcvar "g_obj_alliedtext1" "Destroy the Flak"
setcvar "g_obj_alliedtext2" "Steal the Documents"
setcvar "g_obj_alliedtext3" "Kill Axis"
setcvar "g_obj_axistext1" "Defend the Flak"
setcvar "g_obj_axistext2" "Protect the Documents"
setcvar "g_obj_axistext3" "Kill Allies"
setcvar "g_scoreboardpic" "none"
level waittill prespawn
exec global/DMprecache.scr
exec global/door_locked.scr::lock
exec global/ambient.scr Obj_Bunkers
level.script = maps/obj/Obj_Bunkers.scr
level waittill spawn
$documents1 thread objective1
$documents2 thread objective2
$documents3 thread objective3
level.num_docs_to_steal = 3 //obviously the 3 docs you have to rob
level.docs_in_possession = 0 //and what you ve robbed (nuthin )
level.bomb_damage = 200
level.bomb_explosion_radius = 640
level.defusing_team = "axis"
level.planting_team = "allies"
level.targets_to_destroy = 1
level.dmrespawning = 0 // 1 or 0
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw
// level waittill roundstart
// Set the parameters for round based match
level.dmrespawning = 0 // 1 or 0 (0=no respawn)
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw
$flak88_explosive1 thread global/obj_dm.scr::bomb_thinker
$flak88_explosive1 thread axis_win_timer
thread allies_win_bomb
thread desk_document_check
end // end of main
objective1:
$documents1_trigger waittill trigger
if (parm.other.dmteam == allies)//chose the team
{
$documents1 hide
level.docs_in_possession++ //That will add 1 point
}
thread win_status//check if the 3docs has been stealed
end
objective2:
$documents2_trigger waittill trigger
if (parm.other.dmteam == allies)//chose the team
{
$documents2 hide
level.docs_in_possession++ //That will add 1 point
}
thread win_status//check if the 3docs has been stealed
end
objective3:
$documents3_trigger waittill trigger
if (parm.other.dmteam == allies)//chose the team
{
$documents1 hide
level.docs_in_possession++ //That will add 1 point
}
thread win_status//check if the 3docs has been stealed
end
win_status:
if(level.num_docs_to_steal == level.docs_in_possession)
{
teamwin allies
}
end
//*** --------------------------------------------
//*** "Axis Victory"
//*** --------------------------------------------
axis_win_timer:
level waittill axiswin
end
//*** --------------------------------------------
//*** "Allied Victory"
//*** --------------------------------------------
allies_win_bomb:
while(level.targets_destroyed < level.targets_to_destroy)
waitframe
teamwin allies
end
// Obj_Bunkers
// ARCHITECTURE: GoldenEye
// SCRIPTING: GoldenEye
main:
setcvar "g_obj_alliedtext1" "Destroy the Flak"
setcvar "g_obj_alliedtext2" "Steal the Documents"
setcvar "g_obj_alliedtext3" "Kill Axis"
setcvar "g_obj_axistext1" "Defend the Flak"
setcvar "g_obj_axistext2" "Protect the Documents"
setcvar "g_obj_axistext3" "Kill Allies"
setcvar "g_scoreboardpic" "none"
level waittill prespawn
exec global/DMprecache.scr
exec global/door_locked.scr::lock
exec global/ambient.scr Obj_Bunkers
level.script = maps/obj/Obj_Bunkers.scr
level waittill spawn
$documents1 thread objective1
$documents2 thread objective2
$documents3 thread objective3
level.obj_to_achieve = 4
level.obj_done = 0
level.bomb_damage = 200
level.bomb_explosion_radius = 640
level.defusing_team = "axis"
level.planting_team = "allies"
level.targets_to_destroy = 1
level.dmrespawning = 0 // 1 or 0
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw
// level waittill roundstart
// Set the parameters for round based match
level.dmrespawning = 0 // 1 or 0 (0=no respawn)
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw
$flak88_explosive1 thread global/obj_dm.scr::bomb_thinker
$flak88_explosive1 thread axis_win_timer
thread check_if_my_bomb_exploded
end // end of main
check_if_my_bomb_exploded:
while (true)
{
if($flak88_explosive1.exploded ==1)
{
println "the bomb has exploded"
level.obj_done++
thread win_status //check if the 4 obj are done
}
wait 10
}
end
objective1:
$documents1_trigger waittill trigger
if (parm.other.dmteam == axis)//chose the team
{
$documents1 hide
level.obj_done++ //That will add 1 point
}
thread win_status //check if the 4 obj are done
end
objective2:
$documents2_trigger waittill trigger
if (parm.other.dmteam == axis)//chose the team
{
$documents2 hide
level.obj_done++ //That will add 1 point
}
thread win_status //check if the 4 obj are done
end
objective3:
$documents3_trigger waittill trigger
if (parm.other.dmteam == axis)//chose the team
{
$documents1 hide
level.obj_done++ //That will add 1 point
}
thread win_status //check if the 4 obj are done
end
win_status:
if(level.obj_done == level.obj_to_achieve)
{
teamwin allies
}
end
//*** --------------------------------------------
//*** "Axis Victory"
//*** --------------------------------------------
axis_win_timer:
level waittill axiswin
end
The scanner will check if the bomb has exploded and will add a point to the level_obj_done so if the 4 obj are achieved the allies team will win
First exploded the bomb and check if the console says : BOMB HAS EPXLODED , if so the the script will work otherwise come back here......
Last edited by agentmad007 on Sun Jul 31, 2005 2:10 am, edited 1 time in total.
main:
level.docs_in_possession = 0
level.targets_to_destroy = 1
... bla ...
... bla ...
end
objectives:
local.player = parm.other
if (local.player.dmteam == allies)//check the team
{
$(self.target) hide // trigger targets the document
level.docs_in_possession++ //That will add to level.docs_in_possession
}
end
allies_win_bomb:
// win only if both are completed
while(level.targets_destroyed < level.targets_to_destroy && level.docs_in_possession < 3)
waitframe
teamwin allies
end
You need to have the triggers target the documents for this to work and use key: setthread value: objectives
objective1:
if (parm.other.dmteam == allies)//chose the team
{
$document1 hide
$document1 playsound pickup_papers1
level.obj_done++ //That will add 1 point
println "A document has been stolen"
}
thread win_status
end
objective2:
if (parm.other.dmteam == allies)//chose the team
{
$document2 hide
$document2 playsound pickup_papers1
level.obj_done++ //That will add 1 point
println "A document has been stolen"
}
thread win_status
end
objective3:
if (parm.other.dmteam == allies)//chose the team
{
$document3 hide
$document3 playsound pickup_papers1
level.obj_done++ //That will add 1 point
println "A document has been stolen"
}
thread win_status
end
:\ I want the console to tell the players that a document has been stolen after each document is stolen...and the bomb one doesn't show up either that says it exploded.