Modding FAQ

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.

Oh, man. It works like hell with propagator BATTLE_WIDE (icon retreat is inactive)!

So one more question. Is any way to show such exotic abillities in creature window? In creature format there’s no info about code to add new pcx and new infos…

Not really. Some info can be added via config\bonuses_texts.json, but images are more complicated.

Also keep in mind that orginal hero / artifacts bonuses would look odd on creatures.

I keep in mind. But giving neutral creatures such odd abilities I want to make battles with them more interesting/challenging and worth considering to hire them to the army. Some results you’ll see for few weeks, I hope:)

Command “dice” - in what purposes I can use it? I can’t see any ‘manual’ for it…

In what context?

Er… my english :frowning:
I ask in which contexts dice can be used and how this formula works.

It’s only used here, but I not exactly understand if this code actually doing anything:
github.com/vcmi/vcmi/blob/devel … or.cpp#L51

  1. Two rewards with same “dice” have same random value. This allows to create mutually exclusive and independent rewards.
  2. It is not used in any objects configuration yet.
  3. for now it actually may be used in mods only for new map objects for vcmi map format.

Ok, another question. I want to modify standard H3 creature banks. For example, I want to place in shipwrecks some Abyss creatures than Wights. I tried various ways, but I failed…
Like this:

{
	"core:creatureBank" : {
		"types" : {

			"core:shipwreck" : {
				"levels": 
					{
						"chance": 25,
						"guards": 
							{ "amount": 5, "type": "abyssSandCrab" },
							{ "amount": 5, "type": "abyssAbyssalCrab" },
							{ "amount": 5, "type": "abyssAbyssalCrab" },
							{ "amount": 5, "type": "abyssSandCrab" },
							{ "amount": 5, "type": "abyssAbyssalCrab" }
						],
						"combat_value": 31,
						"reward" : {
							"value": 2000,
							"resources":
							{
								"gold" : 2000
							}
						}
					},

Or this:

{
	"core:creatureBank" : {
		"types" : {

			"shipwreck" : {
				"levels": 
					{
						"chance": 25,
						"guards": 
							{ "amount": 5, "type": "abyssSandCrab" },
							{ "amount": 5, "type": "abyssAbyssalCrab" },
							{ "amount": 5, "type": "abyssAbyssalCrab" },
							{ "amount": 5, "type": "abyssSandCrab" },
							{ "amount": 5, "type": "abyssAbyssalCrab" }
						],
						"combat_value": 31,
						"reward" : {
							"value": 2000,
							"resources":
							{
								"gold" : 2000
							}
						}
					},

Or this:

{
	"creatureBank" : {
		"types" : {

			"core:shipwreck" : {
				"levels": 
					{
						"chance": 25,
						"guards": 
							{ "amount": 5, "type": "abyssSandCrab" },
							{ "amount": 5, "type": "abyssAbyssalCrab" },
							{ "amount": 5, "type": "abyssAbyssalCrab" },
							{ "amount": 5, "type": "abyssSandCrab" },
							{ "amount": 5, "type": "abyssAbyssalCrab" }
						],
						"combat_value": 31,
						"reward" : {
							"value": 2000,
							"resources":
							{
								"gold" : 2000
							}
						}
					},

I’m lack of ideas…

Strange…
I made test json for dwarven treasury:

{
	"core:creatureBank": {
		"types": {


			"dwarvenTreasury": {

				"levels": {
					"chance": 40,
					"guards": {
						"amount": 50,
						"type": "peasant"
					}, {
						"amount": 50,
						"type": "peasant"
					}, {
						"amount": 50,
						"type": "peasant"
					}, {
						"amount": 50,
						"type": "peasant"
					}, {
						"amount": 50,
						"type": "peasant"
					}],
					"combat_value": 300,
					"reward": {
						"resources": {

							"gold": 15000
						},
						"artefacts": {
							"class": "TREASURE"
						}, {
							"class": "MINOR"
						}, {
							"class": "TREASURE"
						}, {
							"class": "MINOR"
						}],
						"value": 17000
					}
				}, {
					"chance": 40,
					"guards": {
						"amount": 60,
						"type": "peasant"
					}, {
						"amount": 60,
						"type": "peasant"
					}, {
						"amount": 60,
						"type": "peasant"
					}, {
						"amount": 60,
						"type": "peasant"
					}, {
						"amount": 60,
						"type": "peasant"
					}],
					"combat_value": 350,
					"reward": {
						"value": 20000,
						"resources": {

							"gold": 17000
						},
						"artefacts": {
							"class": "MAJOR"
						}, {
							"class": "MINOR"
						}, {
							"class": "MINOR"
						}, {
							"class": "MINOR"
						}]

					}
				}, {
					"chance": 20,
					"guards": {
							"amount": 60,
							"type": "peasant"
						}, {
							"amount": 60,
							"type": "peasant"
						}, {
							"amount": 60,
							"type": "peasant"
						},

						{
							"amount": 60,
							"type": "peasant"
						}, {
							"amount": 60,
							"type": "peasant"
						}
					],
					"combat_value": 450,
					"reward": {
						"value": 26000,
						"resources": {

							"gold": 20000
						},
						"artefacts": {
							"class": "MAJOR"
						}, {
							"class": "MINOR"
						}, {
							"class": "MINOR"
						}, {
							"class": "MAJOR"
						}]

					}
				}]
			},
}

And it works, on visiting dwarven treasury I see peasants, many of them

File a bug report please, with logs for all cases.

Does your mod check is abyss mod is present?

    "depends" :
    
        "abyss"
    ],

Also try something like mod name prefx:

{ "amount": 5, "type": "abyss:abyssAbyssalCrab" } 

Thanks Marcon1 and Warmonger. I’ve tried all your solution but still wights on shipwrecks. That’s odd, because Macron’s peasants at Dwarven Treasury are present, but when I changed only “dwarvenTreasury” to “shipwreck” in this configuration, there’s no peasants in game, only wights!

Yes, I checked shipwreck in game, there are wights, because shipwreck is a object of type shipwreck, not of type creatureBank.
So code must be like this:

{
	"core:shipwreck": {
		"types": {


			"shipwreck": {

				"levels": {
					"chance": 40,
					"guards": {
						"amount": 50,
						"type": "peasant"
					}, {
						"amount": 50,
						"type": "peasant"
					}, {
						"amount": 50,
						"type": "peasant"
					}, {
						"amount": 50,
						"type": "peasant"
					}, {
						"amount": 50,
						"type": "peasant"
					}],
					"combat_value": 300,
					"reward": {
						"resources": {

							"gold": 15000
						},
						"artefacts": {
							"class": "TREASURE"
						}, {
							"class": "MINOR"
						}, {
							"class": "TREASURE"
						}, {
							"class": "MINOR"
						}],
						"value": 17000
					}
				}, {
					"chance": 40,
					"guards": {
						"amount": 60,
						"type": "peasant"
					}, {
						"amount": 60,
						"type": "peasant"
					}, {
						"amount": 60,
						"type": "peasant"
					}, {
						"amount": 60,
						"type": "peasant"
					}, {
						"amount": 60,
						"type": "peasant"
					}],
					"combat_value": 350,
					"reward": {
						"value": 20000,
						"resources": {

							"gold": 17000
						},
						"artefacts": {
							"class": "MAJOR"
						}, {
							"class": "MINOR"
						}, {
							"class": "MINOR"
						}, {
							"class": "MINOR"
						}]

					}
				}, {
					"chance": 20,
					"guards": {
							"amount": 60,
							"type": "peasant"
						}, {
							"amount": 60,
							"type": "peasant"
						}, {
							"amount": 60,
							"type": "peasant"
						},

						{
							"amount": 60,
							"type": "peasant"
						}, {
							"amount": 60,
							"type": "peasant"
						}
					],
					"combat_value": 450,
					"reward": {
						"value": 26000,
						"resources": {

							"gold": 20000
						},
						"artefacts": {
							"class": "MAJOR"
						}, {
							"class": "MINOR"
						}, {
							"class": "MINOR"
						}, {
							"class": "MAJOR"
						}]

					}
				}]
			},
}