NPCs
Prerequisites
All NPCs can be found in the Actor Class Browser under Pawn > ScriptedPawn.
Note
The patrolling algorithm in vanilla Deus Ex is quite broken and can cause crashes. It is highly recommended to subclass ScriptedPawn and change the patrolling state to this
Note
Another problem with navigation is InventorySpots. Older versions of the edtor places them automatically with each Inventory actor, and they're hidden. The only way to make sure they're removed is to search for actors with the name InventorySpot and delete them before playing the map. Whenever navigation is rebuilt, however, they will be back again.
Alliances
An NPC will have an either positive or negative relationship towards a group or the player.
-
Alliances
- Alliance
-
InitialAlliances
- AllianceLevel
- AllianceName
- bPermanent
Make an NPC an enemy of the player
- Add an NPC to your map and open its properties.
- Set
Inventory > InitialInventory > [0] > InventorytoWeaponPistol. - Expand
Alliances > InitialAlliances > [0]. - Set
AllianceLevelto -1. - Set
AllianceNametoPlayer. - Set
bPermanenttoTrue.
Make an NPC an enemy of another NPC
- Add an NPC to your map and open its properties.
- Set
Inventory > InitialInventory > [0] > InventorytoWeaponPistol. - Expand
Alliances. - Set
AlliancetoNPC1. - Expand
InitialAlliances > [0]. - Set
AllianceLevelto -1. - Set
AllianceNametoNPC2. - Set
bPermanenttoTrue. - Perform steps 1-8 again, but swap
NPC1andNPC2.
Change alliances using AllianceTriggers
- Add an NPC to yor map and open its properties.
- Set
Inventory > InitialInventory > [0] > InventorytoWeaponPistol. - Set
Events > TagtoMyEnemy. - Add a
Triggers > Trigger > AllianceTriggerfrom theActor Class Browserto your map. - Open its properties and expand
AllianceTrigger > Alliances > [7]. - Set
AllianceLevelto -1. - Set
AllianceNametoPlayer. - Set
bPermanenttoTrue. - Set
Events > EventtoMyEnemy. - Play the map and walk into the trigger.
A diagram for clarity:
AllianceTrigger ┌─── "MyEnemy"
├─ Events │
│ └─ Event ────────────────────┤
└─ Alliances │
└─ [7] │
├─ AllianceLevel = -1 │
├─ AllianceName = Player │
└─ bPermanent = True │
│
MyEnemy │
├─ Events │
│ └─ Tag ──────────────────────┘
└─ Inventory
└─ InitialInventory
└─ [0]
└─ Inventory = WeaponPistol
Note
The alliances set in the AllianceTrigger will override the InitialAlliances defined on the NPC whose Events > Tag match the trigger's Events > Event, so it's a good idea to leave the first few alliances empty on the trigger.
Note
If you want to trigger an alliance change during a conversation, it's best to use the mission script, as the player can cancel the conversation midway by running off.
Behaviour
-
AI
- bEmitDistress
- RaiseAlarm
-
Fears
- bFearHacking
- bFearWeapon
- bFearShot
- bFearInjury
- bFearIndirectInjury
- bFearCarcass
- bFearDistress
- bFearAlarm
- bFearProjectiles
-
Reactions
- bReactFutz
- bReactPresence
- bReactLoudNoise
- bReactAlarm
- bReactShot
- bReactCarcass
- bReactDistress
- bReactProjectiles
-
Stimuli
- bHateHacking
- bHateWeapon
- bHateShot
- bHateInjury
- bHateIndirectInjury
- bHateCarcass
- bHateDistress
Combat
-
Combat
- bAimForHead
- BaseAccuracy
¹ Lower BaseAccuracy gives ScriptedPawns higher reload speed, more rate of fire (including during full auto), and tighter aim. A value as low as -0.25 might give many weapons literally perfect aim. -0.1 to -0.15 is generally a range one might use for boss type enemies, but it will start by calculating with the base stats of the weapon they have equipped.
Orders
-
Orders
- AlarmTag
- bFixedStart
- HomeExtent
- HomeTag
- Orders
- OrderTag
- SharedAlarmtag
¹ Set this to "Start" if you want the NPC to return to its initial location and rotation
² Possible values for the Orders field:
| Order | OrderTag | Description |
|---|---|---|
Dancing |
Plays the dancing animation. Use with the AI > bHokeyPokey property to make them spin |
|
Following |
Pawn |
Follows the target Pawn. Leave empty to follow the player. |
GoingTo |
PatrolPoint |
Walks to the target PatrolPoint |
Idle |
Does nothing | |
Patrolling |
PatrolPoint |
Follows the assigned patrol path |
RunningTo |
PatrolPoint |
Runs to the target PatrolPoint |
Shadowing |
Pawn |
Follows the target Pawn sneakily. Leave empty to shadow the player. |
Sitting |
Seat |
Sits down on a Seat (from Decorations > DeusExDecorations > Furniture) |
Standing |
Plays the standing animation | |
WaitingFor |
Pawn |
Waits for a Pawn |
Wandering |
Wanders within the HomeExtent of the HomeTag position |
Seats
To get a ScriptedPawn to sit down when a map loads:
- Make sure there is ample room between the seat and any other actors and brushes
- Place the
ScriptedPawndirectly facing theSeat - Ensure that
ScriptedPawnis not initially within view of the player
General settings
-
ScriptedPawn
- bHighlight
- bImportant
- bInvincible
- bInWorld
- ClotPeriod
- HealthArmLeft
- HealthArmRight
- HealthHead
- HealthLegLeft
- HealthLegRight
- HealthTorso
- SurprisePeriod
- WalkSound
Miscellaneous use cases
Detecting when a character is dead or unconscious
- Place any
Pawn > ScriptedPawn > ...in your map, enter its properties and expand theScriptedPawnsection. - Set
bImportanttoTrue. - Expand the
Conversationsection and assign itsBindNameto something. - Test it by killing/knocking out the actor, bringing up the
legendmenu and clickingEdit Flags. - It should show up as
[BindName]_Deadand[BindName]_Unconscious.
Note
As fas as flags are concerned, a character who is unconscious is also dead. So remember to check for the _Unconscious flag first, if you're using it in a conversation context.