4rpl:commands:createunitonterrain

This is an old revision of the document!


Index

CreateUnitOnTerrain

CreateUnitOnTerrain(<-CmodUID <-cellX <-cellZ <-initParams) ->unitUID

Description

Creates a unit from a CMOD UID (a unit template defined in a CPACK). You can get the CMOD UID from within the CPACK manager. CMOD UIDs are unique and never change. The UID can also be a name that specifies the name of an internal unit. See GetUnitSetting for a list of the names. The unit will be placed on the terrain at the supplied terrain cell coordinates. The lower left corner of the map is 0,0 and the top right is mapWidth,mapLength. The unit will be placed at a height (the Y position) based on the terrain height at the specified coordinates.
The unit UID will be pushed to the stack. If the unit can not be created, -1 is pushed to the stack. See CreateUnit for more details.

Examples

"abcdefgh1234567" ->cmodUID
CreateUnitOnTerrain(<-cmodUID 42 23 0) ->unitUID

Index

4rpl/commands/createunitonterrain.1611167989.txt.gz · Last modified: 2025/02/14 14:56 (external edit)