Special artifacts

Hi,
i’m trying to modify most of the core artifacts in a way that they give more bonus if some constraints are met. So f.ex. the “Centaurs Axe” gives more bonus to all centaurs. So far so easy. But there are other artifacts that are not special to some creature type, alignment, faction or the like, but are special to some heroes. These are mostly the resource generating artifacts like the endles sack of gold. I’d like to significantly increase the produced amount of gold, if this artifact is equipped by a hero with gold speciality. I tried it with source (with no effect), i tried to find limiters, propagators, and so on. But i run out of ideas how this could be achieved. Anyone any idea?

Additionally i’d like to add other bonusses depending on owned objects. That is especially true for the estates skill. I’d like to increase the estates income not by hero level, but by number of towns owned and the village/town/city hall built. And maybe by number of gold mines owned. But i found no documentation about how to add these objects as limiters to some skill and/or artifact or speciality bonus.

Unfortunatelly, nothing changed much in bonus system for years in this area. We’ve got only “GROWS_WITH_LEVEL” propagator, so you may add new artifact that will be generated more gold with growing hero level…

Well, thanks. But that is not what i want.

Currently it does mean nothing which hero carries which artifacts, and the decision of the skill buildup is just a matter of personal preference. I want to change that, so that the heroes specialities are much more significant. So that it makes f.ex. a big difference if you give the endless sack of gold to a gold specialist or to an armorer specialist. Or vice versa, a defense increasing shield should do much more when equipped by a hero with armorer speciality than when equipped by a here with gold speciality. So you can build up real specialists for the different tasks.
At least i think i can do something similar with estates (speciality or skill): Increase players income by some percent. That should do the trick. That should include all towns and all gold mines. But i want to have a separate gold skill, like there is an estates speciality and a gold speciality. And the gold speciality and skill should start like the estates but should have a different growth path. Estates should grow with your estates, while gold should grow with hero level.
I have already added the missing resource generating skills, which work nicely. And i have successfully created a “nobility” skill, which works somewhat like the statue of the legion, but limited to the town visited. And i have overhauled both ironfists. They are now King and Queen (speciality) and they start with nobility. So they are now better suuited to stay in castle ind increase creature growth, as King and Queen should do :slight_smile:

1 Like

Hmmm, idea: What about setting a hero propagator to the artifact, and increase gold production by some percentage? Would that increase the gold production of an already gold producing hero, or would that create an endless loop?

You must try. As far I remember, I’ve got strange things with similar experiments. No vanilla artifact has HERO propagator, so effect is hard to predict…

I’ll try today. And report any results :slight_smile:
Edit: Well, it seems it does just nothing.
The only thing i can do with the artifact is make it increase the estates skill. So if the hero does not have that skill he won’t get that extra bonus.

At least i found a partial solution. I edited the estates skill as well as the artifacts.

	"core:endlessPurseOfGold":
	{
		"text" : { "description" : "This item generates 500 Gold per day." },
		"bonuses" : [
			{
				"type" : "GENERATE_RESOURCE",
				"subtype" : "resource.gold",
				"val" : 500,
				"valueType" : "ADDITIONAL_VALUE",
				"stacking" : "ALWAYS"
			},
			{
				"type" : "GENERATE_RESOURCE",
				"subtype" : "resource.gold",
				"val" : 50,
				"valueType" : "PERCENT_TO_BASE",
			}
		],
		"index" : 117,
		"type" : ["HERO"]
	},

And the skill:

	"core:estates" : {
		"index" : 13,
		"base" : {
			"effects" : {
				"main" : {
					"subtype" : "skill.estates",
					"type" : "SECONDARY_SKILL_PREMY",
					"valueType" : "BASE_NUMBER"
				},
				"xtra" : {
					"type" : "GENERATE_RESOURCE",
					"subtype" : "resource.gold",
					"valueType" : "PERCENT_TO_ALL",
				}
			}
		},
		"basic" : {
			"description" : "{Basic Estates}\n\nYour hero contributes 125 gold per day to your cause, and increases your overall income by 25%.",
			"effects" : {
				"main" : { "val" : 125 },
				"xtra" : { "val" : 25 },
			}
		},
		"advanced" : {
			"description" : "{Advanced Estates}\n\nYour hero contributes 250 gold per day to your cause, and increases your overall income by 50%.",
			"effects" : {
				"main" : { "val" : 250 },
				"xtra" : { "val" : 50 },
			}
		},
		"expert" : {
			"description" : "{Expert Estates}\n\nYour hero contributes 500 gold per day to your cause, and increases your overall income by 100%.",
			"effects" : {
				"main" : { "val" : 500 },
				"xtra" : { "val" : 100 },
			}
		}
	},

The effect is this:
If the hero just has the artifact, he gets the base amount of gold, plus some percent. I still have to adjust the values to give the original amount in this case. If the hero has estates, he gets even more. And if he has estates specialty, he gets even more. So it is worth now to carefully choose the hero that will carry this artifact.

