---
title: "BG2: ToB Identifiers"
---
BG2: ToB Identifiers
Objects can be split broadly into three categories; static objects, marked objects and object specifiers. Static objects (e.g. Player1, MySelf) are always bound (and in fact, they always return the same creature). Marked objects (e.g. LastSeenBy, LastAttackerOf) are almost always bound. Object specifiers (e.g. [ENEMY.0.0.MAGE] are not bound - they are checked every time they are referenced. Objects listed in objects.ids are marked objects and are not saved over game sessions. Note that Group objects are determined by the specifics value set in the creature file (0x274).
NB. Nearest() identifiers cascade outwards, i.e. if there are only three valid creatures, FourthNearest() and above will return the third nearest creature (rather than false).
20
0 Nothing
1 Myself
2 LeaderOf
This object is not implemented.
Returns the weakest player character (in the party).
Returns the strongest player character (in the party).
Returns the most damaged player character (in the party).
Returns the least damaged player character (in the party).
8 ProtectedBy
9 ProtectorOf
Returns the creature that last inflicted physical damage on the active creature.
This object may not be implemented.
12 NearestEnemyOf
13 LastCommandedBy
Returns the nearest visible creature - usually the active creature.
15 LastHitter
16 LastHelp
17 LastTrigger
Set by See() and Detect(), not by Exists() or Range().
19 LastTalkedToBy
20 LastHeardBy
21 Player1
22 Player2
23 Player3
24 Player4
25 Player5
26 Player6
27 Protagonist
Returns the strongest male player character (in the party).
29 SecondNearestEnemyOf
Returns the second nearest visible (unless the active creature has the detect invisible effect currently applied) enemy of the target creature.
30 ThirdNearestEnemyOf
Returns the third nearest visible (unless the active creature has the detect invisible effect currently applied) enemy of the target creature.
31 FourthNearestEnemyOf
Returns the fourth nearest visible (unless the active creature has the detect invisible effect currently applied) enemy of the target creature.
32 FifthNearestEnemyOf
Returns the fifth nearest visible (unless the active creature has the detect invisible effect currently applied) enemy of the target creature.
33 SixthNearestEnemyOf
Returns the sixth nearest visible (unless the active creature has the detect invisible effect currently applied) enemy of the target creature.
34 SeventhNearestEnemyOf
Returns the seventh nearest visible (unless the active creature has the detect invisible effect currently applied) enemy of the target creature.
35 EigthNearestEnemyOf
Returns the eigth nearest visible (unless the active creature has the detect invisible effect currently applied) enemy of the target creature.
36 NinthNearestEnemyOf
Returns the ninth nearest visible (unless the active creature has the detect invisible effect currently applied) enemy of the target creature.
37 TenthNearestEnemyOf
Returns the tenth nearest visible (unless the active creature has the detect invisible effect currently applied) enemy of the target creature.
38 SecondNearest
Returns the second nearest visible (unless the active creature has the detect invisible effect currently applied) creature.
39 ThirdNearest
Returns the third nearest visible (unless the active creature has the detect invisible effect currently applied) creature.
40 FourthNearest
Returns the forth nearest visible (unless the active creature has the detect invisible effect currently applied) creature.
41 FifthNearest
Returns the fifth nearest visible (unless the active creature has the detect invisible effect currently applied) creature.
42 SixthNearest
Returns the sixth nearest visible (unless the active creature has the detect invisible effect currently applied) creature.
43 SeventhNearest
Returns the seventh nearest visible (unless the active creature has the detect invisible effect currently applied) creature.
44 EighthNearest
Returns the eigth nearest visible (unless the active creature has the detect invisible effect currently applied) creature.
45 NinthNearest
Returns the ninth nearest visible (unless the active creature has the detect invisible effect currently applied) creature.
46 TenthNearest
Returns the tenth nearest visible (unless the active creature has the detect invisible effect currently applied) creature.
47 WorstAC
Returns the player character (in the party) with the highest AC.
48 BestAC
Returns the player character (in the party) with the lowest AC.
49 LastSummonerOf
50 NearestEnemyOfType
51 SecondNearestEnemyOfType
52 ThirdNearestEnemyOfType
53 FourthNearestEnemyOfType
54 FifthNearestEnemyOfType
55 SixthNearestEnemyOfType
56 SeventhNearestEnemyOfType
57 EigthNearestEnemyOfType
58 NinthNearestEnemyOfType
59 TenthNearestEnemyOfType
60 NearestMyGroupOfType
61 SecondNearestMyGroupOfType
62 ThirdNearestMyGroupOfType
63 FourthNearestMyGroupOfType
64 FifthNearestMyGroupOfType
65 SixthNearestMyGroupOfType
66 SeventhNearestMyGroupOfType
67 EigthNearestMyGroupOfType
68 NinthNearestMyGroupOfType
69 TenthNearestMyGroupOfType
Returns the player in the first portrait slot.
Returns the player in the second portrait slot.
Returns the player in the third portrait slot.
Returns the player in the fourth portrait slot.
Returns the player in the fifth portrait slot.
Returns the player in the sixth portrait slot.
Returns the nearest closed door (does not detect secret doors, or locked doors). This trigger does not work correctly with nested objects (e.g. NearestDoor(Myself)).
77 SecondNearestDoor
78 ThirdNearestDoor
79 FourthNearestDoor
80 FifthNearestDoor
81 SixthNearestDoor
82 SeventhNearestDoor
83 EighthNearestDoor
84 NinthNearestDoor
85 TenthNearestDoor