Create a prefab
prefab_createCreates a prefab in a module's Prefabs XML from a scene entity or game_entity XML, resetting position to origin unless keep_position is set.
Instructions
Saves a prefab into /Prefabs/_prefabs.xml from a scene entity (from_scene + entity; its position is reset to the origin) or from <game_entity> XML. The editor loads module prefabs at startup (restart it to see new ones).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xml | No | Alternatively a complete <game_entity> element. | |
| name | Yes | Prefab name (unique across modules). | |
| entity | No | Handle or name of the entity in from_scene. | |
| module | Yes | Writable module. | |
| overwrite | No | Replace an existing prefab with this name in the same module. | |
| from_scene | No | Scene that contains the source entity. | |
| keep_position | No | Keep the entity's position instead of moving it to the origin (default false). |