OnNpcMoveComplete

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search

onNpcMoveComplete

AVAILABLE FROM UPDATE 0.1.2
This event is available in G1R:MP 0.1.2 and later. The contract below includes the compatibility guarantees introduced in that update.

Triggered once when a resource-owned NPC reaches its direct scripted movement goal.

Availability

This event is available in server-side scripts.

Callback signature

onNpcMoveComplete(npcId)

Parameters

Name Type Description
npcId int The NPC identifier that reached its goal.

Examples

Handle the event:

addEventHandler("onNpcMoveComplete", resourceRoot, function(npcId)
    outputDebugString("NPC " .. npcId .. " reached its scripted goal")
end)

Notes

  • This owner-only event is delivered to the creating resource's resourceRoot, not broadcast to unrelated resources.
  • It is emitted only for a setNpcMoveGoal arrival. Explicit stops and mode changes clear the goal without emitting completion.
  • Completion is an edge event; scripts should not poll position every server tick.