Payday 2/Mapping

From Game Modding Wiki
Jump to: navigation, search

This is where tutorials and examples for mapping goes.

You can find the mission elements here

File types[edit]

.continent: Contains all the props and units.

.mission: Contains all the scripting/sequences.

.world: Contains nav_surfaces, wires, which environment files the map uses, portals and basic level settings.

.nav_data: Contains all the navigation data.

.cover_data: Contains positions for where the ai should go for cover.

.world_sounds: Contains ambient sound for the map.

continents.continents: Contains what continents exist in the map.

mission.mission: Contains what missions exist in the map.

AI Navigation[edit]

Navigation can be rather tricky to figure out how it works at first. For the navigation units to work properly you need this pdmod that will alter the physics_settings.

You basically put a core/units/nav_surface/nav_surface in every room/area. The area that a nav_surface covers is limited so you need to place a lot of them and put a navigation_blockers between every nav_surface.

Navigation.jpg

This is an example of how it should look.

The dark blue lines show what other nav_surfaces the nav_surface is connected to.

The white squares with yellow lines within them are navigation segments.

The light blue lines are doors that connect two navigation segments.

The green/yellow/black are navigation_blockers that seperate the nav_surfaces.

The red boxes are navigation_splitters that stops the editor from generating any navigation there.

Any navigation related unit is only needed when you are generating the navigation. When you have generated navigation and saved it to a nav_manager_data.nav_data file the navigation units don't have any use until you want to generate the navigation again.

After you have placed nav_surfaces and navigation_blockers you can use the BeardLib-Editor to Build navdata and Save navdata. When you have started building the navdata you can see its progress in the BLT log.

If a unit has disable_on_ai_graph="true" in its attributes it will get ignored when generating navigation.

The navigation blockers and splitters need to be in a editor_only continent.

The navigation_blocker unit splits and the navigation_splitter unit blocks. If you are using the newer units that have dev_ in their name they work as in: dev_navigation_blocker blocks and dev_navigation_splitter splits.

Nav_surfaces[edit]

Nav_surfaces are(and should be) in the .world. They still work if they are in the continent, but they have increased functionality if they are in the .world.

<entry key="ai" type="table">
	<entry index="1" type="table">
		<entry key="ai_editor_data" type="table">
			<entry key="detection_mul" type="number" value="1"/>
			<entry key="location_id" type="string" value="location_unknown"/>
			<entry key="suspicion_mul" type="number" value="1"/>
			<entry key="visibilty_exlude_filter" type="table">
			</entry>
			<entry key="visibilty_include_filter" type="table">
			</entry>
		</entry>
		<entry key="unit_data" type="table">
			<entry key="name" type="string" value="core/units/nav_surface/nav_surface"/>
			<entry key="name_id" type="string" value="nav_surface_001"/>
			<entry key="position" type="vector3" value="-153.039 5707.64 4033.89"/>
			<entry key="rotation" type="quaternion" value="0 0 0 -1"/>
			<entry key="unit_id" type="number" value="1"/>
		</entry>
	</entry>
</entry> 

location_id: Can be used to give the nav_surface area a certain id. But Overkill doesn't use this anymore.

detection_mul/suspicion_mul: How fast you will be suspicious/detected inside the nav_surface area. Almost always set to 1.

Cover data[edit]

The cover data file contains positions that enemies will go to. If your map doesn't have any cover points enemies will walk around really weird and partially glitch into walls because they will try to always stand by the edges of the navigation segments.

Coverdata.jpg

The green dudes are units/dev_tools/level_tools/ai_coverpoint. You can create a cover_data file with the editor by placing ai_coverpoints then doing "Save Cover Data". The ai_coverpoints need to be in a editor_only continent.

Instances[edit]

Instances are used for if you want to place multiple parts of a map but have them all use their own mission, for example: a vault that is placed multiple times but contains the same thing or the Hotline Miami D2 bomb guy. The instances look like this in the mission and continent:

Mission:

<entry key="instances" type="table">
	<entry index="1" type="string" value="blackhawk"/>
</entry> 

Continent:

<instances>
	<table continent="world" folder="levels/instances/unique/hox_estate_heli_spawn/world" index_size="200" name="blackhawk" position="150 -400 600" rotation="0 0 0.7 0.7" script="default" start_index="0"/>
</instances> 

The start_index needs to be what the start_index was for the previous entry + the index_size of the previous entry.

<instances>
	<table continent="world" folder="levels/instances/unique/cag_computer/world" index_size="300" name="cag_computer_001" position="2450 650 -149.996" rotation="0 0 -1 5.06639e-007" script="default" start_index="0"/>
	<table continent="world" folder="levels/instances/unique/cag_computer/world" index_size="300" name="cag_computer_002" position="2600 650 -149.996" rotation="0 0 -1 5.06639e-007" script="default" start_index="300"/>
	<table continent="world" folder="levels/instances/unique/cag_computer/world" index_size="300" name="cag_computer_003" position="2875 650 -149.996" rotation="0 0 -1 5.06639e-007" script="default" start_index="600"/>
	<table continent="world" folder="levels/instances/unique/cag_computer/world" index_size="300" name="cag_computer_004" position="3025 650 -149.996" rotation="0 0 -1 5.06639e-007" script="default" start_index="900"/>
	<table continent="world" folder="levels/instances/unique/cag_computer/world" index_size="300" name="cag_computer_005" position="3030 395 -149.996" rotation="0 0 -1 1.04308e-006" script="default" start_index="1200"/>
	<table continent="world" folder="levels/instances/unique/cag_computer/world" index_size="300" name="cag_computer_006" position="2872 397 -149.996" rotation="0 0 -1 1.04308e-006" script="default" start_index="1500"/>
	<table continent="world" folder="levels/instances/unique/cag_computer/world" index_size="300" name="cag_computer_007" position="2600 400 -149.996" rotation="0 0 -1 1.04308e-006" script="default" start_index="1800"/>
	<table continent="world" folder="levels/instances/unique/cag_computer/world" index_size="300" name="cag_computer_008" position="2450 397 -149.996" rotation="0 0 -1 1.04308e-006" script="default" start_index="2100"/>