I think i will add another bonus, probably to the estates skill: Increase the town income in the town visited. Percentage too. So it may be a good idea to put such a hero into the capitol to produce the most gold :slight_smile:

Slowly but surely i make some advance. I think i will have more time for H3 after february next year.

1 Like

In H4 artifacts mod I added an artifact which doubles all kinds of resources generated by hero, and doubles Estates value as well:

{
    "necklaceOfNobility":
    {
        "type": ["HERO"],
        "slot" : "NECK",
        "class": "MAJOR",
        "value": 8000,
        "text":
        {
            "name": "Necklace of Nobility",
            "description": "Doubles the number of all resources produced by hero.",
            "event": ""
        },
        "graphics":
        {
            "image": "H4/iconsSmall/necklaceOfNobility.bmp",
            "map": "H4/map/NECKLACEOFNOBILITY.def"
        },
        "bonuses":
        [
            {
                "type": "GENERATE_RESOURCE",
                "subtype" : "resource.gold",
                "val": 100,
                "valueType": "PERCENT_TO_ALL"
            },
            {
                "type": "GENERATE_RESOURCE",
                "subtype" : "resource.wood",
                "val": 100,
                "valueType": "PERCENT_TO_ALL"
            },
            {
                "type": "GENERATE_RESOURCE",
                "subtype" : "resource.ore",
                "val": 100,
                "valueType": "PERCENT_TO_ALL"
            },
            {
                "type": "GENERATE_RESOURCE",
                "subtype" : "resource.mercury",
                "val": 100,
                "valueType": "PERCENT_TO_ALL"
            },
            {
                "type": "GENERATE_RESOURCE",
                "subtype" : "resource.sulfur",
                "val": 100,
                "valueType": "PERCENT_TO_ALL"
            },
            {
                "type": "GENERATE_RESOURCE",
                "subtype" : "resource.crystal",
                "val": 100,
                "valueType": "PERCENT_TO_ALL"
            },
            {
                "type": "GENERATE_RESOURCE",
                "subtype" : "resource.gems",
                "val": 100,
                "valueType": "PERCENT_TO_ALL"
            },
            {
                "type": "GENERATE_RESOURCE",
                "subtype" : "resource.mithril",
                "val": 100,
                "valueType": "PERCENT_TO_ALL"
            },
            {
                "type": "SECONDARY_SKILL_PREMY",
                "subtype" : "skill.estates",
                "val": 100,
                "valueType": "PERCENT_TO_ALL"
            }
        ]
    }
}

Ah yes. I did something quite similar. Not for all resources, but for a single resource. First i added a resource producing skill for each resource. For example:

	"vulcanology" : {
		"name" : "Vulcanology",
		"gainChance" : {
			"might" : 7,
			"magic" : 1
		},
		"basic" : {
			"images" : {
				"small" : "skills/SulfurSmall1.png",
				"medium" : "skills/SulfurMedium1.png",
				"large" : "skills/SulfurLarge1.png"
			},
			"description" : "{Basic Vulcanologist}\n\ngenerates 1 sulfur per day.",
			"effects" : {
				"main" : {
					"type" : "GENERATE_RESOURCE",
					"subtype" : "resource.sulfur",
					"val" : 1
				},
				"xtra" : {
					"type" : "GENERATE_RESOURCE",
					"subtype" : "resource.sulfur",
					"val" : 50,
					"valueType" : "PERCENT_TO_BASE",
				},
			}
		},
		"advanced" : {
			"images" : {
				"small" : "skills/SulfurSmall2.png",
				"medium" : "skills/SulfurMedium2.png",
				"large" : "skills/SulfurLarge2.png"
			},
			"description" : "{Advanced Vulcanologist}\n\ngenerates 2 sulfur per day.",
			"effects" : {
				"main" : {
					"type" : "GENERATE_RESOURCE",
					"subtype" : "resource.sulfur",
					"val" : 2
				},
				"xtra" : {
					"type" : "GENERATE_RESOURCE",
					"subtype" : "resource.sulfur",
					"val" : 100,
					"valueType" : "PERCENT_TO_BASE",
				},
			}
		},
		"expert" : {
			"images" : {
				"small" : "skills/SulfurSmall3.png",
				"medium" : "skills/SulfurMedium3.png",
				"large" : "skills/SulfurLarge3.png"
			},
			"description" : "{Expert Vulcanologist}\n\ngenerates 3 sulfur per day.",
			"effects" : {
				"main" : {
					"type" : "GENERATE_RESOURCE",
					"subtype" : "resource.sulfur",
					"val" : 3
				},
				"xtra" : {
					"type" : "GENERATE_RESOURCE",
					"subtype" : "resource.sulfur",
					"val" : 150,
					"valueType" : "PERCENT_TO_BASE",
				},
			}
		}
	},

