Help with mods - questions

I’m too dump for this apparently :frowning: All I can is use anything what is in the bonus list. More bonuses is in list, more things I can mess :slight_smile: Wait, I remember your talkings about trash code with adding new bonuses. So we must wait for scripting system…

Adding new bonus types is exactly next major feature to implement. @hkoehler is already working on skill modding, everything else is more or less configurable. But after new bonus types there is almost no other way to go except scripting.

There is no list of {xxx} that you can use - anything you put in angled brackets will simply be displayed differently. E.g. the desriptions for secondary skills start with things like {Pathfinding} with will simply display the word “Pathfinding” in a special font in the GUI (e.g. when you right-click on a skill).

Heh, I thought that in {xxx} can be put sth like this:

description: May Retaliate ${val} extra times

This is true for bonuses, but as long as speciality can have several bonuses, what is val in that case?

Now I can see my stupitidy!

I can’t write custom spells :disappointed_relieved:
I want to write a spell that works like landmine mixed with fire wall. Spellcaster creature can throw a sludge into clear hex /firewall style/, and enemy unit who would step on it, should loose speed and defense /landmine style/. But finally spellcaster can cast spell not at clear hex, only a creature and casting animation doesn’t show. Only good thing that bonuses are applied :neutral_face:
Code is:

{
	"mazidlo":
	{
		"type": "ability", 
		"targetType": "LOCATION", 
		"name": "Mazidlo",
		"school":
		{
			"air": false,
			"earth": false,
			"fire": false,
			"water": false
		},
		"level": 3,
		"power": 20,
		"defaultGainChance": 0, 
		"gainChance":
		{
		},
		"animation":{
			"affect":["spells/mazidlo/Aura"]
		},
		"counters": {"spell.removeObstacle": true},
		"flags" : 
		{
//			"damage": true,
			"indifferent": true
		},
		"immunity" : 
		{
//			"DIRECT_DAMAGE_IMMUNITY": true
		},
 
		"graphics":
		{
//			"iconBook": "spells/mazidlo/mazidlo_iconBook.bmp",
//			"iconScroll": "spells/mazidlo/mazidlo_iconScroll.bmp",
//			"iconScenarioBonus": "spells/mazidlo/mazidlo_iconScenarioBonus.bmp",
			"iconEffect": "oasis/spells/mazidlo/mazidlo_iconEffect.bmp"
		},

		"sounds":
		{
			"cast":"FORCEFLD"
		},
 
		"levels":
		{
			"base":
			{
				"description": "Enemy stack stepped at Mazidlo is slowed down and loose defence.",
				"cost": 0,
				"power": 10,
				"aiValue": 15,
				"range": "0",
				"targetModifier":
					{
					"clearAffected": true
//					"smart":false
					},
	
				"effects":
				{
					"stacksSpeed" : {
						"addInfo" : 0,
						"val" : -50,
						"type" : "STACKS_SPEED",
						"valueType" : "PERCENT_TO_ALL",
						"duration" : "N_TURNS"
					},
					"reduceDefense" : {
						"type" : "PRIMARY_SKILL",
						"subtype" : "primSkill.defence",
						"val" : -80,
						"valueType" : "PERCENT_TO_ALL",
						"duration" : "N_TURNS"
					}
				}
			},
			"none":
			{
			},
			"basic":
			{
			},
			"advanced":
			{
			},
			"expert":
			{
			}
		}
	}
}