</instances> 

I'm gonna show examples from the captain winters arriving in a helicopter instance I made. Video on that here: [1]

The ElementInstanceInput, ElementInstanceInputEvent, ElementInstanceOutput and ElementInstanceOutputEvent are used to communicate with the main world mission when a certain event has happened or for making a certain event happen. The ElementInstanceOutputEvent doesn't need to be executed.

The Captain Winters helicopter has a flyin ElementInstanceInput that starts the flyin_fwd_hover sequence on the helicopter. It also has another ElementInstanceInput that specifies which unit the helicopter should spawn. In this example I will be using the phalanx event.

<entry index="7" type="table">
	<entry key="class" type="string" value="ElementInstanceInput"/>
	<entry key="editor_name" type="string" value="flyin"/>
	<entry key="id" type="number" value="100007"/>
	<entry key="module" type="string" value="CoreElementInstance"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="event" type="string" value="flyin"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100008"/>
			</entry>
		</entry>
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry> 

Then the main car shop world mission has a ElementInstanceInputEvent that executes the flyin element in the instance.

<entry index="1938" type="table">
	<entry key="class" type="string" value="ElementInstanceInputEvent"/>
	<entry key="editor_name" type="string" value="blackhawk_fly_in"/>
	<entry key="id" type="number" value="114795"/>
	<entry key="module" type="string" value="CoreElementInstance"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="event_list" type="table">
			<entry index="1" type="table">
				<entry key="event" type="string" value="flyin"/> <!-- this executes the ElementInstanceInput that has flyin as its event -->
				<entry key="instance" type="string" value="blackhawk"/> <!-- this is the name of the instance this element should affect -->
			</entry>
			<entry index="2" type="table">
				<entry key="event" type="string" value="phalanx"/> <!-- this executes the ElementInstanceInput that has phalanx as its event -->
				<entry key="instance" type="string" value="blackhawk"/>
			</entry>
		</entry>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
		</entry>
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry> 

22 seconds after Winters has spawned the helicopter starts leaving. When the helicopter has been hidden it executes the chopper_left ElementInstanceOutput.

<entry index="13" type="table">
	<entry key="class" type="string" value="ElementInstanceOutput"/>
	<entry key="editor_name" type="string" value="chopper_left"/>
	<entry key="id" type="number" value="100018"/>
	<entry key="module" type="string" value="CoreElementInstance"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="event" type="string" value="chopper_left"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
		</entry>
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry> 

While in the main car shop world mission it has a ElementInstanceOutputEvent that checks for the chopper_left event.

<entry index="1974" type="table">
	<entry key="class" type="string" value="ElementInstanceOutputEvent"/>
	<entry key="editor_name" type="string" value="chopper_left"/>
	<entry key="id" type="number" value="104795"/>
	<entry key="module" type="string" value="CoreElementInstance"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="event_list" type="table">
			<entry index="1" type="table">
				<entry key="event" type="string" value="chopper_left"/>
				<entry key="instance" type="string" value="blackhawk"/>
			</entry>
		</entry>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="10"/>
				<entry key="id" type="number" value="114797"/>
			</entry>
			<entry index="2" type="table">
				<entry key="delay" type="number" value="10"/>
				<entry key="id" type="number" value="114798"/>
			</entry>
		</entry>
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry> 

Guides[edit]

Working with the editor[edit]

Basic keys[edit]

You move around with WASD, holding shift while moving your mouse will allow you to rotate the camera. e and q will move you up/down.

Pressing ctrl + c will copy the units you currently have selected. ctrl + v will make a duplicate of the units you copied in the location of the copied units.

Holding alt and moving the selected unit will clone the unit(using the move widget).

Pressing delete while selecting a unit will delete the unit.

Pressing ctrl + f while selecting a unit will teleport you to the unit.

Pressing f10 will switch between editing/playing the level.

Starting out with a new map[edit]

Mission[edit]

The mission file should look like this when you start:

<generic_scriptdata type="table">
	<entry key="default" type="table">
		<entry key="activate_on_parsed" type="boolean" value="true"/>
		<entry key="elements" type="table">
			<!-- put all the elements here -->
		</entry>
		<entry key="instances" type="table">
			<!-- this part is for instances -->
		</entry>
	</entry>
</generic_scriptdata> 


You should start the mission file by making a MissionScriptElement that will execute on startup.

<entry index="1" type="table">
	<entry key="class" type="string" value="MissionScriptElement"/>
	<entry key="editor_name" type="string" value="startup"/>
	<entry key="id" type="number" value="100001"/>
	<entry key="module" type="string" value="CoreMissionScriptElement"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="true"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="1"/>
				<entry key="id" type="number" value="100002"/> <!-- This is the delay element -->
			</entry>
			<entry index="2" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100003"/> <!-- This is the ElementPlayerSpawners -->
			</entry>
		</entry>
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry> 

The only elements that need to be executed on startup are ElementPlayerSpawner and ElementWhisperState. Any other elements that need to be executed should be put under another MissionScriptElement that will execute 1 second after the startup element. If you make too many elements execute on startup it could cause issues. Don't be messy and make everything execute on startup just because you are lazy. Keep things structured and in a nice order.

