Special artifacts

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?

To which bug do you refer?

This case.

Ah, ok. No, currently i do not have this any more. It will take some time to reproduce this. But i’m sure i can do it.

I have a very large map with some random factions to play with mods. Can i upload this map somewhere here? It is big enough to show any existing bug sooner or later :slight_smile:

Another question: I’m still experimenting trying to add something that makes some artifacts more useful for some heroes. In particular i’m currently experimenting with Caitlin and her gold production. So the idea is: If some other hero, f.ex. Orrin, has the Endless Sack of Gold equipped, you get the normal +1000 gold per day. If this is equipped by Caitlin, you get significantly more. It took me ages of experimenting, but may be i now found something that works. I have set up the Endless Sack of Gold this way:

	"core:endlessSackOfGold":
	{
		"text" : { "description" : "This item generates 1000 Gold per day and doubles the heroes income (if any)." },
		"bonuses" : [
			{
				"type" : "GENERATE_RESOURCE",
				"subtype" : "resource.gold",
				"val" : 500,
				"valueType" : "BASE_NUMBER",
				"stacking" : "ALWAYS"
			},
			{
				"type" : "GENERATE_RESOURCE",
				"subtype" : "resource.gold",
				"val" : 100,
				"valueType" : "PERCENT_TO_ALL"
			}
		],
	},

I found something very astonishing. It seems the second bonus is applied twice. First, it increases the artifact bonus (first bonus) by 100%, doubling the first bonus. Standard bonus is +1000 gold. With this mod the base gold production is +500 gold, and this is then doubled, giving a total of +1000 gold. So far so boring. Now the second bonus is applied another time, this time to the hero, effectively doubling the heroes gold production. Orrin has no gold production, so this second bonus does nothing, but applied to Caitlin, it doubles her gold production. This is very much what i wanted. Can anyone verify this behavior? For me it was somewhat surprising :slight_smile:

I will try now to modify the estates skill in a similar way.

BTW: Is there any way to show the current amount of produced gold in the specialty description?