WaypointActions.insertWPCallback
Appearance
| 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 |
| WPTbl | The waypoint configuration table to modify, must contain a 'task' field with a 'params' field under 'tasks'. | |
| _groupName | The name of the group associated with the waypoint, used in the callback function name and message. | |
| _waypointNumber | The 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: | ||