<entry index="2" type="table">
	<entry key="class" type="string" value="MissionScriptElement"/>
	<entry key="editor_name" type="string" value="delay"/>
	<entry key="id" type="number" value="100002"/>
	<entry key="module" type="string" value="CoreMissionScriptElement"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
		</entry>
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry>
<entry index="3" type="table">
	<entry key="class" type="string" value="MissionScriptElement"/>
	<entry key="editor_name" type="string" value="Spawners"/>
	<entry key="id" type="number" value="100003"/>
	<entry key="module" type="string" value="CoreMissionScriptElement"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100004"/>
			</entry>
			<entry index="2" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100005"/>
			</entry>
			<entry index="3" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100006"/>
			</entry>
			<entry index="4" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100007"/>
			</entry>
		</entry>
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry> 
<entry index="4" type="table">
	<entry key="class" type="string" value="ElementPlayerSpawner"/>
	<entry key="editor_name" type="string" value="Spawn_player_1"/>
	<entry key="id" type="number" value="100004"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
		</entry>
		<entry key="position" type="vector3" value="1000 1000 0"/>
		<entry key="rotation" type="quaternion" value="0 0 0 -1"/>
		<entry key="state" type="string" value="mask_off"/> <!-- mask_off for starting without your mask, standard for starting with mask on -->
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry>
<entry index="5" type="table">
	<entry key="class" type="string" value="ElementPlayerSpawner"/>
	<entry key="editor_name" type="string" value="Spawn_player_2"/>
	<entry key="id" type="number" value="100005"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
		</entry>
		<entry key="position" type="vector3" value="1050 1050 0"/>
		<entry key="rotation" type="quaternion" value="0 0 0 -1"/>
		<entry key="state" type="string" value="mask_off"/> <!-- mask_off for starting without your mask, standard for starting with mask on -->
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry>
<entry index="6" type="table">
	<entry key="class" type="string" value="ElementPlayerSpawner"/>
	<entry key="editor_name" type="string" value="Spawn_player_3"/>
	<entry key="id" type="number" value="100006"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
		</entry>
		<entry key="position" type="vector3" value="1100 1100 0"/>
		<entry key="rotation" type="quaternion" value="0 0 0 -1"/>
		<entry key="state" type="string" value="mask_off"/> <!-- mask_off for starting without your mask, standard for starting with mask on -->
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry>
<entry index="7" type="table">
	<entry key="class" type="string" value="ElementPlayerSpawner"/>
	<entry key="editor_name" type="string" value="Spawn_player_4"/>
	<entry key="id" type="number" value="100007"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
		</entry>
		<entry key="position" type="vector3" value="1150 1150 0"/>
		<entry key="rotation" type="quaternion" value="0 0 0 -1"/>
		<entry key="state" type="string" value="mask_off"/> <!-- mask_off for starting without your mask, standard for starting with mask on -->
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry> 

The next thing we need is an ElementAreaTrigger that will execute when the players have spawned in. I usually execute things like spawning civs/guards/loot from it.

<entry index="ID" type="table">
	<entry key="class" type="string" value="ElementAreaTrigger"/>
	<entry key="editor_name" type="string" value="Players_spawned"/>
	<entry key="id" type="number" value="ELEMENT ID"/>
	<entry key="module" type="string" value="CoreElementArea"/>
	<entry key="values" type="table">
		<entry key="amount" type="string" value="1"/>
		<entry key="base_delay" type="number" value="0"/>
		<entry key="depth" type="number" value="265.72"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="height" type="number" value="1002.67"/>
		<entry key="instigator" type="string" value="player"/>
		<entry key="interval" type="number" value="0.1"/>
		<entry key="on_executed" type="table">
		</entry>
		<entry key="position" type="vector3" value="-1414 2268 351"/>
		<entry key="radius" type="number" value="250"/>
		<entry key="rotation" type="quaternion" value="0 0 -0.707107 -0.707107"/>
		<entry key="shape_type" type="string" value="box"/>
		<entry key="spawn_unit_elements" type="table">
		</entry>
		<entry key="trigger_on" type="string" value="on_enter"/>
		<entry key="trigger_times" type="number" value="1"/>
		<entry key="use_disabled_shapes" type="boolean" value="false"/>
		<entry key="width" type="number" value="174.339"/>
	</entry>
</entry> 

Alter the position, height, width, depth and radius so that every ElementPlayerSpawner fits inside it.

Harassers[edit]

Harassers are a group of units that keep spawning while there's an assault. They are usually 3 or 4 units.

First you need to make 4 (or however many harassers you want) ElementSpawnEnemyDummy, one for each unit. The spawn position should be out of the players view. I like to use ene_swat_heavy_1 for harassers.

<entry index="382" type="table">
	<entry key="class" type="string" value="ElementSpawnEnemyDummy"/>
	<entry key="editor_name" type="string" value="office_harrasser_1"/>
	<entry key="id" type="number" value="100382"/>
	<entry key="values" type="table">
		<entry key="accessibility" type="string" value="any"/>
		<entry key="amount" type="number" value="0"/>
		<entry key="base_delay" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="enemy" type="string" value="units/payday2/characters/ene_swat_heavy_1/ene_swat_heavy_1"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="force_pickup" type="string" value="none"/>
		<entry key="interval" type="number" value="5"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100386"/>
			</entry>
		</entry>
		<entry key="participate_to_group_ai" type="boolean" value="true"/>
		<entry key="position" type="vector3" value="-1164 3149 4800"/>
		<entry key="rotation" type="quaternion" value="0 0 -2.68221e-007 -1"/>
		<entry key="spawn_action" type="string" value="none"/>
		<entry key="team" type="string" value="default"/>
		<entry key="trigger_times" type="number" value="0"/>
		<entry key="voice" type="number" value="0"/>
	</entry>
</entry>
<entry index="383" type="table">
	<entry key="class" type="string" value="ElementSpawnEnemyDummy"/>
	<entry key="editor_name" type="string" value="office_harrasser_2"/>
	<entry key="id" type="number" value="100383"/>
	<entry key="values" type="table">
		<entry key="accessibility" type="string" value="any"/>
		<entry key="amount" type="number" value="0"/>
		<entry key="base_delay" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="enemy" type="string" value="units/payday2/characters/ene_swat_heavy_1/ene_swat_heavy_1"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="force_pickup" type="string" value="none"/>
		<entry key="interval" type="number" value="5"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100387"/>
			</entry>
		</entry>
		<entry key="participate_to_group_ai" type="boolean" value="true"/>
		<entry key="position" type="vector3" value="-1244 3126 4800"/>
		<entry key="rotation" type="quaternion" value="0 0 -2.68221e-007 -1"/>
		<entry key="spawn_action" type="string" value="none"/>
		<entry key="team" type="string" value="default"/>
		<entry key="trigger_times" type="number" value="0"/>
		<entry key="voice" type="number" value="0"/>
	</entry>
