Json configuration for spells

I think it would be nice to be able to have both damage and debug in one spell (Deep Freeze comes to my mind), possibly also other effects. In general, extending logic of GameHandler::handleSpellcasting and immunities / targeting system is always good, though not urgent.

I disussed this issue with Kuririn already. Possible solutions are:

  • Ask modders to provide icon for every new spell
  • Use one icon for all spells that don’t have one already
  • Generate icon automaticlaly, based on spell icon :question:

Also, is it possible to ADD new spell now? That would be beyond awesome.

Both damage and effect is not possible yet, but will be implemented most likely in next part in current release cycle. This feature requires few changes in handleSpellcasting (and most likely support in battleAI).

Adding new spells is not as easy as it seems: the problem is spell animation - I don`t know how to handle this w|o scripting. And graphics & sound related config is still missing, but it may work already, not tested though.

For now we can allow only local animations - like AC format. Just to make it work.

Right, just noticed, but shouldn’t be difficult from here.

I`m talking mostly about CBattleInterface::spellCast - to much hardcoded. (Get rid AC format in favour of resource path is not a problem)

You know - actually spellCast method is not that bad. It can be broken in two parts:

  1. Selecting effect by spell ID:
    Can be removed using some kind of “configurable AC” format (let’s call it battle effect format) that will contain:
  • Animation(s) to play (.def files)
  • Sounds to play on cast
  • How this animation should be displayed (like positioning)
  1. Selecting text by spell ID: not sure. For spells casted by hero this is trivial. But for creature abilities it seems to be much more complex:
  • some have one string, some have custom text for multiple targets (age),
  • some have custom text for killing multiple creatures (death stare),
  • some have multiple strings that should be displayed one after another (thunderbolt)

Any ideas what we should do here?

AVS, can you make list of what remains hardcoded/not in format so far? Animation def’s, sounds, spellbook icon, spell icon for creature window. What else?

Just found hardcoded “spellSelMode = FREE_LOCATION” for firewall & force field. May be there are a few more.

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:-)