Jump to content

WaypointActions.insertWPCallback

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (waypointActions.insertWPCallback – created via PowerShell script (2025-11-11T21:12:44Z))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Return to CMM Command Reference
Environment: Mission Scripting
Function: waypointActions.insertWPCallback
Function Description: Injects a callback action into a waypoint task table, enabling execution of custom Lua scripts when a unit reaches a waypoint. It validates input, constructs a task with a wrapped action, and logs the modified waypoint structure for debugging.
File Location: cmm.spawnFunctions.lua
Syntax: CMM.waypointActions.insertWPCallback( table WPTbl , string _groupName , number _waypointNumber )
Return Value: table
Parameters: Name Description
WPTblThe waypoint configuration table to modify, must contain a 'task' field with a 'params' field under 'tasks'.
_groupNameThe name of the group associated with the waypoint, used in the callback function name and message.
_waypointNumberThe sequential number of the waypoint, used to identify the specific waypoint in the path.
Example: CMM.waypointActions.insertWPCallback({<taskTable>, "GroupA", 1)
Example Description: Adds a callback task to the waypoint for "GroupA" at position 1, which executes the DoWayPointStuff function when the group arrives at the waypoint, and logs the updated structure for debugging.
Related Functions:
Notes: