This repository was archived by the owner on Jun 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
This repository was archived by the owner on Jun 17, 2024. It is now read-only.
Rework attachments for model configs. #35
Copy link
Copy link
Open
Labels
conceptFeature concept or ideasFeature concept or ideasfeatureNew featureNew featuretopic:customizationRelated to mod customizationRelated to mod customization
Description
Problem
Right now model configs in JSON format use AMC-styled attachment definitions:
"Attachment 0" : {
"Model" : "Axis.mdl",
"Texture" : "Vector.tex",
},
"Attachment 1" : {
"Include" : "Attach.json",
},This doesn't look very efficient and model configs should make use of the JSON format. To access data, you need to make use of either keys in their entirety or values under the keys.
Solution
New proposed format for attachments would look like an Attachments dictionary with entries under each attachment index:
"Attachments" : {
"0" : {
"Model" : "Axis.mdl",
"Texture" : "Vector.tex",
},
"1" : {
"Include" : "Attach.json",
},
},Pros and cons
This new solution will come with a few pros and very minor cons.
Pros:
- Model attachments are strictly defined under the
Attachmentsblock. - Attachment indices as keys can be immediately converted into numbers for faster attachment access.
- These same index keys can later be reworked to utilize attachment names from a predefined
Attachment Listfile that can also be included in the config. - The block of attachments under index keys could also be replaced with an array, if needed, where each array entry will be a sequential attachment index. A
nullvalue could be used to skip some attachment.
Cons:
- Conversion from AMC to JSON will be a bit slower. But there are only player skins in AMC format, so it doesn't matter.
- Indices as key strings can look rather odd. But that's how generic JSON format looks like.
Metadata
Metadata
Assignees
Labels
conceptFeature concept or ideasFeature concept or ideasfeatureNew featureNew featuretopic:customizationRelated to mod customizationRelated to mod customization