Help with mods - questions

There is no LIVING bonus and it may be good idea to add it (Ive seen a comment somewhere in codebase about presence such bonus in WoGs creature exp mechanics).

I mentioned it over half a year ago on the bugtracker right here in the comments, but WARMONGER said it would cause problems… though thinking of it now I would disagree :slight_smile:

BTW. I am also looking for a way to disable ‘UNDEAD’ ability (by an artifact), but nothing seems to work. I tried:

		"bonuses":
		
			{
				"type" : "UNDEAD",
				"val" : null
			}
		]

and

		"bonuses":
		
			{
				"type" : "UNDEAD": null
			}
		]

but both of them do the opposite (make all creatures UNDEAD) - probably null is ignored (?), but at VCMI initialization the mod is not labeled as incorrect… If there was an ‘IS_LIVING’ ability, then I would do it by setting type to ‘IS_LIVING’ and limiting it to ‘UNDEAD’ creatures :stuck_out_tongue:

I didn’t try such thing.
Don’t think it’s possible to remove current bonus ability “UNDEAD” in artefacts.

This is other problem :slight_smile: There is no way to revoke bonus. Also ““type” : “UNDEAD”: null” is syntactically incorrect, no error in log = bug in json parser

Well, I quietly hope you guys add those funcionalities to VCMI :slight_smile:

Oh no, there will be need to manually correct all these jsons of creatures:-) What a pain! :imp:
All creatures by default are “LIVING”. I think there will be mess, if there will be creatures with both LIVING and UNDEAD bonuses.
Maybe it’s better to add bonuses that related to LIVING nature?
Like “AFFECTED_BY_MORALE”,“AFFECTED_BY_LUCK”,“AFFECTED_BY_HEALING”? Is this are all living creatures bonuses?

Or another way i suggested long time ago.
We have DRAGON_NATURE, UNDEAD, NON_LIVING types of bonuses served as limiters.
I suggested adding customized type of limiters.
Like i will add something like