</entry>
<entry index="384" type="table">
	<entry key="class" type="string" value="ElementSpawnEnemyDummy"/>
	<entry key="editor_name" type="string" value="office_harrasser_3"/>
	<entry key="id" type="number" value="100384"/>
	<entry key="values" type="table">
		<entry key="accessibility" type="string" value="any"/>
		<entry key="amount" type="number" value="0"/>
		<entry key="base_delay" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="enemy" type="string" value="units/payday2/characters/ene_swat_heavy_1/ene_swat_heavy_1"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="force_pickup" type="string" value="none"/>
		<entry key="interval" type="number" value="5"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100388"/>
			</entry>
		</entry>
		<entry key="participate_to_group_ai" type="boolean" value="true"/>
		<entry key="position" type="vector3" value="-1352 3142 4800"/>
		<entry key="rotation" type="quaternion" value="0 0 -2.68221e-007 -1"/>
		<entry key="spawn_action" type="string" value="none"/>
		<entry key="team" type="string" value="default"/>
		<entry key="trigger_times" type="number" value="0"/>
		<entry key="voice" type="number" value="0"/>
	</entry>
</entry>
<entry index="385" type="table">
	<entry key="class" type="string" value="ElementSpawnEnemyDummy"/>
	<entry key="editor_name" type="string" value="office_harrasser_4"/>
	<entry key="id" type="number" value="100385"/>
	<entry key="values" type="table">
		<entry key="accessibility" type="string" value="any"/>
		<entry key="amount" type="number" value="0"/>
		<entry key="base_delay" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="enemy" type="string" value="units/payday2/characters/ene_swat_heavy_1/ene_swat_heavy_1"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="force_pickup" type="string" value="none"/>
		<entry key="interval" type="number" value="5"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100389"/>
			</entry>
		</entry>
		<entry key="participate_to_group_ai" type="boolean" value="true"/>
		<entry key="position" type="vector3" value="-1441 3141 4800"/>
		<entry key="rotation" type="quaternion" value="0 0 -2.68221e-007 -1"/>
		<entry key="spawn_action" type="string" value="none"/>
		<entry key="team" type="string" value="default"/>
		<entry key="trigger_times" type="number" value="0"/>
		<entry key="voice" type="number" value="0"/>
	</entry>
</entry> 

Then you need to make 4 ElementSpecialObjective that will tell the units where to go. The ElementSpawnEnemyDummy should execute each ElementSpecialObjective respectively.

<entry index="386" type="table">
	<entry key="class" type="string" value="ElementSpecialObjective"/>
	<entry key="editor_name" type="string" value="harraser_1_SO"/>
	<entry key="id" type="number" value="100386"/>
	<entry key="values" type="table">
		<entry key="SO_access" type="string" value="16352"/>
		<entry key="action_duration_max" type="number" value="0"/>
		<entry key="action_duration_min" type="number" value="0"/>
		<entry key="ai_group" type="string" value="enemies"/>
		<entry key="align_position" type="boolean" value="true"/>
		<entry key="align_rotation" type="boolean" value="false"/>
		<entry key="attitude" type="string" value="avoid"/>
		<entry key="base_chance" type="number" value="1"/>
		<entry key="base_delay" type="number" value="0"/>
		<entry key="chance_inc" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="forced" type="boolean" value="true"/>
		<entry key="interaction_voice" type="string" value="none"/>
		<entry key="interrupt_dis" type="number" value="7"/>
		<entry key="interrupt_dmg" type="number" value="0"/>
		<entry key="interval" type="number" value="3"/>
		<entry key="is_navigation_link" type="boolean" value="false"/>
		<entry key="needs_pos_rsrv" type="boolean" value="false"/>
		<entry key="no_arrest" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
		</entry>
		<entry key="path_haste" type="string" value="none"/>
		<entry key="path_stance" type="string" value="none"/>
		<entry key="path_style" type="string" value="destination"/>
		<entry key="patrol_path" type="string" value="none"/>
		<entry key="pose" type="string" value="stand"/>
		<entry key="position" type="vector3" value="-230 3320 4800"/>
		<entry key="repeatable" type="boolean" value="false"/>
		<entry key="rotation" type="quaternion" value="0 0 0 0"/>
		<entry key="scan" type="boolean" value="true"/>
		<entry key="search_distance" type="number" value="0"/>
		<entry key="search_position" type="vector3" value="-93.1021 1791.86 0"/>
		<entry key="so_action" type="string" value="AI_sniper"/>
		<entry key="spawn_instigator_ids" type="table">
			<entry index="1" type="number" value="100382"/>
		</entry>
		<entry key="trigger_on" type="string" value="none"/>
		<entry key="trigger_times" type="number" value="0"/>
		<entry key="use_instigator" type="boolean" value="true"/>
	</entry>
</entry>
<entry index="387" type="table">
	<entry key="class" type="string" value="ElementSpecialObjective"/>
	<entry key="editor_name" type="string" value="harraser_2_SO"/>
	<entry key="id" type="number" value="100387"/>
	<entry key="values" type="table">
		<entry key="SO_access" type="string" value="16352"/>
		<entry key="action_duration_max" type="number" value="0"/>
		<entry key="action_duration_min" type="number" value="0"/>
		<entry key="ai_group" type="string" value="enemies"/>
		<entry key="align_position" type="boolean" value="true"/>
		<entry key="align_rotation" type="boolean" value="false"/>
		<entry key="attitude" type="string" value="avoid"/>
		<entry key="base_chance" type="number" value="1"/>
		<entry key="base_delay" type="number" value="0"/>
		<entry key="chance_inc" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="forced" type="boolean" value="true"/>
		<entry key="interaction_voice" type="string" value="none"/>
		<entry key="interrupt_dis" type="number" value="7"/>
		<entry key="interrupt_dmg" type="number" value="0"/>
		<entry key="interval" type="number" value="3"/>
		<entry key="is_navigation_link" type="boolean" value="false"/>
		<entry key="needs_pos_rsrv" type="boolean" value="false"/>
		<entry key="no_arrest" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
		</entry>
		<entry key="path_haste" type="string" value="none"/>
		<entry key="path_stance" type="string" value="none"/>
		<entry key="path_style" type="string" value="destination"/>
		<entry key="patrol_path" type="string" value="none"/>
		<entry key="pose" type="string" value="stand"/>
		<entry key="position" type="vector3" value="-48 3320 4800"/>
		<entry key="repeatable" type="boolean" value="false"/>
		<entry key="rotation" type="quaternion" value="0 0 0 0"/>
		<entry key="scan" type="boolean" value="true"/>
		<entry key="search_distance" type="number" value="0"/>
		<entry key="search_position" type="vector3" value="-93.1021 1791.86 0"/>
		<entry key="so_action" type="string" value="AI_sniper"/>
		<entry key="spawn_instigator_ids" type="table">
			<entry index="1" type="number" value="100383"/>
		</entry>
		<entry key="trigger_on" type="string" value="none"/>
		<entry key="trigger_times" type="number" value="0"/>
		<entry key="use_instigator" type="boolean" value="true"/>
	</entry>
