UnpackMapPrefab
Turns a prefab unit into the prefab’s objects, each a map object of its own.
One edit: the unit goes, its objects stay where they stood as ordinary map objects (they no longer follow the prefab), and what
sat on the unit stays where it is. The map editor’s inspector has “Unpack” for a selected unit; admins: /map prefab unpack <id>.
Syntax
Section titled “Syntax”UnpackMapPrefab(id)| Parameter | Type | |
|---|---|---|
id |
number | the unit |
Returns
Section titled “Returns”table - the new objects’ ids in the prefab’s order; nil and the reason
Example
Section titled “Example”local ids = UnpackMapPrefab(house)if ids then SetMapObject(ids[1], {tint = 0x806040FF}) end -- one of its objects changed on its ownSee also
Section titled “See also”CreateMapPrefab · GetMapPrefabParts · the The server’s map group of the index