"limiters":{"types": {

"DEMON" :  {        
        {
             "abilities":
                  {
                      "fireImmunity":{"type":"FIRE_IMMUNITY",
                     "lessDamageFromSpellFireball":{   
                        "type":"MORE_DAMAGE_FROM_SPELL",
                       "val":-50,
                       "subtype":"spell.fireball"
                     }
}

                }
         }

    }

}

and if in creature json we see “type”:“DEMON”, VCMI will automatically assign this set of abilities to it.
Same can go for “LIVING” creature. Add list of abilities incorporated, and then

"abilityToBeLiving":{"type":"LIVING","limiter":"UNDEAD"}

I think you don’t understand what “Limiter” is in first place. Limiter, as the name suggests, limits propagation of boonuses over bonus system tree to some specific cases. It defines no additional behavior for anything.

Im afraid U dont understand what Limiter is.
What U suggest should be called Bonus (of Ability) Preset. However, I like the idea and will implement it in next version of “BonusType config”.

Maybe it’s so. It’s more about template for creature abilities in my post.
For example, user may want to add custom limiter “IS_DEMON”. Then he describes “DEMON” template of abilities.

Want to brag.
Made VCMI to change appearances for Castle Town depending on terrains (forum.acidcave.net/topic.php?TID=2393, Sower work).
It is easy, you must only not forget to replace original templates (village,fort,citadel,castle,capitol) by new only grass templates.

{
	"core:castle" : {
		"town" : {
			"mapObject" : {
				"filters" : {
					"village_dirt": "noneOf",  "fort" ]  ],
					"fort_dirt" :  "allOf",  "fort" ],  "noneOf",  "citadel" ] ] ],
					"citadel_dirt" :  "allOf",  "citadel" ],  "noneOf",  "castle" ] ] ],
					"castle_dirt" :  "allOf",  "castle" ],  "noneOf",  "capitol" ] ] ],
					"capitol_dirt" :  "allOf",  "castle"  ],  "capitol"  ] ],
					
					
					"village": "noneOf",  "fort" ]  ],
					"fort" :  "allOf",  "fort" ],  "noneOf",  "citadel" ] ] ],
					"citadel" :  "allOf",  "citadel" ],  "noneOf",  "castle" ] ] ],
					"castle" :  "allOf",  "castle" ],  "noneOf",  "capitol" ] ] ],
					"capitol" :  "allOf",  "castle"  ],  "capitol"  ] ],
					
					"village_lava": "noneOf",  "fort" ]  ],
					"fort_lava" :  "allOf",  "fort" ],  "noneOf",  "citadel" ] ] ],
					"citadel_lava" :  "allOf",  "citadel" ],  "noneOf",  "castle" ] ] ],
					"castle_lava" :  "allOf",  "castle" ],  "noneOf",  "capitol" ] ] ],
					"capitol_lava" :  "allOf",  "castle"  ],  "capitol"  ] ],
					
					"village_rough": "noneOf",  "fort" ]  ],
					"fort_rough" :  "allOf",  "fort" ],  "noneOf",  "citadel" ] ] ],
					"citadel_rough" :  "allOf",  "citadel" ],  "noneOf",  "castle" ] ] ],
					"castle_rough" :  "allOf",  "castle" ],  "noneOf",  "capitol" ] ] ],
					"capitol_rough" :  "allOf",  "castle"  ],  "capitol"  ] ],
					
					"village_sand": "noneOf",  "fort" ]  ],
					"fort_sand" :  "allOf",  "fort" ],  "noneOf",  "citadel" ] ] ],
					"citadel_sand" :  "allOf",  "citadel" ],  "noneOf",  "castle" ] ] ],
					"castle_sand" :  "allOf",  "castle" ],  "noneOf",  "capitol" ] ] ],					
					"capitol_sand" :  "allOf",  "castle"  ],  "capitol"  ] ],
					
					"village_snow": "noneOf",  "fort" ]  ],
					"fort_snow" :  "allOf",  "fort" ],  "noneOf",  "citadel" ] ] ],
					"citadel_snow" :  "allOf",  "citadel" ],  "noneOf",  "castle" ] ] ],
					"castle_snow" :  "allOf",  "castle" ],  "noneOf",  "capitol" ] ] ],		
					"capitol_snow" :  "allOf",  "castle"  ],  "capitol"  ] ],
					
					"village_subterra": "noneOf",  "fort" ]  ],
					"fort_subterra" :  "allOf",  "fort" ],  "noneOf",  "citadel" ] ] ],
					"citadel_subterra" :  "allOf",  "citadel" ],  "noneOf",  "castle" ] ] ],
					"castle_subterra" :  "allOf",  "castle" ],  "noneOf",  "capitol" ] ] ],	
					"capitol_subterra" :  "allOf",  "castle"  ],  "capitol"  ] ],
					
					"village_swamp": "noneOf",  "fort" ]  ],
					"fort_swamp" :  "allOf",  "fort" ],  "noneOf",  "citadel" ] ] ],
					"citadel_swamp" :  "allOf",  "citadel" ],  "noneOf",  "castle" ] ] ],
					"castle_swamp" :  "allOf",  "castle" ],  "noneOf",  "capitol" ] ] ],						
					"capitol_swamp" :  "allOf",  "castle"  ],  "capitol"  ] ],
					},
				"templates" : {
					"village_dirt": {"allowedTerrains":"dirt"], "animation" : "newlook_castle/CastleDirtHall.def"},
					"fort_dirt" : {"allowedTerrains":"dirt"], "animation" : "newlook_castle/CastleDirtCastle1.def"},
					"citadel_dirt" : {"allowedTerrains":"dirt"], "animation" : "newlook_castle/CastleDirtCastle2.def"},
					"castle_dirt" : {"allowedTerrains":"dirt"], "animation" : "newlook_castle/CastleDirtCastle3.def"},
					"capitol_dirt" : {"allowedTerrains":"dirt"], "animation" : "newlook_castle/CastleDirtCastle3F.def"},

					"village": {"allowedTerrains":"grass"], "animation" : "newlook_castle/CastleGrassHall.def"},
					"fort" : {"allowedTerrains":"grass"], "animation" : "newlook_castle/CastleGrassCastle1.def"},
					"citadel" : {"allowedTerrains":"grass"], "animation" : "newlook_castle/CastleGrassCastle2.def"},
					"castle" : {"allowedTerrains":"grass"], "animation" : "newlook_castle/CastleGrassCastle3.def"},
					"capitol" : {"allowedTerrains":"grass"], "animation" : "newlook_castle/CastleGrassCastle3F.def"},

					"village_lava": {"allowedTerrains":"lava"], "animation" : "newlook_castle/CastleLavaHall.def"},
					"fort_lava" : {"allowedTerrains":"lava"], "animation" : "newlook_castle/CastleLavaCastle1.def"},
					"citadel_lava" : {"allowedTerrains":"lava"], "animation" : "newlook_castle/CastleLavaCastle2.def"},
					"castle_lava" : {"allowedTerrains":"lava"], "animation" : "newlook_castle/CastleLavaCastle3.def"},
					"capitol_lava" : {"allowedTerrains":"lava"], "animation" : "newlook_castle/CastleLavaCastle3F.def"},

					"village_rough": {"allowedTerrains":"rough"], "animation" : "newlook_castle/CastleRoughHall.def"},
					"fort_rough" : {"allowedTerrains":"rough"], "animation" : "newlook_castle/CastleRoughCastle1.def"},
					"citadel_rough" : {"allowedTerrains":"rough"], "animation" : "newlook_castle/CastleRoughCastle2.def"},
					"castle_rough" : {"allowedTerrains":"rough"], "animation" : "newlook_castle/CastleRoughCastle3.def"},
					"capitol_rough" : {"allowedTerrains":"rough"], "animation" : "newlook_castle/CastleRoughCastle3F.def"},

					"village_sand": {"allowedTerrains":"sand"], "animation" : "newlook_castle/CastleSandHall.def"},
					"fort_sand" : {"allowedTerrains":"sand"], "animation" : "newlook_castle/CastleSandCastle1.def"},
					"citadel_sand" : {"allowedTerrains":"sand"], "animation" : "newlook_castle/CastleSandCastle2.def"},
					"castle_sand" : {"allowedTerrains":"sand"], "animation" : "newlook_castle/CastleSandCastle3.def"},
					"capitol_sand" : {"allowedTerrains":"sand"], "animation" : "newlook_castle/CastleSandCastle3F.def"},

					"village_snow": {"allowedTerrains":"snow"], "animation" : "newlook_castle/CastleSnowHall.def"},
					"fort_snow" : {"allowedTerrains":"snow"], "animation" : "newlook_castle/CastleSnowCastle1.def"},
					"citadel_snow" : {"allowedTerrains":"snow"], "animation" : "newlook_castle/CastleSnowCastle2.def"},
					"castle_snow" : {"allowedTerrains":"snow"], "animation" : "newlook_castle/CastleSnowCastle3.def"},
					"capitol_snow" : {"allowedTerrains":"snow"], "animation" : "newlook_castle/CastleSnowCastle3F.def"},

					"village_swamp": {"allowedTerrains":"swamp"], "animation" : "newlook_castle/CastleSwampHall.def"},
					"fort_swamp" : {"allowedTerrains":"swamp"], "animation" : "newlook_castle/CastleSwampCastle1.def"},
					"citadel_swamp" : {"allowedTerrains":"swamp"], "animation" : "newlook_castle/CastleSwampCastle2.def"},
					"castle_swamp" : {"allowedTerrains":"swamp"], "animation" : "newlook_castle/CastleSwampCastle3.def"},
					"capitol_swamp" : {"allowedTerrains":"swamp"], "animation" : "newlook_castle/CastleSwampCastle3F.def"},

					"village_subterra": {"allowedTerrains":"subterra"], "animation" : "newlook_castle/CastleSubterraHall.def"},
					"fort_subterra" : {"allowedTerrains":"subterra"], "animation" : "newlook_castle/CastleSubterraCastle1.def"},
					"citadel_subterra" : {"allowedTerrains":"subterra"], "animation" : "newlook_castle/CastleSubterraCastle2.def"},
					"castle_subterra" : {"allowedTerrains":"subterra"], "animation" : "newlook_castle/CastleSubterraCastle3.def"},
					"capitol_subterra" : {"allowedTerrains":"subterra"], "animation" : "newlook_castle/CastleSubterraCastle3F.def"},					
				}
			}
		}
	}
}

