Copy an object into your module
clone_objectCopy an existing Mount & Blade II object into a writable module under a new ID, optionally changing attributes to create custom weapons, troops, heroes, or cultures.
Instructions
Copies an existing object (usually vanilla) into a writable module under a new id, optionally changing attributes — the fastest way to make a new weapon/troop/hero/culture based on an existing one. With new_id omitted the copy keeps the id and fully overrides the original. A plain 'name' gets a fresh {=id}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| set | No | Attributes to change on the copy's root element, e.g. {"name": "Royal Blade", "value": "5000"}. Values are strings. | |
| file | No | Optional target file under ModuleData. | |
| module | Yes | Target writable module. | |
| new_id | No | Id of the copy (omit to override the original with the same id). | |
| source | Yes | Object to copy: Item.x, NPCCharacter.x, Culture.x, … or bare id. | |
| validate | No | Run XSD validation after writing (default true). | |
| source_module | No | Copy this module's definition instead of the effective one. |