</entry>
<entry index="388" type="table">
	<entry key="class" type="string" value="ElementSpecialObjective"/>
	<entry key="editor_name" type="string" value="harraser_3_SO"/>
	<entry key="id" type="number" value="100388"/>
	<entry key="values" type="table">
		<entry key="SO_access" type="string" value="16352"/>
		<entry key="action_duration_max" type="number" value="0"/>
		<entry key="action_duration_min" type="number" value="0"/>
		<entry key="ai_group" type="string" value="enemies"/>
		<entry key="align_position" type="boolean" value="true"/>
		<entry key="align_rotation" type="boolean" value="false"/>
		<entry key="attitude" type="string" value="avoid"/>
		<entry key="base_chance" type="number" value="1"/>
		<entry key="base_delay" type="number" value="0"/>
		<entry key="chance_inc" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="forced" type="boolean" value="true"/>
		<entry key="interaction_voice" type="string" value="none"/>
		<entry key="interrupt_dis" type="number" value="7"/>
		<entry key="interrupt_dmg" type="number" value="0"/>
		<entry key="interval" type="number" value="3"/>
		<entry key="is_navigation_link" type="boolean" value="false"/>
		<entry key="needs_pos_rsrv" type="boolean" value="false"/>
		<entry key="no_arrest" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
		</entry>
		<entry key="path_haste" type="string" value="none"/>
		<entry key="path_stance" type="string" value="none"/>
		<entry key="path_style" type="string" value="destination"/>
		<entry key="patrol_path" type="string" value="none"/>
		<entry key="pose" type="string" value="stand"/>
		<entry key="position" type="vector3" value="125 3320 4800"/>
		<entry key="repeatable" type="boolean" value="false"/>
		<entry key="rotation" type="quaternion" value="0 0 0 0"/>
		<entry key="scan" type="boolean" value="true"/>
		<entry key="search_distance" type="number" value="0"/>
		<entry key="search_position" type="vector3" value="-93.1021 1791.86 0"/>
		<entry key="so_action" type="string" value="AI_sniper"/>
		<entry key="spawn_instigator_ids" type="table">
			<entry index="1" type="number" value="100384"/>
		</entry>
		<entry key="trigger_on" type="string" value="none"/>
		<entry key="trigger_times" type="number" value="0"/>
		<entry key="use_instigator" type="boolean" value="true"/>
	</entry>
</entry>
<entry index="389" type="table">
	<entry key="class" type="string" value="ElementSpecialObjective"/>
	<entry key="editor_name" type="string" value="harraser_4_SO"/>
	<entry key="id" type="number" value="100389"/>
	<entry key="values" type="table">
		<entry key="SO_access" type="string" value="16352"/>
		<entry key="action_duration_max" type="number" value="0"/>
		<entry key="action_duration_min" type="number" value="0"/>
		<entry key="ai_group" type="string" value="enemies"/>
		<entry key="align_position" type="boolean" value="true"/>
		<entry key="align_rotation" type="boolean" value="false"/>
		<entry key="attitude" type="string" value="avoid"/>
		<entry key="base_chance" type="number" value="1"/>
		<entry key="base_delay" type="number" value="0"/>
		<entry key="chance_inc" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="forced" type="boolean" value="true"/>
		<entry key="interaction_voice" type="string" value="none"/>
		<entry key="interrupt_dis" type="number" value="7"/>
		<entry key="interrupt_dmg" type="number" value="0"/>
		<entry key="interval" type="number" value="3"/>
		<entry key="is_navigation_link" type="boolean" value="false"/>
		<entry key="needs_pos_rsrv" type="boolean" value="false"/>
		<entry key="no_arrest" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
		</entry>
		<entry key="path_haste" type="string" value="none"/>
		<entry key="path_stance" type="string" value="none"/>
		<entry key="path_style" type="string" value="destination"/>
		<entry key="patrol_path" type="string" value="none"/>
		<entry key="pose" type="string" value="stand"/>
		<entry key="position" type="vector3" value="398 3320 4800"/>
		<entry key="repeatable" type="boolean" value="false"/>
		<entry key="rotation" type="quaternion" value="0 0 0 0"/>
		<entry key="scan" type="boolean" value="true"/>
		<entry key="search_distance" type="number" value="0"/>
		<entry key="search_position" type="vector3" value="-93.1021 1791.86 0"/>
		<entry key="so_action" type="string" value="AI_sniper"/>
		<entry key="spawn_instigator_ids" type="table">
			<entry index="1" type="number" value="100385"/>
		</entry>
		<entry key="trigger_on" type="string" value="none"/>
		<entry key="trigger_times" type="number" value="0"/>
		<entry key="use_instigator" type="boolean" value="true"/>
	</entry>
</entry> 

The Spawn_instigator_ids should be the id's of the ElementSpawnEnemyDummy's. Having the so_action as AI_sniper means that the unit won't move when he reaches his location.

Now we can set up the spawning and repeating of the harassers.

