Ai Escorts (and Special Objectives)
WIP page on Special Objective Escorts and things you can do with them. A test map is provided: "Beardlib Editor Escorts Test Map"
Escort Characters
All Escort characters will stop moving when enemies block their path, different radiuses apply for different hostages. Escort unit data typically contains the following (using Matt as an example, This is not important unless you want to make a custom character act as an escort)
<!--Escort Animations-->
<anim_state_machine name="anims/units/escort_guy/escort_undercover_machine" />
<!--Escort Extensions-->
<extensions>
<extension name="base" class="CivilianBase" >
<var name="_tweak_table" value="escort_undercover" />
<var name="_spawn_state" value="escort_undercover/spawn/loop" />
</extension>
<!--Most important, makes the escort not die.-->
<extension name="character_damage" class="CivilianDamage">
<var name="immortal" value="true" />
<var name="_no_blood" value="true" />
</extension>
</extensions>
Escort Special Objectives/Patrols
Escorts in heists are fairly simple preset tracks for Escort civilians to follow.
First step is to choose your patrol path/s and add those positions to the level. Keep in mind you may need multiple patrol groups if you want your Ai to take different paths for different reasons.
Once you have a path for the Escort to take you need to add a SpecialObjective element for them to use that patrol group and use it like one. Not all of these settings are required, but most are not neccisary for what we are doing here. (Access Flags are not shown in the following image but use civ_male/civ_female to make it work for escorts.)
Telling Escorts to use a path
When spawning the Escort character you will want to include an EnemyDummyTrigger element to tell the escort to use the SpecialObjective we made.
Making things happen along the way
Since were using a SpecialObjective element to make these escorts we can include triggers and branches to them.
- SpecialObjectiveTriggers set to Administered trigger type will execute once your escort has been told to follow the path, In the example level this is used to spawn an enemy that will block his path if you do not kill the enemy. A Complete trigger can be used for when your escort reaches the end of his pathing.
- SpecialObjectiveGroup With a follow up to take 2 different SpecialObjective escort paths can be used to start of connect branches together, in the example level its used to go left or right and it activated using the Followup Elements list in the 'escort_start' SpecialObjective (Use Instigator is required for this)