modding:function:typcreate
typCreate
Syntax | (typCreate unid XML) → True/Nil |
---|---|
Arguments | unid: The UNID to assign to the created type. Must not already be bound to a type unless the code is run in OnGlobalTypesInit |
XML: The XML that defines the created type. Must be valid for type creation to work. Certain dynamic types are not supported at certain times. | |
Returns | True if the successful, Nil otherwise |
Category | type_functions |
Description | Supports “dynamic types,” or types that are generated by TLisp code and not fully defined in XML. Can be used during game creation or any time after the game starts. Does not support all types. |
Support
The following dynamic types are not supported at all.
- AdventureDesc
- Globals
- Image
- Music
- Sound
- EconomyType
- TemplateType
The following dynamic types can be created only during the event OnGlobalTypesInit, which fires when a new game is created.
- SystemType
- SystemTable
- SystemMap
All other types not listed here are always supported during an active game.
Example
Return to type functions list
Return to Functions list
modding/function/typcreate.txt · Last modified: 2017/06/12 01:07 by 0xabcdef