- Documentation
- Client functions
- engineLoadCOL
Function
engineLoadCOL
Loads a collision from a resource file (COLL, COL2, COL3, COL4 formats; from an archive it takes the first model) or from file bytes.
Syntax
col engineLoadCOL(string colFileOrData)Arguments
colFileOrDatastring- A
.colfile or its data.
Returns
The collision or false.
Example
local col = engineLoadCOL("modele/rampa.col")
if col then engineReplaceCOL(col, 1634) end
See also
engineReplaceCOLReplaces an object model's collision with one fromengineLoadCOLorengineGenerateCOL(also for map objects with that number and the day/night pair model). Objects only, not peds and vehicles. If the model does not exist in the game yet (a newengineRequestModelmodel while the player joins or a resource restarts), the collision waits and applies as soon as the model appears; a model number that does not exist givesfalse.engineGetCOLInfoReturns data about a collision fromengineLoadCOL: the version, the name, the number of spheres, boxes, faces and vertices and theboxbounds.engineGenerateCOLCreates a COL3 collision from a model fromengineLoadMeshwhen the author did not supply a.colfile. You set the triangle count (QEM simplification keeps the shape), the mode (mesh, convex hull, boxes, sphere) and the surface. Pass the result toengineReplaceCOL.