Files
vcmi/config/schemas/heroClass.json
T
Ivan Savenko 8e71d54c63 Allow mods to provide save and map compatibilty
Now `compatibilityIdentifers` field is supported for all game entities.
As result it is now possible for mods to provide compatibility support
for loading mods and saves made with older version of the mod.

Also, added docs to specify what exactly breaks saves with mods updates
and ways to avoid that
2026-02-01 12:27:00 +02:00

120 lines
3.3 KiB
JSON

{
"type" : "object",
"$schema" : "http://json-schema.org/draft-04/schema",
"title" : "VCMI hero class format",
"description" : "Format used to define classes of heroes in VCMI",
"required" : [
"name", "faction", "affinity", "commander", "animation", "mapObject",
"primarySkills", "secondarySkills", "lowLevelChance", "highLevelChance",
"defaultTavern", "tavern"
],
"additionalProperties" : false,
"properties" : {
"compatibilityIdentifiers" : {
"type" : "array",
"items" : {
"type" : "string"
},
"description" : "Additional identifiers that may refer to this object, to provide compatibility after object has been renamed"
},
"name" : {
"type" : "string",
"description" : "Translatable name of hero class"
},
"faction" : {
"type" : "string",
"description" : "Identifier of faction this class belongs to"
},
"affinity" : {
"type" : "string",
"description" : "Affinity of hero class, might or magic",
"enum" : [ "might", "magic"]
},
"commander" : {
"type" : "string",
"description" : "Identifier of creature that is used as commander by heroes"
},
"animation" : {
"type" : "object",
"additionalProperties" : false,
"description" : "Files related to hero animation",
"required" : [ "battle" ],
"properties" : {
"battle" : {
"type" : "object",
"additionalProperties" : false,
"description" : "Hero animations for battle",
"required" : [ "female", "male" ],
"properties" : {
"female" : {
"type" : "string",
"description" : "Female version",
"format" : "animationFile"
},
"male" : {
"type" : "string",
"description" : "Male version",
"format" : "animationFile"
}
}
}
}
},
"mapObject" : {
// NOTE: this entry is merged with corresponding base entry in hero object type and validated as objectType
"type" : "object",
"properties" : {
"filters" : {
"type" : "object",
"additionalProperties" : true
}
}
},
"primarySkills" : {
"type" : "object",
"description" : "Initial primary skills of heroes",
"additionalProperties" : {
"type" : "number"
}
},
"secondarySkills" : {
"type" : "object",
"description" : "Chance to get specific secondary skill on level-up. All missing skills are considered to be banned",
"additionalProperties" : {
"type" : "number"
}
},
"lowLevelChance" : {
"type" : "object",
"description" : "Chance to get specific primary skill on level-up, applicable for levels less than 10",
"additionalProperties" : {
"type" : "number"
}
},
"highLevelChance" : {
"type" : "object",
"description" : "Chance to get specific primary skill on level-up, applicable for levels starting from 10",
"additionalProperties" : {
"type" : "number"
}
},
"defaultTavern" : {
"type" : "number",
"description" : "Default chance for hero to appear in tavern, used only when value vas not set in tavern field",
"minimum" : 0
},
"tavern" : {
"type" : "object",
"description" : "Chance for this hero to appear in tavern of this factions. Reversed version of field \"tavern\" from town format",
"additionalProperties" : {
"type" : "number",
"minimum" : 0
}
},
"index" : {
"type" : "number",
"description" : "Private field to break things, do not use."
}
}
}