Modding FAQ

How can I add to particular heroes First Aid Tent and Ammo Cart at start (like starting army?)

"army" : 
 
"creature" : "firstAidTent" 
]

doesn’t work :

And is it possible to make heroe’s speciality to summon specyfic creature at the beggining of the battle?

        "specialty": 
         
            { 
                "growsWithLevel" : true, 
                "bonuses": 
                 
                    { 
                    "type" : "DAEMON_SUMMONING", 
                    "subtype" : "creature.centaur", 
                    "val" : 20 
                    }

This doesn’t work either…

I tried to find diffirent way to summon creatures during battles. I’ve made a new creature and coded it propertly. It’s called MyCreature. Next I wanted to write a unique spell working like DEAMON_SUMMONING but instead of summoning Demons summons MyCreature. And to finish, this spell was written as starting spell in my hero spellbook.
Here the code:

{
	"summonTreebeard":
	{
		"type": "combat", 
		"targetType": "NO_TARGET", 
		"name": "Summon MyCreature",
		"school":
		{
			"air": false,
			"earth": true, // for example
			"fire": false,
			"water": false
		},
		"level": 5, //not revelant for now
		"power": 10,		
		"defaultGainChance": 0, //I do'nt want this spell to appear in Mage Guilds
		"animation":{
		"affect":"<path to DEF file of spell animation>"]
		},
 
		"flags" : {"rising": true}, //it is correct? flag 'summoning' is marked as TODO
		"graphics": //placeholder graphics
		{
			"iconBook": "spells/catReflexes_iconBook.bmp",
			"iconScroll": "spells/catReflexes_iconScroll.bmp",
			"iconScenarioBonus": "spells/catReflexes_iconScenarioBonus.bmp",
			"iconEffect": "spells/catReflexes_iconEffect.bmp"
		},

	"sounds":
		{
			"cast":"SUMNELM"
		},
		"levels":
		{
			"none":
			{
				"description": "Summon My Creature.",
				"cost": 0, //spell is free because is my hero unique speciality
				"power": 10,
				"aiValue": 15, //I have no idea what is proper aiValue here
				"range": "X", //is it correct?
				"targetModifier":{"smart":true},	//is is correct? 
				"effects":
				{
					"mycreatureSummoning" : {
						"type" : "DAEMON_SUMMONING",
						"subType" : "myCreature",
						"val" : 20
					}
				}
			},
			"basic":
			{
// ... and so on..				

But spell doesn’t work, console says that:


Error: Unknown entry found: subType
At /levels/none/effects/myCreatureSummoning
Error: Unknown entry found: subType

At <root> 
Error: Required entry gainChance is missing

What I have to do to make spell who summon MyCreature insted of Demon? Or what I have to do to summon MyCreature like Elementals?[/code]

Custom summoning is not implemented, also DEAMON_SUMMONING is not actually a spell.

Yeap, but I thought this trick would work. Like giving WHIRPOOL_PROTECTION bonus to creature, not artifact (travel through whirpools with creatures with this ‘ability’ work, but after that game has odd behaviour :))

And what about setting First Aid Tent and AmmoCart at start? Is it possible?

Try

"army":


.... first 1-3 slots ...

			{
				"creature" : "firstAidTent",
				"max" : 1,
				"min" : 1
			},
]

Doesn’t work too :frowning: It’s dead end, I think, because from viki:

"army" :
	
		// First always available stack
		{
			// Identifier of creature in this stack
			"creature" : "mage",
 
			// Minimal and maximum size of stack. **Size will be
			// determined randomly at the start of the game**
			"max" : 2,
			"min" : 1
		},
		**// Second stack has 90 % chance to appear**
		{
			"creature" : "archmage",
			"max" : 1,
			"min" : 1
		},
		**// Third stack with just 20 % chance to appear**
		{
			"creature" : "mage",
			"max" : 2,
			"min" : 1
		}
	]

Try to put it first.

I tested it on Christian,
gave him

		"army" :
		
					{
				"creature" : "firstAidTent",
				"max" : 1,
				"min" : 1
			},
			{
				"creature" : "masterGenie",
				"max" : 100,
				"min" : 70
			},
			{
				"creature" : "masterGenie",
				"max" : 900,
				"min" : 900
			},
	//		{
	//			"creature" : "ironGolem",
	//			"max" : 100,
	//			"min" : 70
	//		}
		],

