And how to clone some already existing item? Use the same sprites and images but different properties
OXCE allows inheritance for almost all types of rulesets, via the refNode attribute. You can use this to create copies of weapons, armors, facilities, etc. that inherit everything from another existing object and just modify a few attributes to save space, prevent copy/paste mistakes and have automatic update/synch when the original item changes. Below is an example for creating a new Laser Sniper Rifle item from an existing Laser Rifle item:
items:
- &STR_LASER_RIFLE # Let's mark laser rifle info with an anchor
type: STR_LASER_RIFLE
size: 0.2
costSell: 36900
weight: 8
#
# a million other attributes...
#
- type: STR_LASER_SNIPER_RIFLE
refNode: *STR_LASER_RIFLE # First, let's inherit everything from the STR_LASER_RIFLE anchor.
bigSprite: xxx # And now let's give it a new sprite,
accuracyAimed: 160 # increase aimed shot accuracy
tuAuto: 0 # and disable auto shot.
OXCE allows changing how lists are overriden in sub-mods using YAML tags:
#base mod:
items:
- type: STR_WEAPON
compatibleAmmo: !info #this tag does not change anything, but when used it will show (in the log file) if the list supports this functionality or not
- STR_AMMO_1
- STR_AMMO_2
#sub-mod
items:
- type: STR_WEAPON
compatibleAmmo: !add #now `STR_WEAPON` will have ammo list equal to `[STR_AMMO_1, STR_AMMO_2, STR_AMMO_3]`
- STR_AMMO_3
#another sub-mod
items:
- type: STR_WEAPON
compatibleAmmo: !remove #now `STR_WEAPON` will have ammo list equal to `[STR_AMMO_1, STR_AMMO_3]`
- STR_AMMO_2