armors:
- type: STR_NONE_UC
layersDefaultPrefix: HUMAN
layersSpecificPrefix:
8: JUMPSUIT
layersDefinition:
M0: ["", "", "M0_NAKED", "", "", "", "", "", "M_JUMPSUIT", "", "M0_FACE", "", "", "", "", ""]
M1: ["", "", "M1_NAKED", "", "", "", "", "", "M_JUMPSUIT", "", "M1_FACE", "", "", "", "", ""]
M2: ["", "", "M2_NAKED", "", "", "", "", "", "M_JUMPSUIT", "", "M2_FACE", "", "", "", "", ""]
M3: ["", "", "M3_NAKED", "", "", "", "", "", "M_JUMPSUIT", "", "M3_FACE", "", "", "", "", ""]
F0: ["", "", "F0_NAKED", "", "", "", "", "", "F_JUMPSUIT", "", "F0_FACE", "", "", "", "", ""]
F1: ["", "", "F1_NAKED", "", "", "", "", "", "F_JUMPSUIT", "", "F1_FACE", "", "", "", "", ""]
F2: ["", "", "F2_NAKED", "", "", "", "", "", "F_JUMPSUIT", "", "F2_FACE", "", "", "", "", ""]
F3: ["", "", "F3_NAKED", "", "", "", "", "", "F_JUMPSUIT", "", "F3_FACE", "", "", "", "", ""]
#
#
- type: STR_PERSONAL_ARMOR_UC
layersDefaultPrefix: HUMAN
layersSpecificPrefix:
8: PERSONAL_ARMOR
layersDefinition:
M0: ["", "", "M0_NAKED", "", "", "", "", "", "M_PERS_ARMOR", "", "M0_FACE"] #trailing ""s are not needed
M1: ["", "", "M1_NAKED", "", "", "", "", "", "M_PERS_ARMOR", "", "M1_FACE"]
M2: ["", "", "M2_NAKED", "", "", "", "", "", "M_PERS_ARMOR", "", "M2_FACE"]
M3: ["", "", "M3_NAKED", "", "", "", "", "", "M_PERS_ARMOR", "", "M3_FACE"]
F0: ["", "", "F0_NAKED", "", "", "", "", "", "F_PERS_ARMOR", "", "F0_FACE"]
F1: ["", "", "F1_NAKED", "", "", "", "", "", "F_PERS_ARMOR", "", "F1_FACE"]
F2: ["", "", "F2_NAKED", "", "", "", "", "", "F_PERS_ARMOR", "", "F2_FACE"]
F3: ["", "", "F3_NAKED", "", "", "", "", "", "F_PERS_ARMOR", "", "F3_FACE"]
extraSprites:
- typeSingle: JUMPSUIT__8__M_JUMPSUIT
fileSingle: Resources/LayeredJumpsuit/08-outer_clothes_armor_and_boots/male.png
- typeSingle: JUMPSUIT__8__F_JUMPSUIT
fileSingle: Resources/LayeredJumpsuit/08-outer_clothes_armor_and_boots/female.png
#
#
- typeSingle: PERSONAL_ARMOR__8__M_PERS_ARMOR
fileSingle: Resources/LayeredPersonalArmor/08-outer_clothes_armor_and_boots/male.png
- typeSingle: PERSONAL_ARMOR__8__F_PERS_ARMOR
fileSingle: Resources/LayeredPersonalArmor/08-outer_clothes_armor_and_boots/female.png
#
#
- typeSingle: HUMAN__2__M0_NAKED
fileSingle: Resources/LayeredHuman/02-body/M0_male_blond.png
- typeSingle: HUMAN__2__M1_NAKED
fileSingle: Resources/LayeredHuman/02-body/M1_male_brown.png
- typeSingle: HUMAN__2__M2_NAKED
fileSingle: Resources/LayeredHuman/02-body/M2_male_asian.png
- typeSingle: HUMAN__2__M3_NAKED
fileSingle: Resources/LayeredHuman/02-body/M3_male_african.png
- typeSingle: HUMAN__2__F0_NAKED
fileSingle: Resources/LayeredHuman/02-body/F0_female_blond.png
- typeSingle: HUMAN__2__F1_NAKED
fileSingle: Resources/LayeredHuman/02-body/F1_female_brown.png
- typeSingle: HUMAN__2__F2_NAKED
fileSingle: Resources/LayeredHuman/02-body/F2_female_asian.png
- typeSingle: HUMAN__2__F3_NAKED
fileSingle: Resources/LayeredHuman/02-body/F3_female_african.png
#
#
- typeSingle: HUMAN__10__M0_FACE
fileSingle: Resources/LayeredHuman/10-face/M0_male_blond.png
- typeSingle: HUMAN__10__M1_FACE
fileSingle: Resources/LayeredHuman/10-face/M1_male_brown.png
- typeSingle: HUMAN__10__M2_FACE
fileSingle: Resources/LayeredHuman/10-face/M2_male_asian.png
- typeSingle: HUMAN__10__M3_FACE
fileSingle: Resources/LayeredHuman/10-face/M3_male_african.png
- typeSingle: HUMAN__10__F0_FACE
fileSingle: Resources/LayeredHuman/10-face/F0_female_blond.png
- typeSingle: HUMAN__10__F1_FACE
fileSingle: Resources/LayeredHuman/10-face/F1_female_brown.png
- typeSingle: HUMAN__10__F2_FACE
fileSingle: Resources/LayeredHuman/10-face/F2_female_asian.png
- typeSingle: HUMAN__10__F3_FACE
fileSingle: Resources/LayeredHuman/10-face/F3_female_african.png
- typeSingle: HUMAN__10__F3_FACE
fileSingle: Resources/LayeredHuman/10-face/F3_female_african.png
- type: HUMAN__10__F3_FACE
singleImage: true
width: 320
height: 200
subX: 0
subY: 0
files:
0: Resources/LayeredHuman/10-face/F3_female_african.png
extraSprites:
- typeSingle: JUMPSUIT
layer: 8
spriteName: M_JUMPSUIT
fileSingle: Resources/LayeredJumpsuit/08-outer_clothes_armor_and_boots/male.png
Extending meaning, there is already case for M0, F1 etc.
I think that assigning meanining to the structure of / storing information in YAML identifiers is very wrong.
Can I ask what was the rationale behind that?
EDIT: versus something likeCode: [Select]extraSprites:
- typeSingle: JUMPSUIT
layer: 8
spriteName: M_JUMPSUIT
fileSingle: Resources/LayeredJumpsuit/08-outer_clothes_armor_and_boots/male.png
?
A question: is there always 16 layers? Because i can not find a reason to use more than 2.
The first sentence in the description says you can define any number you want :)
https://openxcom.org/forum/index.php/topic,6290.msg104464.html#msg104464
2 is fine as well.
M0: ["M0_NAKED", "JUMPSUIT"]
Just like that?1/ The idea was to hardcode as little as possible, soAll right, now i undersood all things. Thank you again.
- face is not any specific index
- there is no fixed naming required/possible
- and so on...
The time saving is that you don't have to merge those faces into any paperdolls manually now... but you just define it in the ruleset (for 30 faces that's approx. 1 minute instead of a few hours).
2/ As for instructions, I don't know how to write the instructions any better, so I just made a mod for you with just 3 layers.
See attachment.
layersSpecificPrefix:
8: JUMPSUIT
?default: DDD
specific:
0: AAAAAA
8: XXXXXX
instead ofspecific:
0: AAAAAA
1: DDD
2: DDD
3: DDD
4: DDD
5: DDD
6: DDD
7: DDD
8: XXXXXX
9: DDD
10: DDD
11: DDD
12: DDD
13: DDD
13: DDD
15: DDD
Feature implemented in OXCE 5.1
You can now define any number of layers you want to use in your mod.
It's the same number of layers for each paperdoll, so give it a little thought at the beginning, or you'll have to rework your ruleset if you decide to add a new layer somewhere in the middle later.
Furthermore, each layer can not only use its own sprites, but also sprites from other paperdolls.
(only one sprite "set" per layer)
I admit the description is not very simple/easy to understand... maybe some ruleset examples will help:Code: [Select]armors:
- type: STR_NONE_UC
layersDefaultPrefix: HUMAN
layersSpecificPrefix:
8: JUMPSUIT
layersDefinition:
M0: ["", "", "M0_NAKED", "", "", "", "", "", "M_JUMPSUIT", "", "M0_FACE", "", "", "", "", ""]
M1: ["", "", "M1_NAKED", "", "", "", "", "", "M_JUMPSUIT", "", "M1_FACE", "", "", "", "", ""]
M2: ["", "", "M2_NAKED", "", "", "", "", "", "M_JUMPSUIT", "", "M2_FACE", "", "", "", "", ""]
M3: ["", "", "M3_NAKED", "", "", "", "", "", "M_JUMPSUIT", "", "M3_FACE", "", "", "", "", ""]
F0: ["", "", "F0_NAKED", "", "", "", "", "", "F_JUMPSUIT", "", "F0_FACE", "", "", "", "", ""]
F1: ["", "", "F1_NAKED", "", "", "", "", "", "F_JUMPSUIT", "", "F1_FACE", "", "", "", "", ""]
F2: ["", "", "F2_NAKED", "", "", "", "", "", "F_JUMPSUIT", "", "F2_FACE", "", "", "", "", ""]
F3: ["", "", "F3_NAKED", "", "", "", "", "", "F_JUMPSUIT", "", "F3_FACE", "", "", "", "", ""]
#
#
- type: STR_PERSONAL_ARMOR_UC
layersDefaultPrefix: HUMAN
layersSpecificPrefix:
8: PERSONAL_ARMOR
layersDefinition:
M0: ["", "", "M0_NAKED", "", "", "", "", "", "M_PERS_ARMOR", "", "M0_FACE"] #trailing ""s are not needed
M1: ["", "", "M1_NAKED", "", "", "", "", "", "M_PERS_ARMOR", "", "M1_FACE"]
M2: ["", "", "M2_NAKED", "", "", "", "", "", "M_PERS_ARMOR", "", "M2_FACE"]
M3: ["", "", "M3_NAKED", "", "", "", "", "", "M_PERS_ARMOR", "", "M3_FACE"]
F0: ["", "", "F0_NAKED", "", "", "", "", "", "F_PERS_ARMOR", "", "F0_FACE"]
F1: ["", "", "F1_NAKED", "", "", "", "", "", "F_PERS_ARMOR", "", "F1_FACE"]
F2: ["", "", "F2_NAKED", "", "", "", "", "", "F_PERS_ARMOR", "", "F2_FACE"]
F3: ["", "", "F3_NAKED", "", "", "", "", "", "F_PERS_ARMOR", "", "F3_FACE"]
Based on this, sprites with composite name will need to be defined.
First part is the "prefix" (e.g. HUMAN), then layer number (e.g. 8) and last sprite name (e.g. M0_FACE); they are separated by two underscores.
Example:Code: [Select]extraSprites:
- typeSingle: JUMPSUIT__8__M_JUMPSUIT
fileSingle: Resources/LayeredJumpsuit/08-outer_clothes_armor_and_boots/male.png
- typeSingle: JUMPSUIT__8__F_JUMPSUIT
fileSingle: Resources/LayeredJumpsuit/08-outer_clothes_armor_and_boots/female.png
#
#
- typeSingle: PERSONAL_ARMOR__8__M_PERS_ARMOR
fileSingle: Resources/LayeredPersonalArmor/08-outer_clothes_armor_and_boots/male.png
- typeSingle: PERSONAL_ARMOR__8__F_PERS_ARMOR
fileSingle: Resources/LayeredPersonalArmor/08-outer_clothes_armor_and_boots/female.png
#
#
- typeSingle: HUMAN__2__M0_NAKED
fileSingle: Resources/LayeredHuman/02-body/M0_male_blond.png
- typeSingle: HUMAN__2__M1_NAKED
fileSingle: Resources/LayeredHuman/02-body/M1_male_brown.png
- typeSingle: HUMAN__2__M2_NAKED
fileSingle: Resources/LayeredHuman/02-body/M2_male_asian.png
- typeSingle: HUMAN__2__M3_NAKED
fileSingle: Resources/LayeredHuman/02-body/M3_male_african.png
- typeSingle: HUMAN__2__F0_NAKED
fileSingle: Resources/LayeredHuman/02-body/F0_female_blond.png
- typeSingle: HUMAN__2__F1_NAKED
fileSingle: Resources/LayeredHuman/02-body/F1_female_brown.png
- typeSingle: HUMAN__2__F2_NAKED
fileSingle: Resources/LayeredHuman/02-body/F2_female_asian.png
- typeSingle: HUMAN__2__F3_NAKED
fileSingle: Resources/LayeredHuman/02-body/F3_female_african.png
#
#
- typeSingle: HUMAN__10__M0_FACE
fileSingle: Resources/LayeredHuman/10-face/M0_male_blond.png
- typeSingle: HUMAN__10__M1_FACE
fileSingle: Resources/LayeredHuman/10-face/M1_male_brown.png
- typeSingle: HUMAN__10__M2_FACE
fileSingle: Resources/LayeredHuman/10-face/M2_male_asian.png
- typeSingle: HUMAN__10__M3_FACE
fileSingle: Resources/LayeredHuman/10-face/M3_male_african.png
- typeSingle: HUMAN__10__F0_FACE
fileSingle: Resources/LayeredHuman/10-face/F0_female_blond.png
- typeSingle: HUMAN__10__F1_FACE
fileSingle: Resources/LayeredHuman/10-face/F1_female_brown.png
- typeSingle: HUMAN__10__F2_FACE
fileSingle: Resources/LayeredHuman/10-face/F2_female_asian.png
- typeSingle: HUMAN__10__F3_FACE
fileSingle: Resources/LayeredHuman/10-face/F3_female_african.png
As you can see, we have added also a shorter way of defining single sprites.
The following definitions are equivalent:Code: [Select]- typeSingle: HUMAN__10__F3_FACE
fileSingle: Resources/LayeredHuman/10-face/F3_female_african.pngCode: [Select]- type: HUMAN__10__F3_FACE
singleImage: true
width: 320
height: 200
subX: 0
subY: 0
files:
0: Resources/LayeredHuman/10-face/F3_female_african.png
I am also attaching a working sample, which you can try with xcom1... it replaces paperdolls for jump suits and personal armor.
PS: for big mods, this could cut down the number of paperdolls by 90% or more... and improve both loading time and memory usage... and most importantly time to create new paperdolls
Could you please suggest, where in the armor encoding the head is encoded?
Are these parts of definition (under the key layersDefinition, layersDefaultPrefix and layersSpecificPrefix) intended for torso only?
There is no fixed place for the head (or any other part of the paperdoll), it is fully up to the modder to decide.
No, it's the complete paperdoll, not just the torso.
What values determine the appearance on battlescape? Is battlespace appearance computed automatically from the "paperdoll" model?
Could you please suggest, where in the armor encoding the head is encoded?
0 - background
1 - rear clothes
2 - body
3 - underwear
4 - body accessories 1
5 - body accessories 2
6 - inner clothes
7 - outer clothes, armor & boots
8 - accessories 1
9 - accessories 2
10 - face
11 - facial accessories 1 (masks)
12 - facial accessories 2 (goggles)
13 - frontal hair
14 - helmet
15 - shield