Need some help with modding

Not at the moment, but this feature should be easy to implement.

That would be very very nice!

Another idea, not so easy to implement:
Would it be possible to replace those creature banks with another object, after beating it? Simply said: Replace it with a dwelling of that creature type and just keep the graphics the same? I did that long ago with erm, and it was nice. I did that also with those relic shops, crypt, warriors tomb, and with the dragon utopia. With these the dwelling type should be similar to the golem factory, offering 4 different types. These should be the same as the guards.
Just an idea, not that important. But it makes those objects useful during whole gameplay. The original objects are just decoration after beating them.

I have a problem with a hero specialty. What i want is a growing bonus on creature growth in the visited town. The specialty config is:

					{
						"type" : "CREATURE_GROWTH",
						"subtype" : 0,
						"val" : 1,
						"valueType" : "BASE_NUMBER",
						"updater" : "TIMES_HERO_LEVEL",
						"propagator": "VISITED_TOWN_AND_VISITOR",
					},
					{
						"type" : "CREATURE_GROWTH",
						"subtype" : 1,
						"val" : 24,
						"valueType" : "BASE_NUMBER",
						"updater" : {
							"type" : "GROWS_WITH_LEVEL",
							"parameters" : [ 20, 2 ]
						},
						"propagator": "VISITED_TOWN_AND_VISITOR",
					},

I had the updater for the level 1 creature similar to that of level 2. I modified it to this one to test if there is still the same problem. It is. What i want here is a growth of level 1 creatures of 1 for first hero level, of 2 for level 2, and so on. So i levelled the hero to level 2 and checked.
h3err02
The growth should say:
Cathrine: +2
What went wrong?

I guess it’s impossible to implement. Updater shows how quickly (or slow) bonus growths with hero level.

Well, that worked in version 1.0. But you are right, i fear exactly that is the reason. The updater is applied to where the propagator points to.
Well, if so, that would still be useful. I prefer to limit this specialty to castle towns for this hero. So it applies only to castle towns. But as far as i remember this limiter applies to the hero. So either way would be useful. Either if both, the updater and the limiter apply to the propagated target, or both apply to the hero.

I could f.ex. set the growth to some percent of the normal creature growth. The drawback is that this does not grow with hero level. But ok, it would be acceptable. Perhaps i split this into two growths, one for visited town, and one for player. This way it would at least grow with the number of towns. An aspect that maybe fits even better to a king than growing with level. But in both cases it would be desirable to limit that to castle towns.

I also have the “nobility” skill, that does not have these limitations. And i plan to give a similar specialty bonus to King Boragus, and King Trallosk (a hero still to create). No idea currently for the other factions.

P.S. I added two very small test maps for download. I use them to quickly check the results of my modding. Maybe they are useful for other modders too. One on grass and one on snow. Both are set to “build grail”, so you can “play” with them a few rounds without immediate ending :slight_smile:

I tried to set up the Ironfists specialty as described above. It works partly. Here is the config (part of it):

				"bonuses" : [
					{
						"type" : "CREATURE_GROWTH",
						"subtype" : 0,
						"val" : 7,
						"valueType" : "BASE_NUMBER",
						"propagator": "VISITED_TOWN_AND_VISITOR",
					},
...
					{
						"type" : "CREATURE_GROWTH_PERCENT",
						"val" : 50,
						"valueType" : "PERCENT_TO_ALL",
						"propagator": "PLAYER_PROPAGATOR",
						"limiters" : [
							{
								"type" : "CREATURE_ALIGNMENT_LIMITER",
								"parameters" : [ "good" ],
							}
						],
					}
				],

The limiter to the last one does not work. The valueType works. So it makes a difference if you have built the castle or not. I’d prefer to not add their bonus to evil or neutral alligned towns. But that seems to be impossible. Well, not that good, but for now i can live with it. Will try now to setup the estates specialty in a similar way :slight_smile:

Correction: The limiter works! I had a typo in the config. Now it is close to what i want.

I tried a similar thing with another specialty bonus. But this one does not work:

					{
						"type" : "GENERATE_RESOURCE",
						"subtype" : "gold",
						"val" : 50,
						"valueType" : "PERCENT_TO_ALL",
						"propagator": "VISITED_TOWN_AND_VISITOR",
						
					},

The town gold production stays as it is without the visiting hero.

