Jump to content

OnRoad

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (OnRoad – created via PowerShell script (2025-11-11T21:12:41Z))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Return to CMM Command Reference
Environment: Mission Scripting
Function: OnRoad
Function Description: Checks whether a given 3D position lies on a road surface by validating the input and querying the surface type at the projected 2D point. If the input is invalid or missing coordinates, it logs an error and returns false. Otherwise, it returns true if the surface type is road (ID 4).
File Location: cmm.spawnFunctions.lua
Syntax: CMM.OnRoad( table vec3 )
Return Value: boolean
Parameters: Name Description
vec3{x <number>, y <number>, z <number>} – 3D position vector; if not a table or missing x or y, an error is logged and false is returned.
Example: CMM.OnRoad({x=100,y=200,z=300})
Example Description: Evaluates whether the point (100,200,300) lies on a road surface by checking the surface type at the (100,200) 2D projection, returning true if it is a road.
Related Functions:
Notes: