Difference between revisions of "Creature Format"

From VCMI Project Wiki
Jump to: navigation, search
m (double week property added)
(Replaced content with "{{Template:MovedToWebpage|https://vcmi.eu/modders/Entities_Format/Creature_Format/}}")
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
See thread http://forum.vcmi.eu/viewtopic.php?t=533 for discussion.
+
{{Template:MovedToWebpage|https://vcmi.eu/modders/Entities_Format/Creature_Format/}}
<!--
 
 
 
Made schema hidden. Useful but only for developers. Should be implemented and moved to config file
 
Ivan
 
 
 
Json schema (see http://json-schema.org/)
 
<syntaxhighlight lang="javascript">
 
{
 
"type" : "object",
 
"additionalProperties" :
 
{
 
"type" : "object",
 
"additionalProperties" : false,
 
"properties" :
 
{
 
"name" :
 
{
 
"type" : "object",
 
"additionalProperties" : false,
 
"properties" :
 
{
 
"singular" :
 
{
 
"type" : "string"
 
},
 
"plural" :
 
{
 
"type" : "string"
 
}
 
}
 
},
 
"level" :
 
{
 
"type" : "integer"
 
},
 
"faction" :
 
{
 
"type" : "string"
 
},
 
"cost" :
 
{
 
"type" : "object",
 
"additionalProperties" :
 
{
 
"type" : "integer",
 
"minimum" : 0
 
}
 
},
 
"fightValue" :
 
{
 
"type" : "integer",
 
"minimum" : 0
 
},
 
"aiValue" :
 
{
 
"type" : "integer",
 
"minimum" : 0
 
},
 
"growth" :
 
{
 
"type" : "integer",
 
"minimum" : 1
 
},
 
"hitPoints" :
 
{
 
"type" : "integer",
 
"minimum" : 1
 
},
 
"speed" :
 
{
 
"type" : "integer",
 
"minimum" : 0
 
},
 
"attack" :
 
{
 
"type" : "integer",
 
"minimum" : 0
 
},
 
"defence" :
 
{
 
"type" : "integer",
 
"minimum" : 0
 
},
 
"shots" :
 
{
 
"type" : "integer",
 
"minimum" : 0,
 
"default" : 0
 
},
 
"spellPoints" :
 
{
 
"type" : "integer",
 
"minimum" : 0,
 
"default" : 0
 
},
 
"doubleWide" :
 
{
 
"type" : "boolean",
 
"default" : false
 
},
 
"damage" :
 
{
 
"type" : "object",
 
"additionalProperties" : false,
 
"properties" :
 
{
 
"min" :
 
{
 
"type" : "integer",
 
"minimum" : 0
 
},
 
"max" :
 
{
 
"type" : "integer",
 
"minimum" : 0
 
}
 
}
 
},
 
"advMapAmount" :
 
{
 
"type" : "object",
 
"additionalProperties" : false,
 
"properties" :
 
{
 
"min" :
 
{
 
"type" : "integer",
 
"minimum" : 0
 
},
 
"max" :
 
{
 
"type" : "integer",
 
"minimum" : 0
 
}
 
}
 
},
 
"upgrades" :
 
{
 
"type" : "object",
 
"additionalProperties" :
 
{
 
"type" : "boolean"
 
}
 
},
 
"hasDoubleWeek": //since 0.91
 
{
 
"type" : "boolean"
 
}
 
"graphics" :
 
{
 
"type" : "object",
 
"additionalProperties" : false,
 
"properties" :
 
{
 
"animation" :
 
{
 
"type" : "string"
 
},
 
"timeBetweenFidgets" :
 
{
 
"type" : "number",
 
"default" : 1.0
 
},
 
"troopCountLocationOffset" :
 
{
 
"type" : "integer",
 
"default" : 0
 
},
 
"animationTime" :
 
{
 
"type" : "object",
 
"additionalProperties" : false,
 
"properties" :
 
{
 
"walk" :
 
{
 
"type" : "number",
 
"default" : 1.0
 
},
 
"attack" :
 
{
 
"type" : "number",
 
"default" : 1.0
 
},
 
"flight" :
 
{
 
"type" : "number",
 
"default" : 1.0
 
}
 
}
 
},
 
"background" :
 
{
 
"type" : "object",
 
"additionalProperties" : false,
 
"properties" :
 
{
 
"120" :
 
{
 
"type" : "string",
 
"default" : ""
 
},
 
"130" :
 
{
 
"type" : "string",
 
"default" : ""
 
}
 
}
 
},
 
"missile" :
 
{
 
"type" : "object",
 
"additionalProperties" : false,
 
"properties" :
 
{
 
"animation" :
 
{
 
"type" : "string",
 
"default" : ""
 
},
 
"spinning" :
 
{
 
"type" : "boolean",
 
"default" : false
 
},
 
"offset" :
 
{
 
"type" : "object",
 
"additionalProperties" : false,
 
"properties" :
 
{
 
"upperX" :
 
{
 
"type" : "integer",
 
"default" : 0
 
},
 
"upperY" :
 
{
 
"type" : "integer",
 
"default" : 0
 
},
 
"middleX" :
 
{
 
"type" : "integer",
 
"default" : 0
 
},
 
"middleY" :
 
{
 
"type" : "integer",
 
"default" : 0
 
},
 
"lowerX" :
 
{
 
"type" : "integer",
 
"default" : 0
 
},
 
"lowerY" :
 
{
 
"type" : "integer",
 
"default" : 0
 
}
 
}
 
},
 
"frameAngles" :
 
{
 
"type" : "array",
 
"additionalItems" : false,
 
"items" :
 
{
 
"type" : "number"
 
}
 
}
 
}
 
}
 
}
 
},
 
"sound" :
 
{
 
"type" : "object",
 
"additionalProperties" : false,
 
"properties" :
 
{
 
"attack" :
 
{
 
"type" : "string",
 
"default" : ""
 
},
 
"defend" :
 
{
 
"type" : "string",
 
"default" : ""
 
},
 
"killed" :
 
{
 
"type" : "string",
 
"default" : ""
 
},
 
"move" :
 
{
 
"type" : "string",
 
"default" : ""
 
},
 
"moveStart" :
 
{
 
"type" : "string",
 
"default" : ""
 
},
 
"moveEnd" :
 
{
 
"type" : "string",
 
"default" : ""
 
},
 
"shoot" :
 
{
 
"type" : "string",
 
"default" : ""
 
},
 
"wince" :
 
{
 
"type" : "string",
 
"default" : ""
 
}
 
}
 
},
 
"abilities" :
 
{
 
    "type" : ["object", "null"],
 
    "additionalProperties" :
 
    {
 
        "type" : "object",
 
        "additionalProperties" : false,
 
        "properties" :
 
        {
 
            "type" :
 
            {
 
                "type" : "string"
 
            },
 
            "subtype" :
 
            {
 
                "type" : "integer"
 
            },
 
            "value" :
 
            {
 
                "type" : "integer"
 
            },
 
            "valueType" :
 
            {
 
                "type" : "string"
 
            },
 
            "addInfo" :
 
            {
 
                "type" : "integer"
 
            },
 
            "effectRange" :
 
            {
 
                "type" : "integer"
 
            },
 
            "description" :
 
            {
 
                "type" : "string",
 
                "default" : ""
 
            }
 
        }
 
    }
 
}
 
}
 
}
 
}
 
</syntaxhighlight>
 
 
 
-->
 
<syntaxhighlight lang="javascript">
 
// camelCase unique creature identifier
 
"creatureName" :
 
{
 
// translatable names
 
"name" :
 
{
 
"singular" : "Creature",
 
"plural" : "Creatures"
 
},
 
"level" : 0,
 
 
// config name of faction. Examples: castle, rampart
 
"faction" : "",
 
// cost to recruit, zero values can be omitted.
 
"cost" :
 
{
 
"wood" : 0,
 
"mercury" : 0,
 
"ore" : 0,
 
"sulfur" : 0,
 
"crystal" : 0,
 
"gems" : 0,
 
"gold" : 0
 
},
 
// "value" of creature, used to determine for example army strength
 
"fightValue" : 0,
 
 
 
// "ai value" - how valuable this creature should be for AI
 
"aiValue" : 0,
 
 
// normal growth in town or external dwellings
 
"growth" : 0,
 
 
// growth bonus from horde building
 
// TODO: reconsider need of this field after configurable buildings support
 
"hordeGrowth" : 0,
 
 
// Creature stats in battle
 
"attack" : 0,
 
"defence" : 0,
 
"hitPoints" : 0,
 
"shots" : 0,
 
"speed" : 0,
 
"damage" :
 
{
 
"min" : 0,
 
"max" : 0
 
},
 
// spellpoints this creature has, how many times creature may cast its spells
 
"spellPoints" : 0,
 
// initial size of creature army on adventure map
 
"advMapAmount" :
 
{
 
"min" : 0,
 
"max" : 0
 
},
 
 
// Creature to which this creature can be upgraded
 
// Note that only one upgrade can be available from UI
 
"upgrades" :
 
[
 
"anotherCreature"
 
],
 
 
 
// Creature is 2-tiles in size on the battlefield
 
"doubleWide" : false,
 
 
 
// All creature abilities, using bonus format
 
"abilities" :
 
[
 
Bonus Format
 
],
 
 
 
"hasDoubleWeek": true, //since 0.92
 
 
"graphics" :
 
{
 
// name of file with creature battle animation
 
"animation" : ""
 
 
// animation parameters
 
// TODO: explain meaning and use them by engine
 
"timeBetweenFidgets" : 1.00,
 
"troopCountLocationOffset" : 0,
 
"attackClimaxFrame" : 0,
 
"animationTime" :
 
{
 
"walk" : 1.00,
 
"attack" : 1.00,
 
"flight" : 1.00
 
},
 
"missile" :
 
{
 
// name of file for missile
 
"animation" : "",
 
// missile should spin, e.g. for throwing axes
 
"spinning" : false,
 
"offset" :
 
{
 
"upperX" : 0,
 
"upperY" : 0,
 
"middleX" : 0,
 
"middleY" : 0,
 
"lowerX" : 0,
 
"lowerY" : 0
 
},
 
"frameAngles" : []
 
}
 
},
 
 
 
// names of sound files
 
"sound" :
 
{
 
"attack": "",
 
"defend": "",
 
"killed": "",
 
"move": "",
 
"shoot" : "",
 
"wince": "",
 
"moveStart" : "",
 
"moveEnd" : ""
 
}
 
}
 
</syntaxhighlight>
 
 
 
{{Modding}}
 

Latest revision as of 16:24, 16 July 2024

Logo256.png    Page moved to VCMI-Homepage