First off, big thanks to Mean Mr. Mustard, who turns out not to be so mean. In any case, I finally got my returnable objectives working and thought I’d post a prefab of the entities, my script, and a graphic showing how everything works, with the key values I used.
First off, the graphic shows a box of gold that the axis must take (allied_gold) and return to their getaway truck (axis_truck). There are two goldbox markers at the truck showing the current state of the objective, secured (allied_gold_captured) or still in play (allied_gold_red). I set this up as a team_CTF_blueflag entity even though Axis are typically thought of as the red team (Doh!)
To start off, think of the flag and objective as two seperate pieces, I’ve labeled them in the graphic as the pickup point (where you’re going to grab the flag) and the dropoff point (where you’re going to take the objective). I’ve used the truck model, but it’s largely irrelevent. All that matters is the triggers.
The Pickup Point
-
Start off with a Team_CTF_blueflag entity and specify the skin and model you want the player, in-game, to see. I’ve used the gold box from Goldrush. The scriptname, allied_gold (see below), is going to provide all the specifics about what happens when the flag is captured, returned, and secured
-
Add a brushwork trigger around the flag and make it a Trigger_Objective_Info entity. Specify the command map icons you want the allied or axis team to see. The spawnflags=2 correspond allied_objective, meaning that the allies own it at game start
-
Now, in order for the command map icon to show up, you need a misc_commandmap_marker. This needs to be targetted by the TOI and will display the specified icon on the command map, WHERE THE TOI IS LOCATED. In this case, I want to show the gold bar icon, so the allied_gold TOI targets allied_gold_cm_marker
The Dropoff Point
The dropoff point looks complicated but is pretty simple too.
- Create a trigger_flagonly_multiple entity. This entity will trigger whenever a flag, color is controlled by the spawnflags, is run thru the trigger space. If you have multiple team_CTF_blue/redflag entities, you only need one trigger_flagonly_multiple entity. This also means that whatever script you run, has to be general to all flags and not specific any one particular objective.
In my case, the script ‘allied_objectives’ triggers a game_manager script and checks to see if both flags have been captured, thus ending the game
-
Now, we want to have a command map marker for the truck too. Add a trigger_objective_info and misc_commandmap_marker entities for the truck in the same way as we did at the pickup point. It’s an axis truck, so I named mine axis_truck_cm_marker, which is targetted by the axis_truck_toi entity.
-
Lastly, we want to have a box of gold in 2 states, which shows whether the gold has been secured or in play. This is simply controlled by a setstate argument in the ‘allied_gold’ script and is automatically triggered by the spawn and captured events. I’ve used a similar argument in the secured and return events to turn the command map marker (allied_gold_cm_marker) on and off.
I think that’s about it. Here is the graphic:

Here is the prefab:
http://www.rtcwonline.com/dummies/maps/prefab_iffy_objective.zip
and lastly, here are the relevant scripts:
//Gold
allied_gold
{
spawn
{
wait 200
setstate allied_gold_captured invisible
}
trigger stolen
{
wm_announce 0 "Return the Allied gold to the getaway truck"
wm_announce 1 "The Axis have stolen the Allied gold"
setstate allied_gold_cm_marker invisible
}
trigger returned
{
wm_announce 0 "The Allies have retrieved the gold"
wm_announce 1 "Gold returned! Protect the gold"
setstate allied_gold_cm_marker default
}
trigger captured
{
wm_announce "The Axis have secured the Allied gold"
setstate allied_gold_red invisible
setstate allied_gold_captured default
}
}
allied_objectives //enter this as the scriptname value for the single trigger_flagonly_multiples entity
{
death
{
trigger game_manager obj1
}
}
Hope this is useful to someone