My .frames file, currently:
{
"frameGrid" : {
"size" : [40, 10],
"dimensions" : [5, 1],
"names" : [
["absent", "present.5", "present.4", "present.3", "present.2"]
]
},
"alises": {
"present.default": "present.5",
"present.0": "present.2",
"present.1": "present.2"
}
}
Relevant section of the .animation file:
{
"properties" : {
"zLevel" : 4,
"centered" : true,
"image" : "<partImage>:present",
"offset" : [0, 0],
"transformationGroups" : ["weapon"]
},
"partStates" : {
"mag" : {
"present": {
"properties": {
"image": "<partImage>:present.<ammo>"
}
},
"absent": {
"properties": {
"image": "<partImage>:absent"
}
}
}
}
}
Without having to type an alias for each amount of ammo, how do I accomplish rendering either present.5 and present.2, depending on the amount of ammo remaining in the mag? (The max ammo of the gun is 8)
A workaround I thought of is defining "magAnimRange": [2, 5] in the .weaponability or .activeitem file and doing
animator.setGlobalTag("ammo",
self.magAnimRange[2] < storage.ammo and self.magAnimRange[2] or
storage.ammo < self.magAnimRange[1] and self.magAnimRange[1] or
storage.ammo)
Is there another way to do this?