Such custom spells are not yet supported. Wait until obstacle branch is merged they I`ll try design custom spell obstacle feature.

Landmine and Quicksand are considered as obstacles?

yes they are

Another question.
I wrote a code to give hero’s specialty a premy to spell damage. Code is:

    "specialty": 
    [
      {
        "bonuses":
        [
          {
            "type" : "AIR_SPELL_DMG_PREMY",
			"valueType" : "BASE_NUMBER",
			"val" : 20,
			"propagator" : "HERO"
          },
		  {
            "type" : "EARTH_SPELL_DMG_PREMY",
			"valueType" : "BASE_NUMBER",
			"val" : 20,
			"propagator" : "HERO"
          },
		  {
            "type" : "FIRE_SPELL_DMG_PREMY",
			"valueType" : "BASE_NUMBER",
			"val" : 20,
			"propagator" : "HERO"
          },
		  {
            "type" : "WATER_SPELL_DMG_PREMY",
			"valueType" : "BASE_NUMBER",
			"val" : 20,
			"propagator" : "HERO"
          }
        ]
      }
    ]

But, for example, magic arrow deals still 30 points of damage, not more… :confused:

Why propagator?

Because it’s artifact bonus, not hero, I think. But it doesn’t really matters - with or without propagator, bonuses seem not work…

And I have another exotic hero specialties that should work, but don’t work… :disappointed_relieved:

    "specialty": 
    [
      {
        "bonuses":
        [
          {
			"type" : "SPELL_DURATION",
			"subtype" : "spell.forceField",
			"val" : 4,
			"valueType" : "BASE_NUMBER", //or additive value
			"propagator" : "HERO"
          }
        ]
      }
    ]

Force Field casted by this hero should last for 4 rounds. Like as standard - 2 turns…

    "specialty": 
    [
      {
        "bonuses":
        [
			{
			"type": "HP_REGENERATION",
			"val" : 50,
			"subtype" : 1,
			"limiters": [ 
				{
				"type":"CREATURE_TYPE_LIMITER",
				"parameters": [ "ballista", false ]
				}
				]
			}
		]

Ballista under hero command should gain regeneration ability, but it doesn’t.

For specialties with propagator it’s the propagator causing the problem (there’s a bug with propagation linkage for hero specialties causing propagation from hero to specialty instead of the other way around). This will “fixed” as part of this (https://github.com/vcmi/vcmi/pull/379) change, but for now just drop the propagator.

For the hp regeneration on ballista there’s another bug specific to limiters for war machines. This have been fixed on the latest develop (https://github.com/vcmi/vcmi/pull/374), but not in 0.99.

I’ve decided to write my first adventure spell. Quite simply, spell should increase hero’s sighting radius till end of the week. Of course, spell doesn’t work and console went crazy and said:

Blockquote
System message: Server encountered a problem: Invalid adventure spell cast attempt!
Server encountered a problem: Got false in applying 12CastAdvSpell… that request must have been fishy!

Here’s the code. Where could be an error?

{
	"torchlight" : {
		"type": "adventure",
		"name": "Torchlight",
		"school":
		{
			"air": true,
			"earth": false,
			"fire": false,
			"water": false
		},
		"targetType": "NO_TARGET",
		"level": 1, //placeholder
		"power": 10, //duration spellpower=turns, not in this case
		"defaultGainChance": 10, 
		"gainChance":
		{
		},
		"animation":{
			"affect":["C07SPA1"],
		},
		"flags" : {
			"positive": true
		},
		"sounds": {
			"cast": "DISRUPTR"
		},
		"graphics":
		{
			"iconBook": "spells/torchlight/Sp22Spon.bmp",
			"iconScroll": "spells/torchlight/Sm22Spon.bmp",
			"iconScenarioBonus": "spells/torchlight/SB22Spon.bmp",
			"iconEffect": "spells/torchlight/Si22Spon.bmp"
		},
		"levels" : {
			"base":{
				"range" : "0",
//				"targetModifier":{"smart":true},
				"aiValue": 20, //don't know what it means
				"cost": 25,
				"power": 10, //irrevelant in this case?
				"effects" : {
					"increaseView" : {
						"type" : "SIGHT_RADIOUS",
						"valueType" : "ADDITIVE_VALUE",
						"duration" : "ONE_WEEK"
					}
				}
			},
			"none":
			{	 
				"description": "+4 to sight radious.",
				"cost": 16,
				"effects" : {
					"increaseView" : {
						"val" : 4
					}
				}	
			},
			"basic":
			{	 
				"description": "+4 to sight radious.",
				"cost": 12,
				"effects" : {
					"increaseView" : {
						"val" : 4
					}
				}	
			},
			"advanced":
			{	 
				"description": "+6 to sight radious.",
				"cost": 12,
				"effects" : {
					"increaseView" : {
						"val" : 6
					}
				}	
			},
			"expert":
			{	 
				"description": "+8 to sight radious.",
				"cost": 12,
				"effects" : {
					"increaseView" : {
						"val" : 8
					}
				}		
			}
		}
	}
}

Try “range” : “X”,

Still no effect… You can try this mod.
torchlight.zip (16.7 KB)

Sorry, but adventure spell modding is not supported yet.