VCMI allows overriding HoMM3 .def files with .json replacement. Compared to .def this format allows:
{
// Base path of all images in animation. Optional.
// Can be used to avoid using long path to images
"basepath" : "path/to/images/directory/",
// List of sequiences / groups in animation
// This will replace original group with specified list of files
// even if original animation is longer
"sequences" :
[
{
// Index of group, zero-based
"group" : 1,
// List of files in this group
"frames" :
[
"frame1.png",
"frame2.png"
...
],
// Automatically create shadow for this frame if required. Optional, 0 = None, 1 = Normal Shadow, 2 = Sheared Shadow (e.g. for adventure map)
"generateShadow" : 1,
// Automatically create overlay for this frame if required. Optional, 0 = None, 1 = Outline
"generateOverlay" : 1,
},
...
],
// Alternative to "sequences". Allow overriding individual frames in file. Generally should not be used in the same time as "sequences"
"images" :
[
{
// Group of this image. Optional, default = 0
"group" : 0,
// Index of the image in group
"frame" : 0,
// Filename for this frame
"file" : "filename.png",
// Automatically create shadow for this frame if required. Optional, 0 = None, 1 = Normal Shadow, 2 = Sheared Shadow (e.g. for adventure map)
"generateShadow" : 1,
// Automatically create overlay for this frame if required. Optional, 0 = None, 1 = Outline
"generateOverlay" : 1,
}.
...
]
}
This json file will allow replacing .def file for a button with png images. Buttons require following images:
Highlighted state. This state is used by only some buttons and only in some cases. For example, in main menu buttons will appear highlighted when mouse cursor is on top of the image. Another example is buttons that can be selected, such as settings that can be toggled on or off
{
"basepath" : "interface/MyButton", // all images are located in this directory
"images" :
[
{"frame" : 0, "file" : "active.png" },
{"frame" : 1, "file" : "pressed.png" },
{"frame" : 2, "file" : "blocked.png" },
{"frame" : 3, "file" : "highlighted.png" },
]
}
This json file allows defining one animation sequence, for example for adventure map objects or for town buildings.
{
"basepath" : "myTown/myBuilding", // all images are located in this directory
"sequences" :
[
{
"group" : 0,
"frames" : [
"frame01.png",
"frame02.png",
"frame03.png",
"frame04.png",
"frame05.png"
...
]
}
]
}
TODO
Animation for creatures consist from multiple groups, with each group representing one specific animation. VCMI uses groups as follows:
Basic animations
Rotation animations
Melee attack animations
Ranged attack animations
Special animations
Additional H3 animations
Additional VCMI animations
Spellcasting animations
Group attack animations