Because town (or mines) don’t use Bonus system for resource generation ¯_(ツ)_/¯

Well, for creature generation it works :smirk:

Interesting feature:

I added something to the creature generation specialty:

					{
						"type" : "CREATURE_GROWTH_PERCENT",
						"val" : 50,
						"valueType" : "PERCENT_TO_ALL",
						"propagator": "PLAYER_PROPAGATOR",
						"limiters" : [
							{
								"type" : "CREATURE_ALIGNMENT_LIMITER",
								"parameters" : [ "good" ],
							}
						],
					}

The idea was: Increase creature growth in all good aligned towns. But what i got instead was interesting. I got this extra bonus as long as i owned only good aligned towns. The first town conquered of other alignment nullified this bonus. So it seems the player is no more considered good aligned as soon as he conquers the first neutral or evil aligned town. Indeed very interesting. Perhaps i can exploit that with other bonuses too :slight_smile:

Problem secondary skill not available in university:

I think i found the reason. In older versions there was a “defaultGainChance” or “gainChance”, which was used as a default when not configured in heroClasses.json. Now these fields are undocumented in wiki, and the core skills do not have them. So this might be the reason. I observed this in older versions, when i set the gain chance to zero.

Now these gain chances seem to be configured only in heroClasses.json. So i’ll modify my mod and check that again. But then there is a question: If i build new skills, how are they available to heroes of new classes of new factions?

You can look into any new mod skill json to see how it was done (Magic Fader for example).

Interesting. These have both, defaultGainChance and gainChance. Both are not documented.

Tested. Still not working. The skills are disabled in university.

Ok, i installed your mod and tested. Just got this new skill in an university:

h3err04

So you can see here, the university bug shows up with your mod too. The bug is limited to the university. Witch huts and normal levelling just give these skills normally.

What i currently do not understand: Why is Fire Magic disabled too? Visiting Hero was a Rampart Ranger.

BTW: The map is a self-made map, and the universities are not edited. I don’t know how to edit them. I use a modified version of the original editor, creating h3m file, because i want to make a campaign.

Looks to be issue with H3M maps loading.

When loading H3M map, vcmi loads allowed skills from h3m, but will not add any skills from mods into allowed list.

Will fix for 1.2, nothing wrong with your mod.
Your mod in 1.1 should work correctly with vcmi maps or with maps from RMG

Thanks!
And yes, this worked in 1.1. I’m glad i could help finding bugs.

BTW, i’m not sure, but there may be an issue with mod loading too. If i have an active mod with submods, then if i deactivate one of these submods, that deactivates the whole mod. Found this with WoG mod (deactivated commanders). And i think, the issue with the resourceful AI mod has the same reason.

PS: I will upload updated mod and map in a few days. Same URL.

PPS: Another bug? At least strange. I don’t know if this is related to some mod, or to the engine:
I found that f.ex. random artifacts now sometimes are war machines. Interesting, but not very useful. Now i got a spell book from a shipwreck survivor. The hero already had a spell book. So the new one was put into his backpack. So i wanted to give that extra spell book to another hero, but that was not possible.

I think it would be better to exclude those artifacts from everything that may reward with an artifact.

Just had another crash. This time the client. System message says there’s not enough memory. So i assume a memory leak in the client.

Bug in vcmi-extras mod?

I found this in the console output (excerpt):

		[SKIP] VCMI extras
Wrong Limiter will be ignored: The 'ONLY_ENEMY_ARMY' effectRange is only compatible with the 'OPPOSITE_SIDE' limiter.
Wrong Limiter will be ignored: The 'ONLY_ENEMY_ARMY' effectRange is only compatible with the 'OPPOSITE_SIDE' limiter.

It seems something has changed in the configuration of the limiters and was not ported to the configuration file.

It comes from WoT, not from vcmi-extras.

Ok, thanks.

A question: What is the difference between the SECONDARY_SKILL_PREMY and the SPECIAL_SECONDARY_SKILL bonus types? Say i want a specialty that adds a 5% bonus per level to some secondary skill. How to do that? I saw the SECONDARY_SKILL_PREMY in an existing mod, but the documentation says that the SPECIAL_SECONDARY_SKILL is for specialties. So what to use? And how to use the SPECIAL_SECONDARY_SKILL?

It works now!
fix001

Thanks!

1 Like