NPC¶
An NPC is an entity that supports interactions and ActionBehaviors with a dialogue system via GetDialogue and emotes via CheckEmoteFlag.
Data arrays¶
dialogues: Check the GetDialogue documentation to learn moreemoticonflag: Check the CheckEmoteFlag documentation to learn more
Start / SetUp¶
The radius is incremented by 0.35 if it was less than 1.75.
Update (Inactive)¶
For every 3 frames, if the entity is in a forcemove without any SetPath or StealhAI behavior, StopForceMove is called on the entity.
LateUpdate (Non dummy)¶
We decides if we should lock/unlock the entity rigid and call StopForceMove only when the entity isn't dead, iskill, deathcoroutine isn't in progress and activeonpause is false.
It depends on inevent and whether or not the insideid matches the current one:
- If we aren't
inevent:- If the
originalidisn't -1 (the animid isn'tNone), we ensure the entityrigidis locked via LockRigid if theinsideiddoesn't match the current one and unlocked if it does match. This is only performed when the current value of the entityrigid.isKinematicdoesn't match the reality of theinsideidmatches or not. - If entity is in a
forcemoveand theinsideiddoesn't match the current one, StopForceMove is called
- If the
- If we are:
- If the entity isn't a
fixedentity, theoriginalidisn't -1 (the animid isn'tNone) and it's not in aforcemove, LockRigid(false, false) is called if theinsideidmatches the current one - Otherwise, StopForceMove is called instead
- If the entity isn't a
OnTriggerEnter¶
Only 2 things are handled here: the specialinteract if it's not None and some handling for the StealthAI behavior.
The specialinteract part does the following if the other collider tag is BeetleDash (or BeetleHorn if the specialinteract is AnyHorn):
- Set
interactedwithhitto true - Calls Interact with null arguments
- Set
interactedwithhitto false in 1 second
As for the StealthAI part, check its documentation to learn more.