Jump to content

WaypointActions.onWaypointArrival

From CMM Wiki
Return to CMM Command Reference
Environment: Mission Scripting
Function: waypointActions.onWaypointArrival
Function Description: Executes a predefined function at a specific waypoint index when a group arrives at a waypoint, using a stored function map. It checks if the group exists, retrieves the stored function from the group's waypoint actions table, invokes it safely with error handling, and logs success or failure.
File Location: cmm.spawnFunctions.lua
Syntax: CMM.waypointActions.onWaypointArrival( table _group , number _waypointIndex )
Return Value: nil
Parameters: Name Description
_groupThe unit group that has arrived at the waypoint, must exist to proceed with execution.
_waypointIndexThe index of the waypoint in the group's route, used to locate the corresponding callback function.
Example: CMM.waypointActions.onWaypointArrival(GroupA, 1)
Example Description: Triggers the callback function stored at index 1 for GroupA when it arrives at the first waypoint, safely executing it and logging any errors if they occur.
Related Functions:
Notes: --TODO CODE REVIEW REQUIRED