I just found, that animations for spells are listed in battles_graphics.json
So custom spell animations can be used through this file (and number in “anims”). Will try this out.
So place all your new spells animations in root of /Sprites/ directory of your mod.
In their names must not be spaces (change them to “_”).
There must be no subdirectories.
Then you go to battles_graphics.json
and in section "ac_mapping"
add indexed DEFs for your new spells
"ac_mapping":
{ "id": 0, "defnames": "C10SPW.DEF" ] },
{ "id": 1, "defnames": "C03SPA0.DEF" ] },
{ "id": 2, "defnames": "C01SPA0.DEF" ] },
....
{ "id": 82, "defnames": "C09SPF3.DEF" ] },
{ "id": 84, "defnames": "ZMGC02.DEF" ] },
{ "id": 259, "defnames": "Some_Ench2.def" ] },
{ "id": 260, "defnames": "Some_missile.def" ] },
{ "id": 261, "defnames": "Soul_Burn.def" ] },
{ "id": 262, "defnames": "Sprite_Attack.def" ] },
{ "id": 263, "defnames": "Sprite_Missile.def" ] }
]
Then use in your spells configuration “anim” : 261 to use “Sprite_Attack.def” DEF
I have a question. I wanted to make resurrection spell for mechanisms/non-living.
But when I select it in book, VCMI tells me there is no creatures affected by this spell:
{
"repair":
{
"type": "combat",
"name": "Repair",
"school":
{
"air": false,
"earth": true,
"fire": false,
"water": false
},
"level": 4,
"power": 30,
"defaultGainChance": 3,
"gainChance":
{
"tower": 5
},
//forgetfulness animation?
"anim": 227,
"flags" : {"positive": true,"rising":true},
"immunity":{"UNDEAD":true,"NON_LIVING":false},
//flags structure of bonus names,any one of these bonus grants immunity
"limit":
{
"NON_LIVING" : true,
"SIEGE_WEAPON" : true
},
//graphics - OPTIONAL; object;
"graphics":
{
"iconBook": "repair/back0.bmp",
"iconScroll": "repair/back1.bmp",
"iconScenarioBonus": "repair/back2.bmp",
"iconEffect": "repair/back3.bmp"
},
// "sounds":
// {
// "cast":"FORGET"
// },
"targetType" : "CREATURE",//_EXPERT_MASSIVE",
"levels":
{
"none":
{
"description": "Repairs mechanisms, non-living creatures and siege weapons.",
"cost": 35,
"power": 25,
"aiValue": 17,
"range": "0",
"targetModifier":{"smart":true},
"effects":
{
"heal":
{
"type": "HEALER"
}
}
},
"basic":
{
"description": "Repairs mechanisms, non-living creatures and siege weapons.",
"cost": 35,
"power": 27,
"aiValue": 17,
"range": "0",
"targetModifier":{"smart":true},
"effects":
{
"heal":
{
"type": "HEALER"
}
}
},
"advanced":
{
"description": "Repairs mechanisms, non-living creatures and siege weapons.",
"cost": 35,
"power": 30,
"aiValue": 18,
"range": "0",
"targetModifier":{"smart":true},
"effects":
{
"heal":
{
"type": "HEALER"
}
}
},
"expert":
{
"description": "Repairs mechanisms, non-living creatures and siege weapons.",
"cost": 35,
"power": 32,
"aiValue": 19,
"range": "0",
"targetModifier":{"smart":true},
"effects":
{
"heal":
{
"type": "HEALER"
}
}
}
}
}
}
Looks like bug (I think VCMI sees there is no living creatures hurted and ignores NON_LIVING creatures hurted.