This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
4rpl:commands:createunit [2020/07/07 18:06] – Karsten75 | 4rpl:commands:createunit [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
~~NOTOC~~ | ~~NOTOC~~ | ||
+ | < | ||
+ | <= [[4rpl: | ||
- | ====== | + | |
+ | ====== | ||
CreateUnit(< | CreateUnit(< | ||
===== Description ===== | ===== 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. | + | Creates a unit from a CMOD UID (a unit template defined in a CPACK referred to as GUID). You can get the GUID from within the CPACK manager. |
- | The unit will be placed at the supplied 3D vector position. | + | The unit will be placed at the supplied 3D vector position.\\ |
- | The initParams are a table that contains a set of variables that will be set on the newly created unit.\\ | + | The initParams are a table that contains a set of variables that will be set on the newly created unit. See [[GetUnitSettings]] for a list of the data names that can be specified in the initData table when creating built in units.\\ |
The unit UID will be pushed to the stack. If the unit can not be created, -1 is pushed to the stack. | The unit UID will be pushed to the stack. If the unit can not be created, -1 is pushed to the stack. | ||
- | **Note:** In-game units can also be created using this API. For a list of identifiers, see [[xrpl: | + | :NOTE: When creating spores, keep in mind that they have a max height |
===== Examples ===== | ===== Examples ===== | ||
Line 20: | Line 23: | ||
CreateUnit(< | CreateUnit(< | ||
</ | </ | ||
+ | |||
+ | ==== See Also ==== | ||
+ | * [[4rpl: | ||
+ | |||
+ | < | ||