PointsOnRoad
Appearance
| Environment: | Mission Scripting | |
|---|---|---|
| Function: | PointsOnRoad | |
| Function Description: | Calculates a series of points along a road path at a specified distance, starting from the first point and progressing sequentially until the target distance is reached. It adds each point to a table, stopping when the cumulative distance exceeds the specified value or reaches the end of the path. | |
| File Location: | cmm.spawnFunctions.lua | |
| Syntax: | CMM.PointsOnRoad( table PathOnRoadsTbl , number distance ) | |
| Return Value: | table | |
| Parameters: | Name | Description |
| PathOnRoadsTbl | Array of road points, each containing x and y coordinates, representing a path to traverse. | |
| distance | Target distance in units to measure along the path; defaults to 5000 if not provided or invalid. | |
| Example: | CMM.PointsOnRoad({{x=100,y=200},{x=300,y=400},{x=500,y=600}}, 3000) | |
| Example Description: | Retrieves points along a road path from (100,200) to (500,600), measuring 3000 units, and returns a table of points that lie within that distance. | |
| Related Functions: | ||
| Notes: | ||