Skip to content
This repository was archived by the owner on Jun 17, 2024. It is now read-only.
This repository was archived by the owner on Jun 17, 2024. It is now read-only.

Rework attachments for model configs. #35

@DreamyCecil

Description

@DreamyCecil

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 Attachments block.
  • 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 List file 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 null value 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

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions