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
originalid
isn't -1 (the animid isn'tNone
), we ensure the entityrigid
is locked via LockRigid if theinsideid
doesn't match the current one and unlocked if it does match. This is only performed when the current value of the entityrigid.isKinematic
doesn't match the reality of theinsideid
matches or not. - If entity is in a
forcemove
and theinsideid
doesn't match the current one, StopForceMove is called
- If the
- If we are:
- If the entity isn't a
fixedentity
, theoriginalid
isn't -1 (the animid isn'tNone
) and it's not in aforcemove
, LockRigid(false, false) is called if theinsideid
matches 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
interactedwithhit
to true - Calls Interact with null arguments
- Set
interactedwithhit
to false in 1 second
As for the StealthAI
part, check its documentation to learn more.