Some color disruption of castle looks is some bug in VCMI (common to HOTA mod - they used system colors for graphics)


Hello everyone.

I tried to make an ability that could effectively jam the spellcasting of other creatures. Problem is, it affects only the maximum casts of the stack, not its current one so it’s practically useless.

E.g. Fairy Dragon has a line displaying “Spells: 5”. After being hit with this effect it changes to “Spells: 2 (5)”. So it decreased his maximum casts and nothing else. He will still doll out all 5 of his magical beatings like nothing happened.

Here’s how it’s written:

	"jammer":
	{
	"type" : "CASTS",
	"val" : -3, 
	"valueType" : "ADDITIVE_VALUE",
	"duration" : "N_TURNS",
	},

Any suggestions?

Currently impossible, spell counter is separate from CASTS bonus and can’t be modified by Bonus system at all. Same is true for shots, conunterstrikes and possibly more.

yes, i also tried to play “type” : “CASTS” and get nothing.
You can also try

{"type":"CASTS",
"valueType":"BASE_NUMBER",
"val":0,
"duration":"N_TURNS"
} 

Or

{"type":"CASTS",
"valueType":"PERCENT_TO_ALL",
"val":-100,
"duration":"N_TURNS"
} 

Thanks for quick reply!

Shame it can’t properly work right now, but if it will in future, it could be very useful and unique ability.

