I have an idea on how to add a building to a city that has an alternative creature.
I've wanted this for a long time, and I'm probably not the only one, to add an additional building to a city for hiring new creatures.
It seems that it's impossible to create a full-fledged additional building, but there are a couple of ideas on how to create an alternative one.
I'm warning you in advance, there will be a lot of text.
But in short, unfortunately, I couldn't outline the entire scheme.
First, I'll briefly describe what I found out.
1) A creature appears in the hiring window based on the ID of the building to which it is attached (i.e., if there is a level 7 creature in a building with the ID dwelling_1, it will still appear on the first line in the hiring window).
2) It's not possible to assign new IDs; i.e., you can't just enter dwelling_8 or special_8 for a building. In my case, the game crashes.
(Correction: the previous information was incorrect; the game crashed for another reason, related to the fact that the new building was not specified in the interface file. In reality, the game provides for 10 buildings of the special format, from special0 to special9. Each city has at least a couple of such buildings that are not used, so they can be used in mods.)
3) Unimproved, upgraded, and alt-upgraded creatures appear in the first, second, and third squares in the hiring window, respectively. This, in turn, is linked to the creature (i.e., if you assign an improved creature to a level 1 building without an original, it will still appear in the second square, not the first).
4) You can assign no more than two creatures to a building per level.
5) All buildings can theoretically be built up to level 5. The building plan and the dependencies of buildings on each other can be changed as you like, but I think everyone already knows that.
6) If you assign levels 3 and 4 (with a new original and two upgrades) to a building with creatures built up to level 2 (original and two upgrades), they will replace the primary creatures in the hiring window. This will happen as follows (according to the points written above): first, the old, unimproved unit will be replaced with a new one, while retaining the upgrades from the old creature. Then, the upgrades will be replaced with new ones.
It's clear that this is not exactly an alternative building, but rather a building "on top." And the third level of such a building looks terribly awkward (a new, unimproved unit and its old upgrades).
But this situation can be fixed with scripts.
You'll need a script to destroy the building, a script to rebuild it, and a script to assign a new valid level, but let's take it one step at a time.
First, let's create five levels of the building so that there are all possible combinations at different stages of construction.
1. Assign the original, unimproved unit.
2. Assign the new, unimproved unit.
3. Assign the new upgrade and alt-upgrade.
4. Assign the original, unimproved unit.
5. Assign the original upgrade and alt-upgrade.
This gives us the following combinations:
Level 1: Only the original unit is in the hiring window.
Level 5: The original unit with two upgrades is in the hiring window.
Level 2: Only the new unit is in the hiring window.
Level 3: The new unit with two upgrades is in the hiring window.
Now, you need to assign a relationship between these buildings using scripts.
Of course, these scripts need a trigger.
It would be inconvenient and ugly to do this through dialog boxes.
I have an idea to do it through the same buildings. For this, you can use buildings with IDs special or even use taverns and forges. Any building with a resource to upgrade to level 5 will do.
Let's take the city of the Elves as an example and try to make it as clear as possible.
Let's take the buildings dwelling_1 (Fairy building), special_4 (building that increases the growth of fairies), and blacksmith (forge). Let's try to add an alternative building with knights to them. The scheme would be as follows:
dwelling_1
upg1
(Fairies are assigned)
upg2
(Knights are assigned)
upg3
(Knight upgrades are assigned)
upg4
(Fairies are assigned)
upg5
(Fairy upgrades are assigned)
special_4
upg1
(Nothing is assigned; the building is empty, but the icon and description are designed as a building with fairy upgrades)
upg2
(The influence on the growth of fairies is assigned)
blacksmith
upg1
(The forge is assigned)
upg2
(Nothing is assigned; the building is empty, but the icon and description are designed as a building with an unimproved knight)
Next,
there are two options:
blacksmith upg2 (looking like a knight hiring building)
and
dwelling upg1 (looking like and being a fairy hiring building)
Let's assume we are building blacksmith upg2 to hire knights instead of fairies. Then, using a script, we need to assign: "If the blacksmith upg2 building is built, then automatically build dwelling_1 upg2 and prevent it from being built higher than level 3. Also, prevent the special_4 upg1 building from being built." As you can understand, no fairies will be available in this case.
In the alternative version, we build dwelling_1 upg1, assign a script that "if this building is built, prevent dwelling_1 upg1 from being built further and prevent the blacksmith upg2 from being built." The special_4 upg1 building appears, which was hidden before because it required dwelling_1 upg1 to be built. We build special_4 upg1, and using a script, we assign that "if special_4 upg1 is built, then dwelling_1 upg5 is automatically built." Now, fairies are built, and knights are no longer available.
As you can see, by skillfully arranging the icons and adjusting the description, you can create the impression for the player that it is not three different buildings, but only one with different development options.
The idea should work; I tested it on a minimal scale. There are a few minor bugs. First, in order for the script to build a building to work, you need to exit the city to the global map and go back in (you can warn the player about this bug in the building description). Second, when building alternative creatures, there will be some chaos with the city level, because visually one building is being built, but in reality, several buildings are being built. But this bug can even be played as a gameplay feature, and you can also warn the player about it in the building description.
In general, this method can double the variety of creatures that can be hired in any castle.
(P.S. I edited it, corrected the incorrect information)