First we need a MissionScriptElement that will execute all the ElementSpawnEnemyDummy to spawn the harassers.

<entry index="408" type="table">
	<entry key="class" type="string" value="MissionScriptElement"/>
	<entry key="editor_name" type="string" value="harasser"/>
	<entry key="id" type="number" value="100408"/>
	<entry key="module" type="string" value="CoreMissionScriptElement"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100382"/>
			</entry>
			<entry index="2" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100383"/>
			</entry>
			<entry index="3" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100384"/>
			</entry>
			<entry index="4" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100385"/>
			</entry>
		</entry>
		<entry key="trigger_times" type="number" value="1"/>
	</entry>
</entry> 

Then we need a ElementGlobalEventTrigger that will execute the harasser MissionScriptElement when the assault starts.

<entry index="409" type="table">
	<entry key="class" type="string" value="ElementGlobalEventTrigger"/>
	<entry key="editor_name" type="string" value="Spawn_harassers_when_assault"/>
	<entry key="id" type="number" value="100409"/>
	<entry key="module" type="string" value="CoreElementGlobalEventTrigger"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="global_event" type="string" value="start_assault"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100408"/>
			</entry>
		</entry>
		<entry key="position" type="vector3" value="-1500 -3100 2000"/>
		<entry key="rotation" type="quaternion" value="0 0 0 -1"/>
		<entry key="trigger_times" type="number" value="1"/>
	</entry>
</entry> 

Then we need a ElementToggle and a ElementFilter that will repeat the harasser MissionScriptElement.

<entry index="402" type="table">
	<entry key="class" type="string" value="ElementToggle"/>
	<entry key="editor_name" type="string" value="enable_harassers"/>
	<entry key="id" type="number" value="100402"/>
	<entry key="module" type="string" value="CoreElementToggle"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="0"/>
		<entry key="elements" type="table">
			<entry index="1" type="number" value="100408"/>
		</entry>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="0.05"/>
				<entry key="id" type="number" value="100403"/>
			</entry>
			<entry index="2" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100398"/>
			</entry>
			<entry index="3" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100394"/>
			</entry>
		</entry>
		<entry key="set_trigger_times" type="number" value="1"/>
		<entry key="toggle" type="string" value="on"/>
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry>
<entry index="403" type="table">
	<entry key="class" type="string" value="ElementFilter"/>
	<entry key="editor_name" type="string" value="if_assault_then_harassers"/>
	<entry key="id" type="number" value="100403"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="0"/>
		<entry key="difficulty_easy" type="boolean" value="true"/>
		<entry key="difficulty_hard" type="boolean" value="true"/>
		<entry key="difficulty_normal" type="boolean" value="true"/>
		<entry key="difficulty_overkill" type="boolean" value="true"/>
		<entry key="difficulty_overkill_145" type="boolean" value="true"/>
		<entry key="difficulty_overkill_290" type="boolean" value="true"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="mode_assault" type="boolean" value="true"/>
		<entry key="mode_control" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100408"/>
			</entry>
		</entry>
		<entry key="platform_ps3" type="boolean" value="true"/>
		<entry key="platform_win32" type="boolean" value="true"/>
		<entry key="player_1" type="boolean" value="true"/>
		<entry key="player_2" type="boolean" value="true"/>
		<entry key="player_3" type="boolean" value="true"/>
		<entry key="player_4" type="boolean" value="true"/>
		<entry key="position" type="vector3" value="3500 1500 4100"/>
		<entry key="rotation" type="quaternion" value="0 0 0 -1"/>
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry> 

We also need a ElementRandom and 3 MissionScriptElement for a delay between spawns. The delay MissionScriptElement should execute the enable_harassers ElementToggle.

<entry index="404" type="table">
	<entry key="class" type="string" value="ElementRandom"/>
	<entry key="editor_name" type="string" value="harasser_rand_delay"/>
	<entry key="id" type="number" value="100404"/>
	<entry key="module" type="string" value="CoreElementRandom"/>
	<entry key="values" type="table">
		<entry key="amount" type="number" value="1"/>
		<entry key="amount_random" type="number" value="0"/>
		<entry key="base_delay" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="ignore_disabled" type="boolean" value="true"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100405"/>
			</entry>
			<entry index="2" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100406"/>
			</entry>
			<entry index="3" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100407"/>
			</entry>
		</entry>
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry>
<entry index="405" type="table">
	<entry key="class" type="string" value="MissionScriptElement"/>
	<entry key="editor_name" type="string" value="delay1_harasser001"/>
	<entry key="id" type="number" value="100405"/>
	<entry key="module" type="string" value="CoreMissionScriptElement"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="25"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100402"/>
			</entry>
		</entry>
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry>
<entry index="406" type="table">
	<entry key="class" type="string" value="MissionScriptElement"/>
	<entry key="editor_name" type="string" value="delay2_harasser001"/>
	<entry key="id" type="number" value="100406"/>
	<entry key="module" type="string" value="CoreMissionScriptElement"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="35"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100402"/>
			</entry>
		</entry>
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry>
<entry index="407" type="table">
	<entry key="class" type="string" value="MissionScriptElement"/>
	<entry key="editor_name" type="string" value="delay3_harasser001"/>
	<entry key="id" type="number" value="100407"/>
	<entry key="module" type="string" value="CoreMissionScriptElement"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="45"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100402"/>
			</entry>
		</entry>
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry> 

Now that we have the spawns, SO and repeating set up we need to make the death and fleeing bits.

For death we need a ElementEnemyDummyTrigger, a ElementCounter, 2 ElementCounterOperator and a ElementCounterTrigger