First Aid Tent appeared in inventory
PS If I make more then 3 army slots. VCMI gives error “number of slots is bigger than 3” and crashes. Why this boundary is set? Maybe someone wants to make hero with 4-7 starting slots and war machines?

I’ve made a mini-mod called New Siege Creatures. Now Commanders during siege are placed at turrets to shoot at enemy. Mod works fine (it’s cool feature ;P) but I noticed game crashes more often than usual at completely diffirent situations not connected to siege. If you have some spare time to test this mod, here it is:
mediafire.com/download/wuuc3 … atures.zip
In this mod, there small test map called ABC1. Just play a map, buy a hero at tavern and conquer nearby enemy towns. Not too fast, use defend button and observe game behaviour…

It works! Partially, but works! Thank you!

DAEMON_SUMMONING is Pit Lord’s ability, which works ina completely different way. For now there is no ability to summon creatures in battle.
There is a WoG ability and Summon Elementals spell. Witchking even made an artifact that summons 4 elementals at start of teh battle.

Interesting. I thought it doesn’t work altogether, but still there shoudl be idiot-proof way of adding war machines. This should be reported on Mantis.

Now I know that. I added myCreature ability:
“abilities” :

		{
			"summonWaterElementals" : 
			{ 
				"type" : "DAEMON_SUMMONING",
				"subtype" : "creature.waterElemental",
				"val" : 50
			},
			"castsAmount" :
			{
				"type" : "CASTS",
				"val" : 1
			}
		}

MyCreature during battle can raise (for example) Water Elementals from dead bodies. That’s cool. I though this trick would be applied to hero speciality somehow!

By the way - I found interesting…hm… exploit!
I gave myCreature whirpool_protection ability:

"abilities" :
		{
			"whirlpoolProtection" : 
			{ 
				"type" : "WHIRLPOOL_PROTECTION", 
				"propagator" : "HERO"
			}

IT SHOULD NOT WORK, because whirpool_protection is artifact ability, not creature! But… it works! Almost. Having such creature in army, hero is able safely travel through whirpools. Unfortunatelly, game crashes after trying to get out of the whirpools :frowning: Can this exploit be fixed?

Of course it works, this is exactly what HERO propagator is for (Nomads, Rogues for example).

Game should never crash, needs bug report.

What ALWAYS_MINIMUM_DAMAGE exactly means? What creature has this ability to learn how formula works on example?

 ALWAYS_MINIMUM_DAMAGE

unit does its minimum damage from range

    subtype: -1 - any attack, 0 - melee, 1 - ranged
    value: additional damage penalty (it'll subtracted from dmg)
    additional info - multiplicative anti-bonus for dmg in % [eg 20 means that creature will inflict 80% of normal minimal dmg] 

ALWAYS_MINIMUM_DAMAGE bonus is basically Curse spell and does not make sense as creature ability.

Isn’t work like range penalty?

Do VCMI rmg templates support “density” option for mines, neutral and player towns?
IIRC “density” allows to set maximum amount of sth to be generated in zone if fixed amount isn’t specified.

I’ve thought that this ability causes always minimum damage to the creature who attack my creature with this ability.

ALWAYS_MINIMUM_DAMAGE is the effect of Curse, which is opposite of ALWAYS_MAXIMUM_DAMAGE (Bless).

I want to give my creature ‘shackles of war’ ability. Having these neutral creatures in army, battle prevents hero to escape. So I wrote:

"enemyCantEscape" :
			{
				"type" : "ENEMY_CANT_ESCAPE",
				"propagator" : "BATTLE_WIDE"
			}

or

"enemyCantEscape" :
			{
				"type" : "ENEMY_CANT_ESCAPE",
				"propagator" : "HERO"
			}

console says that: Error: invalid ability type ENEMY_CANT_ESCAPE

Is any trick to do give creature this artifact’s ability?

The bonus for Shackles Of War is called BATTLE_NO_FLEEING. Will fix Wiki.