GetRandomHeading
Appearance
| Environment: | Mission Scripting | |
|---|---|---|
| Function: | GetRandomHeading | |
| Function Description: | Generates a random heading within a specified direction arc, supporting wraparound for arcs that span beyond 360 degrees. | |
| File Location: | cmm.positionFunctions.lua | |
| Syntax: | CMM.GetRandomHeading( number dir1 , number dir2 ) | |
| Return Value: | number | |
| Parameters: | Name | Description |
| dir1 | Left boundary of the direction arc in degrees, defaults to 0 if not provided. | |
| dir2 | Right boundary of the direction arc in degrees, defaults to 359 if not provided. | |
| Example: | CMM.GetRandomHeading(90, 180) | |
| Example Description: | Returns a random heading between 90 and 180 degrees, suitable for randomizing unit orientation within a northern-hemisphere arc. | |
| Related Functions: | ||
| Notes: | ||