Then i modified the resource producing artifacts. For example this one:

	"core:eversmokingRingOfSulfur":
	{
		"bonuses" : [
			{
				"type" : "GENERATE_RESOURCE",
				"subtype" : "resource.sulfur",
				"val" : 50,
				"valueType" : "PERCENT_TO_BASE",
			}
		]
	},

I hope i do not need to repeat the standard bonus here. The idea is:

A normal hero does not produce any sulfur. The ring produces 1 sulfur. The extra bonus adds 50%, which results in zero.

A resource specialist produces 1 sulfur. Add the ring, that produces another sulfur. Add 50%, which produces a third sulfur.

The skills produce a little more. So to get the maximum out of such a hero, take a sulfur producing specialist, add the vulcanology skill, and add the sulfur ring. All to the same hero. That should result in a maximized production.

Btw. i’m still searching for good names for these skills. Currently i have:

  • ore: prospector
  • wood: woodcutter
  • crystal: mining
  • gems: geology
  • mercury: alchemy
  • sulfur: vulcanology

I think, prospector and alchemy are already quite good. The others might still need a better name :slight_smile:

BTW, i found a bug:
One of the things i modified is hero specialties. The base for my ideas is the boost core mod. This mod increases power gain for all heroes with spell specialty. Basically a good idea. But i thought, for some heroes there may be a better idea. For all spell specialists with a battle spell which has a mass version, how to open battle with that spell? Not much power, just 5 (instead of 50 as some artifacts do), but still just open battle with it. I think this is interesting.
Now during tests i had a “battle” with a necromancer with death ripple specialty. The problem was, this hero had a single imp as army. So the death ripple took place, and he lost his whole army. Now the battle was no more finishable. I could do nothing because there was no stack to attack, and he could do nothing, because he had no stacks. Such a battle lasts forever.
So if possible: At the beginning of each round, even in round 1 or in tactics rounds, check if one of the opponents (or both) have any army. If only one has no army, the other wins, even without doing anything. If both have no army, remove both heroes.

Ha, funny bug, indeed. I created issue for this bug.

Thanks :slight_smile:

One more question:
I want to add a growth bonus as specialty to valeska, adding some growth for archers only, and only in the town visited. It works so far as i can give her the same bonus as the legs of the legion. But i want to limit it to archers. I tried a limiter, but that just eliminated the bonus. So that seems to be not the right way.
Now what about the “source” attribute for bonus? What does it do, how does it work? There is not much documentation about it. One of the sources is TOWN_STRUCTURE. What parameters does this need?
Or can i add a bonus to a town type, with HERO_SPECIALTY as source? The idea is: No source - no bonus. Is that idea right?

Peasants.
I tried to make peasants pay tax. Here is one example of what i’ve tried:

	"core:peasant" :
	{
		"cost" : { "gold" : 4 },
		"abilities" :
		{
			"tax" :
			{
				"type" : "GENERATE_RESOURCE",
				"subtype" : "resource.gold",
				"val" : 1,
				"propagator" : "PLAYER_PROPAGATOR"
			},
		}
	},


I tried various propagators. I tried HERO, VISITED_TOWN_AND_VISITOR, and PLAYER_PROPAGATOR. Nothing worked. There is no error shown in the logs, but it simply doesn’t work. What did i do wrong?

Another bug:


That was the result of a battle against someone who had a combi artefact. After battle i was asked if i would like to assemle it. I tried 2 times (reloading the game), one time with yes, the other time with no. Same result.

As you can see, the console spams out these 2 messages in an endless loop:

battleGetStacksIf called when no battle!
battleGetAllObstacles called when no battle!

I had to forcefully terminate the prog by using the close button of the OS.
I hope this helps find the reason :slight_smile:

I’m still trying to give Valeska (just as a first example) a creature growth bonus. I got something that is working to some degree, but is not what i really want:

	"core:valeska":
	{
		"specialty" : {
			"bonuses" : {
				"growth" : {
					"type" : "CREATURE_GROWTH",
					"subtype" : 1,
					"val" : 9,
					"valueType" : "BASE_VALUE",
					"propagator": "VISITED_TOWN_AND_VISITOR",
				}
			}
		}
	},


This increases the growth of any level 2 creature in any town visited by valeska. What i want is a growth bonus exclusive for archers/marksmen. I tried various limiters, but any limiter i apply simply eliminates the bonus. It seems limiters do not work here. I tried a faction limiter, a creature type limiter, and even many nonsense limiters. Regardless of what i tried, any limiter just eliminated the bonus. Anyone any idea?

I’m almost sure it’s impossible to code that. Game doesn’t know what apply first - limiter or propagator - and nothing we can do with it.

Well, that is the reason why i suggested to add a limiters structure to the propagator.

Would it be possible to add a specialty bonus, limited, so that the bonus applies only after reaching level X?

And: I’d like to make a spell that needs a dead stack as target. Is that possible? Not an undead stack, but a dead stack. The spell should, among other things, remove that dead stack. Is that possible?

Could you provide simple mod (or save?) with this bug to reproduce?