Making a multi-staged construction isn’t as hard as what some tutorials make it out to be. Here is how you do it:
Step 1: Draw the entire finished item out of brushes and texture them as you normally would with any other brushwork item. If it is a bridge then make the whole bridge. Models don’t work well for this as you would need the model in different stages of construction.
Step 2: Copy some of the item’s brushes to make the constages and desstages.
Step 3: Select the brushes that you copied to make the constages, right click, and select func_brushmodel.
Give it a scriptname and value, a targetname and value. These values are what the func_constructible uses for the constages and desstages. I think you can make as many stages as you want but I’m only doing two.
Here are the entries from the map file:
"classname" "func_brushmodel"
"scriptname" "bridge1" // no ; in these entries
"targetname" "bridge1"
Step 4: Select all the brushes that make up the finished item, right click, and select func_constructible. This is the “final” stage of the constructible.
Give it a scriptname and value, a targetname and value, track key and its value (“track” “the Bridge”).
The constages would be the scriptname from the func_brushmodel and make sure to put a “;” at then end of the value in the entity window.
Here are the entries from the map file:
"classname" "func_constructible"
"spawnflags" "8" // this is an allied construct
"track" "the Bridge"
"constages" "bridge1;" // notice the ; at the end of the name and notice it is only the one stage
"desstages" "bridge1;" // the final is always the finished entity
"scriptname" "thebridge"
"targetname" "thebridge"
Step 5: Make 2 brushes and texture one as trigger and the other as origin, then select both and right click to make the trigger_objective_info. This goes around some sort of model or script_mover brushes where the engineer uses their pliers
Here are the entries from the map file:
"classname" "trigger_objective_info"
"target" "thebridge" // this targets the func_contructible
"targetname" "thebridge_toi"
"scriptname" "thebridge_toi"
"shortname" "The Bridge"
"infoAllied" "The Bridge"
"infoAxis" "The Bridge"
"track" "the Bridge"
"spawnflags" "1"
Step 6: Finally, make some sort of item so the engineer knows where the trigger_objective_info is. It’s typical to use the crates and sandbags and they are in directory etmain\models\mapobjects\cmarker. I called mine bridgematerials_stage1 and bridgematerials_stage2. You’ll see those in the script.
Step 7: Here is the only scripting you need. You’ll need to tailor it to your own map with accums that would hold something like a tank or truck from passing, or maybe hold another area up in the map until its complete:
//***************************
// Bridge Construction
//***************************
thebridge // this is the scriptname of the func_constructible
{
spawn
{
wait 500 // wait a moment until all the items are loaded
constructible_class 3 // the construct will take dynamite to destroy, 2 is grenade, 1 is anything
}
//-----------------------------------------------------------------------
// Stage 1 is STARTING
//-----------------------------------------------------------------------
buildstart stage1
{
wm_announce "Allied are constructing the bridge!" // let everyone know the construction started
}
//-----------------------------------------------------------------------
// Stage 1 is BUILT
//-----------------------------------------------------------------------
built stage1
{
setstate bridgematerials_stage1 invisible // its built so make the sandbags invisible
wm_announce "Bridge complete! Reinforce it now!"
}
//-----------------------------------------------------------------------
// Stage 1 is DECAYED
//-----------------------------------------------------------------------
decayed stage1
{
setstate bridgematerials_stage1 default // the engineer didn't finish the stage
setstate thebridge_toi default
wm_announce "Allied didn't complete the bridge!"
}
//-----------------------------------------------------------------------
// Stage 1 is DESTROYED
//-----------------------------------------------------------------------
death
{
setstate bridgematerials_stage1 default // someone destroyed the bridge
setstate thebridge_toi default
wm_announce "Bridge destroyed!"
}
//-----------------------------------------------------------------------
// Stage 2 is STARTING
//-----------------------------------------------------------------------
buildstart final
{
wm_announce "Allied are reinforcing the bridge!" // the final "whole" construction item is started
}
//-----------------------------------------------------------------------
// Stage 2 is BUILT
//-----------------------------------------------------------------------
built final
{
setstate bridgematerials_stage2 invisible // construction finished so remove the crates
setstate thebridge_toi invisible
wm_announce "Bridge Reinforced!"
}
//-----------------------------------------------------------------------
// Stage 2 is DECAYED, go back to stage 1
//-----------------------------------------------------------------------
decayed final
{
setstate bridgematerials_stage2 default // engineer didn't finish stage 2
setstate thebridge_toi default
wm_announce "Bridge not reinforced!"
}
//-----------------------------------------------------------------------
// Stage 2 is DESTROYED, go back to stage 1
//-----------------------------------------------------------------------
destroyed
{
setstate bridgematerials_stage2 default // someone destroyed the finished construction
setstate thebridge_toi default
wm_announce "Bridge damaged!"
}
}
Just keep in mind that you draw the whole object first and then copy parts of it to make up the other construction stages. I hope this helps all of you that are struggling with a multi-stage construction.