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 InventorySpot
s. 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] > Inventory
toWeaponPistol
. - Expand
Alliances > InitialAlliances > [0]
. - Set
AllianceLevel
to -1. - Set
AllianceName
toPlayer
. - Set
bPermanent
toTrue
.
Make an NPC an enemy of another NPC
- Add an NPC to your map and open its properties.
- Set
Inventory > InitialInventory > [0] > Inventory
toWeaponPistol
. - Expand
Alliances
. - Set
Alliance
toNPC1
. - Expand
InitialAlliances > [0]
. - Set
AllianceLevel
to -1. - Set
AllianceName
toNPC2
. - Set
bPermanent
toTrue
. - Perform steps 1-8 again, but swap
NPC1
andNPC2
.
Change alliances using AllianceTriggers
- Add an NPC to yor map and open its properties.
- Set
Inventory > InitialInventory > [0] > Inventory
toWeaponPistol
. - Set
Events > Tag
toMyEnemy
. - Add a
Triggers > Trigger > AllianceTrigger
from theActor Class Browser
to your map. - Open its properties and expand
AllianceTrigger > Alliances > [7]
. - Set
AllianceLevel
to -1. - Set
AllianceName
toPlayer
. - Set
bPermanent
toTrue
. - Set
Events > Event
toMyEnemy
. - 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.
Combat
-
Combat
- bAimForHead
- BaseAccuracy
¹ Lower BaseAccuracy
gives ScriptedPawn
s 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
¹ 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 |
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 |
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 theScriptedPawn
section. - Set
bImportant
toTrue
. - Expand the
Conversation
section and assign itsBindName
to something. - Test it by killing/knocking out the actor, bringing up the
legend
menu and clickingEdit Flags
. - It should show up as
[BindName]_Dead
and[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.