There are a bunch of tutorials on stealing stuff as objectives... for single player maps. I will explain how to steal stuff in a multiplayer objective.
This tutorial requires a bit of scripting and setting parameters and configuring entities, so if you have no idea what those words mean, try to learn that first.
Oh yeah, you'll probably want to put the objective somewhere, so I recommend building a map, made up only of one small room ( To minimize compile times while you are learning ). All bold words in the below tables are keywords that should not be changed, the rest you can change as much as you like.
Big thanx to jv_map at .map for telling me everything I needed to know to make this work. And not laughing at me ( Not to my face anyway ;-) ).
A multiplayer objective theft is made out of a number of parts:
On this page...
So lets start from the top.
Create an object to be stolen, for example some documents: with nothing selected, right click on the map grid and select animate ->item - > naxosplans4-pulse for some nice documents.
Give it this key-value pair:
| Key | Value | Explanation |
| targetname | documents | A name used by other entities to target this entity. |
By now you should have a nice set of documents to hang on a wall ( if you prefer you'r documents on a table, try: animate ->item - > naxosplans1-pulse ).
Create a trigger_use ( with nothing selected, right click on the map grid and select trigger->use ).
Give it this key-value pair:
| Key | Value | Explanation |
| targetname | documents_trigger | A name used by other entities to target this entity. |
Reposition the trigger so that it sits around your documents. Done.
Here is the script for the objective map. Note that with this script, the stealing team wins as soon as they find the documents and pick them up. With more advanced scripting, you can require the stealing team to carry the documents to some location such as their spawn.
// Custom objective test map
// ARCHITECTURE: Bjarne Grönnevik
// SCRIPTING: Bjarne Grönnevik
main:
setcvar "g_obj_alliedtext1" "Steal the documents."
setcvar "g_obj_alliedtext2" "- Go get them"
setcvar "g_obj_alliedtext3" "- U know U whant to"
setcvar "g_obj_axistext1" "Prevent the allies"
setcvar "g_obj_axistext2" "from stealing the"
setcvar "g_obj_axistext3" "documents (Please?)."
setcvar "g_scoreboardpic" "none"
level waittill prespawn
exec global/DMprecache.scr
// Change <NAME_OF_YOUR_MAP_FILE> to
// the name of you'r map file
level.script = maps/obj/<NAME_OF_YOUR_MAP_FILE>.scr
exec global/ambient.scr <NAME_OF_YOUR_MAP_FILE>
level waittill spawn
// 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 // axis, allies, kills, or draw
// Comment out this line to be able to set the bomb
// when alone on the map ( just for testing )
// level waittill roundstart
// Start the win check thread for allies
thread desk_document_check
// If the end of the match is reached, the Axis win
level waittill axiswin
end // end of main
// Document checks
desk_document_check:
while(1) { // forever
// Dont execute past this line
// until someone triggers the object
$documents_trigger waittill trigger
// parm.other is the triggerer
if(parm.other.dmteam == allies) {
// Make the document graphix disappear
$documents hide
// break out of the while loop
break
}
// protection against making this
// thread use too much CPU
waitframe
}
teamwin allies // Make allies win the match
end // end allies victory test
- Bjarne