<entry index="401" type="table">
	<entry key="class" type="string" value="ElementEnemyDummyTrigger"/>
	<entry key="editor_name" type="string" value="harasser_death"/>
	<entry key="id" type="number" value="100401"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="0"/>
		<entry key="elements" type="table">
			<entry index="1" type="number" value="100382"/>
			<entry index="2" type="number" value="100383"/>
			<entry index="3" type="number" value="100384"/>
			<entry index="4" type="number" value="100385"/>
		</entry>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="event" type="string" value="death"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100399"/>
			</entry>
		</entry>
		<entry key="position" type="vector3" value="3500 1600 4100"/>
		<entry key="rotation" type="quaternion" value="0 0 0 -1"/>
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry>
<entry index="397" type="table">
	<entry key="class" type="string" value="ElementCounter"/>
	<entry key="editor_name" type="string" value="harasser_death_counter"/>
	<entry key="id" type="number" value="100397"/>
	<entry key="module" type="string" value="CoreElementCounter"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="0"/>
		<entry key="counter_target" type="number" value="0"/>
		<entry key="digital_gui_unit_ids" type="table">
		</entry>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
		</entry>
		<entry key="trigger_times" type="number" value="1"/>
	</entry>
</entry>
<entry index="398" type="table">
	<entry key="class" type="string" value="ElementCounterOperator"/>
	<entry key="editor_name" type="string" value="reset_harasser_death_counter"/>
	<entry key="id" type="number" value="100398"/>
	<entry key="module" type="string" value="CoreElementCounter"/>
	<entry key="values" type="table">
		<entry key="amount" type="number" value="0"/>
		<entry key="base_delay" type="number" value="0"/>
		<entry key="elements" type="table">
			<entry index="1" type="number" value="100397"/>
		</entry>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
		</entry>
		<entry key="operation" type="string" value="set"/>
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry>
<entry index="399" type="table">
	<entry key="class" type="string" value="ElementCounterOperator"/>
	<entry key="editor_name" type="string" value="harasser_death_counter_add_1"/>
	<entry key="id" type="number" value="100399"/>
	<entry key="module" type="string" value="CoreElementCounter"/>
	<entry key="values" type="table">
		<entry key="amount" type="number" value="1"/>
		<entry key="base_delay" type="number" value="0"/>
		<entry key="elements" type="table">
			<entry index="1" type="number" value="100397"/>
		</entry>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
		</entry>
		<entry key="operation" type="string" value="add"/>
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry>
<entry index="400" type="table">
	<entry key="class" type="string" value="ElementCounterTrigger"/>
	<entry key="editor_name" type="string" value="harasser_death_counter_4_trigger"/>
	<entry key="id" type="number" value="100400"/>
	<entry key="module" type="string" value="CoreElementCounter"/>
	<entry key="values" type="table">
		<entry key="amount" type="number" value="4"/>
		<entry key="base_delay" type="number" value="0"/>
		<entry key="elements" type="table">
			<entry index="1" type="number" value="100397"/>
		</entry>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100404"/>
			</entry>
		</entry>
		<entry key="trigger_times" type="number" value="0"/>
		<entry key="trigger_type" type="string" value="value"/>
	</entry>
</entry> 

For Flee we need a ElementGlobalEventTrigger, a ElementSpecialObjective, a ElementSpecialObjectiveTrigger, a ElementAIRemove, a ElementCounter, 2 ElementCounterOperator and a ElementCounterTrigger

<entry index="410" type="table">
	<entry key="class" type="string" value="ElementGlobalEventTrigger"/>
	<entry key="editor_name" type="string" value="endAssault"/>
	<entry key="id" type="number" value="100410"/>
	<entry key="module" type="string" value="CoreElementGlobalEventTrigger"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="global_event" type="string" value="end_assault"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100390"/>
			</entry>
		</entry>
		<entry key="position" type="vector3" value="-1000 -1000 2000"/>
		<entry key="rotation" type="quaternion" value="0 0 0 -1"/>
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry>
<entry index="390" type="table">
	<entry key="class" type="string" value="ElementSpecialObjective"/>
	<entry key="editor_name" type="string" value="flee_SO_harassers"/>
	<entry key="id" type="number" value="100390"/>
	<entry key="values" type="table">
		<entry key="SO_access" type="string" value="16352"/>
		<entry key="action_duration_max" type="number" value="0"/>
		<entry key="action_duration_min" type="number" value="0"/>
		<entry key="ai_group" type="string" value="enemies"/>
		<entry key="align_position" type="boolean" value="true"/>
		<entry key="align_rotation" type="boolean" value="false"/>
		<entry key="attitude" type="string" value="avoid"/>
		<entry key="base_chance" type="number" value="1"/>
		<entry key="base_delay" type="number" value="0"/>
		<entry key="chance_inc" type="number" value="0"/>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="forced" type="boolean" value="false"/>
		<entry key="interaction_voice" type="string" value="none"/>
		<entry key="interrupt_dis" type="number" value="0"/>
		<entry key="interrupt_dmg" type="number" value="1"/>
		<entry key="interval" type="number" value="-1"/>
		<entry key="is_navigation_link" type="boolean" value="false"/>
		<entry key="needs_pos_rsrv" type="boolean" value="true"/>
		<entry key="no_arrest" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
		</entry>
		<entry key="path_haste" type="string" value="run"/>
		<entry key="path_stance" type="string" value="none"/>
		<entry key="path_style" type="string" value="destination"/>
		<entry key="patrol_path" type="string" value="none"/>
		<entry key="pose" type="string" value="none"/>
		<entry key="position" type="vector3" value="-1164 3149 4800"/>
		<entry key="repeatable" type="boolean" value="false"/>
		<entry key="rotation" type="quaternion" value="0 0 0 -1"/>
		<entry key="scan" type="boolean" value="true"/>
		<entry key="search_distance" type="number" value="0"/>
		<entry key="search_position" type="vector3" value="3500 2100 4100"/>
		<entry key="so_action" type="string" value="none"/>
		<entry key="spawn_instigator_ids" type="table">
			<entry index="1" type="number" value="100382"/>
			<entry index="2" type="number" value="100383"/>
			<entry index="3" type="number" value="100384"/>
			<entry index="4" type="number" value="100385"/>
		</entry>
		<entry key="trigger_on" type="string" value="none"/>
		<entry key="trigger_times" type="number" value="0"/>
		<entry key="use_instigator" type="boolean" value="false"/>
	</entry>
