Ai Escorts (and Special Objectives)

A test map is provided in the Attachments.

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.


Revision #6
Created 6 June 2020 11:50:45 by Rex
Updated 2 July 2021 17:12:49 by Rex