Json configuration for spells

Okay, I just added new spell. It can spawn in Necropolis and can be given via Tome of Water, but game crashes when I open spellbook due to lack of graphics. Trying to get them made :wink:

dropbox.com/s/dsd08ykvfqjc1 … Spells.zip

  1. That’s great news. Is new build is planned as this will became stable?

  2. Is there a possibility to create new summoning spells? Like summoning new/old creatures depending hit points on spell power? I wait these spells most.

Ahh, and there are some graphics thanks to J.M.Sower
mediafire.com/download/j6eo0 … spells.rar

Good luck with that, AVS :slight_smile:

@Warmonger, thanks for testing material. :slight_smile:

The problem with summoning spells: it is allowed to summon only one creature (elemental), what rules should be if new spells can summon too?

Also, here’s simple test map I made yesterday.
Testy new spells.h3m (3 KB)

I think there multiple summonings maybe accepted. But not necceserily so. If hero has about 12 different summons, it can fill all battlefield with creatures:-) So maybe first summon (if made by hero not by artefact or starting spell) will make other creatures non accessible.

There must be
"subtype":“creature.”
“val”:5 //5 hit points for each 1 spell power summoned

There is also WOG artefact summoning random dragons at start of the battle. I think it also can be implemented some way through this spells type.

There also an idea of Demonology skill (like in HMM4) increasing effectiveness of summoning spells, so this must be throught out in complex…

PS It will be good if spell to fix (resurrect) NON_LIVING creatures will also be realized.

There will be new bonus type for general summoning, WoGs summoning creature ability will also possible, but not random summoning - this is too specific.

I suggested to Warmonger some abstract creature string names like “firstLevelCreature”,
“secondLevelCreature” etc. to use in bonuses.
If this will be relialized, than random 7th level creature summoning will be possible (for WOG art it will be “sevenLevelCreature” with limiter “DRAGON_NATURE”).

Let’s start with basic functionality that’s already here. More advanced effects have to wait for scripts.

Committed icons support in revision 3809

Okay, five buff / debuff spells tested and working. Link updated.
dropbox.com/s/dsd08ykvfqjc1 … Spells.zip

How’s the work on spells going?
When to expect windows build with spells support?
Now it’s only buf spells? Or damage/summon spells are going to be realized too in near build?

I wanted to ask about DEFs for spells.
is there some requipments for resolution of spell frames?
And how spells are drawn?
Are they centered when viewed in battle, and can be, for example, 515-515?

I played some time with current state of spells modding system (and will play it some time today).
I used Warmonger spells mod as base (but it didn’t work properly until i added

			"targetModifier":
			{
				"smart": true	//true: friendly/hostile based on positiveness; false: all targets
			}

to every level block. Cursor in battle didn’t allow to choose creatures to use spells on them without this addings).

As i understand now, user can only use “anim”: so far. And cannot yet use own spell animations. Is this right?

PS When i set “anim” : -1, game crashed on spell with “anim”:-1. So i had to replace -1 by id of some standard spells.

Is work is planned on adding custom summon creatures in distant future? It can use existing SUMMON_EARTH_ELEMENTAL/SUMMON_WATER_ELEMENTAL (for double wide creatures) mechanics. Because we don’t want now to allow filling battle screen with a lot of stacks:-)

Most likely there is a bug. It should work w|o smart targeting but work different. And yes, “smart”: true is now required in almost all cases (non smart spells are Armageddon, Death ripple and may be no more yet).

Some information on future plans is here wiki.vcmi.eu/index.php?title=Use … t_Version2

Custom animation is planned but there no even drafts for it.

1 Like

Thanks for answer.

I have another question.
For timed spells there is “duration” : “N_TURNS” attribute.
If i set it, it’s something about 12 turns until spell is dispelled.
Can this duration be customized in future (to exactly write how many turns spell must work)?

“duration” : “N_TURNS” mean “duration = SpellPower” (with few exceptions). This is original mechanics and should not be altered. If you want smth else, I need detailed feature request to continue discussion.

Oh, i forgot about duration=spell power, sorry…
Maybe later, but now it’s ok with it.

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.

1 Like

Another question.
I tried to make spell (offensive), that makes damage and puts creature under other spell (disruptingRay).

I put in

[code]“effects”: {

              "spell":
                {
                    "type": "ENCHANTED",

“subtype”:“spell.disruptingRay”,
“duration”:“N_TURNS”
}
}

But this is not working, when enemy creature takes turn, there is exception throwed out.
Same goes for SPELL_AFTER_ATTACK (didn’t try SPELL_BEFORE_ATTACK).
These bonuses aren’t supported? Or there is another way to put creature under other spell?