</entry>
<entry index="391" type="table">
	<entry key="class" type="string" value="ElementSpecialObjectiveTrigger"/>
	<entry key="editor_name" type="string" value="harassers_fled"/>
	<entry key="id" type="number" value="100391"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="0"/>
		<entry key="elements" type="table">
			<entry index="1" type="number" value="100390"/>
		</entry>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="event" type="string" value="complete"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100392"/>
			</entry>
		</entry>
		<entry key="position" type="vector3" value="3500 1800 4100"/>
		<entry key="rotation" type="quaternion" value="0 0 0 -1"/>
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry>
<entry index="392" type="table">
	<entry key="class" type="string" value="ElementAIRemove"/>
	<entry key="editor_name" type="string" value="harassers_remove"/>
	<entry key="id" type="number" value="100392"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="0"/>
		<entry key="elements" type="table">
		</entry>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100395"/>
			</entry>
		</entry>
		<entry key="position" type="vector3" value="3500 1700 4100"/>
		<entry key="rotation" type="quaternion" value="0 0 0 -1"/>
		<entry key="trigger_times" type="number" value="0"/>
		<entry key="true_death" type="boolean" value="false"/>
		<entry key="use_instigator" type="boolean" value="true"/>
	</entry>
</entry>
<entry index="393" type="table">
	<entry key="class" type="string" value="ElementCounter"/>
	<entry key="editor_name" type="string" value="harasser_flee_counter"/>
	<entry key="id" type="number" value="100393"/>
	<entry key="module" type="string" value="CoreElementCounter"/>
	<entry key="values" type="table">
		<entry key="base_delay" type="number" value="0"/>
		<entry key="counter_target" type="number" value="0"/>
		<entry key="digital_gui_unit_ids" type="table">
		</entry>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
		</entry>
		<entry key="trigger_times" type="number" value="1"/>
	</entry>
</entry>
<entry index="394" type="table">
	<entry key="class" type="string" value="ElementCounterOperator"/>
	<entry key="editor_name" type="string" value="reset_harasser_flee_counter"/>
	<entry key="id" type="number" value="100394"/>
	<entry key="module" type="string" value="CoreElementCounter"/>
	<entry key="values" type="table">
		<entry key="amount" type="number" value="0"/>
		<entry key="base_delay" type="number" value="0"/>
		<entry key="elements" type="table">
			<entry index="1" type="number" value="100393"/>
		</entry>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
		</entry>
		<entry key="operation" type="string" value="set"/>
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry>
<entry index="395" type="table">
	<entry key="class" type="string" value="ElementCounterOperator"/>
	<entry key="editor_name" type="string" value="harasser_flee_counter_add_1"/>
	<entry key="id" type="number" value="100395"/>
	<entry key="module" type="string" value="CoreElementCounter"/>
	<entry key="values" type="table">
		<entry key="amount" type="number" value="1"/>
		<entry key="base_delay" type="number" value="0"/>
		<entry key="elements" type="table">
			<entry index="1" type="number" value="100393"/>
		</entry>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
		</entry>
		<entry key="operation" type="string" value="add"/>
		<entry key="trigger_times" type="number" value="0"/>
	</entry>
</entry>
<entry index="396" type="table">
	<entry key="class" type="string" value="ElementCounterTrigger"/>
	<entry key="editor_name" type="string" value="harasser_flee_counter_4_trigger"/>
	<entry key="id" type="number" value="100396"/>
	<entry key="module" type="string" value="CoreElementCounter"/>
	<entry key="values" type="table">
		<entry key="amount" type="number" value="4"/>
		<entry key="base_delay" type="number" value="0"/>
		<entry key="elements" type="table">
			<entry index="1" type="number" value="100393"/>
		</entry>
		<entry key="enabled" type="boolean" value="true"/>
		<entry key="execute_on_startup" type="boolean" value="false"/>
		<entry key="on_executed" type="table">
			<entry index="1" type="table">
				<entry key="delay" type="number" value="0"/>
				<entry key="id" type="number" value="100404"/>
			</entry>
		</entry>
		<entry key="trigger_times" type="number" value="0"/>
		<entry key="trigger_type" type="string" value="value"/>
	</entry>
</entry> 

Drawing of how it's mapped[edit]

Harassers.jpg

Portals[edit]

Portals are in the .world file. They are used to only render units when you are inside a certain area.

<entry key="portal" type="table">
	<entry key="portals" type="table">
	</entry>
	<entry key="unit_groups" type="table">
		<entry key="office" type="table"> <!-- This is the name of the group -->
			<entry key="ids" type="table"> <!-- These are the ids of the units that should only render when the player is inside the area -->
				<entry index="287809" type="boolean" value="true"/> 
				<entry index="680818" type="boolean" value="true"/>
				<entry index="597059" type="boolean" value="true"/>
				<entry index="581760" type="boolean" value="true"/>
				<entry index="258118" type="boolean" value="true"/>
				<entry index="190472" type="boolean" value="true"/>
				<entry index="634028" type="boolean" value="true"/>
				<entry index="77840" type="boolean" value="true"/>
				<entry index="86388" type="boolean" value="true"/>
				<entry index="742800" type="boolean" value="true"/>
				<entry index="728505" type="boolean" value="true"/>
				<entry index="859614" type="boolean" value="true"/>
				<entry index="535983" type="boolean" value="true"/>
				<entry index="870439" type="boolean" value="true"/>
				<entry index="412581" type="boolean" value="true"/>
				<entry index="201685" type="boolean" value="true"/>
			</entry>
			<entry key="shapes" type="table"> <!-- These are the areas that the player need to be inside for the units to render -->
				<entry index="1" type="table">
					<entry key="depth" type="number" value="1000"/>
					<entry key="height" type="number" value="300"/>
					<entry key="position" type="vector3" value="-1750 4000 4800"/>
					<entry key="rotation" type="quaternion" value="0 0 0 0"/>
					<entry key="type" type="string" value="box"/>
					<entry key="width" type="number" value="2500"/>
				</entry>
			</entry>
		</entry>
	</entry>
</entry> 

Portals are great for improving performance. Because you can make it stop rendering units that the player can't see.