I’ll try not to bugger you too often but I have one last concern. I can’t make ADDITIVE_VALUE work as intended. Be it with afore-mentioned ability or some other one, all I can achieve is reducing creature’s statistic by defined value and not one point further. On older version of VCMI Disrupting Ray didn’t work at all, but it does after updating to 0.98d and it was written just like in my code (just with different “type”). Am I missing something obvious?

?
ADDITIVE_VALUE should work as you say - is it summed with parameter value. If you want to make -2 to defence (val:-2,“valueType”:“ADDITIVE_VALUE”), it will make -2 to defence (don’t remember but it will be lowered to 0 as there are no negative stat params allowed.

PS On primary params on older versions PERCENT_TO_ALL doesnt work. On most recent version didnt tested it yet. I tried to make artefact with bonus

{
"type":"PRIMARY_SKILL",
"subtype":2,
"val":100,
"valueType":"PERCENT_TO_ALL"
}

and it didnt icrease spell power by 100% :imp:

Hi everyone.

Opening my experimental town in a map editor got me excited, so I played around with some new ideas. One of them is an ability to turn foes to ice. That’s just a “stone gaze”/“paralysis” but with a twist. Attacking frozen unit would shatter it and make it lose its top stack, not unlike the Mighty Gorgon’s DEATH_STARE. I think it’s doable, but I lack some kind of limiter.
When I tried wishful thinking, I got a yellow message “Adding new bonuses not implemented” (shoot), so I thought I’ll ask here. What would I need to do to change the list of standard bonuses? I thought this shouldn’t be too hard, it wouldn’t even do anything, just be there and serve as a flag.

Well, every bonus effect is handled in C++ code. You are free to add new bonuses as long as it make sense. But we don’t need more “flags” with no functionality while so many WoG bonuses are still missing.

I though this one will be a piece of cake to make, but it turned out to be a tough cookie instead. I wanted to make a simple bonus, activated only at specific type of terrain. Am I doing something wrong, is it not yet implemented or did I misinterpret the use of “sourceType” determinant? NATIVE_TERRAIN doesn’t work as well. Bonus appears at all times regardless of terrain type.

			"Snow Stealth" : 
			{
				"type" : "BLOCKS_RETALIATION",
				"sourceType" : "TERRAIN_OVERLAY",	
				"sourceID" : 4
			}