When doing quests (earth, at least) , I noticed that at a moment, it's possible to create heroes from different tribes. I also have found some "scroll of detachment", but I can't figure what they are doing, except changing the sprite of the hero.

freem {l Wrote}:When doing quests (earth, at least) , I noticed that at a moment, it's possible to create heroes from different tribes. I also have found some "scroll of detachment", but I can't figure what they are doing, except changing the sprite of the hero.

The Scroll of Detachment transforms a faction-specific unit into its civilization's standard version. So, for instance, a Frankish swordsman (that is, a faction-specific swordsman for the Frank Tribe) using the scroll will become a Teuton swordsman. The scrolls like "Scroll of Frankish Allegiance" do the opposite. The effects of the "spells" are something that definitely should appear when hovering over the scrolls, I'll get to work on that.

Besides the graphic changes, faction-specific units have some stat changes. For instance, the Suebi swordsmen have less armor, but they deal more damage.

Ok, so tribes have different statistics. I was not able to determine that even by reading the code. Could you show me where tribe's stats are defined, please? And eventually, how encyclopedia is generated. Just in case I feel courageous enough to contribute more than some warning fixes (no promise here, really. I only contribute to stuff depending on my humor... and depending on how people behave when I say there is a need for refactoring hehe).

freem {l Wrote}:Ok, so tribes have different statistics. I was not able to determine that even by reading the code. Could you show me where tribe's stats are defined, please? And eventually, how encyclopedia is generated. Just in case I feel courageous enough to contribute more than some warning fixes (no promise here, really. I only contribute to stuff depending on my humor... and depending on how people behave when I say there is a need for refactoring hehe).

Each tribe is defined in their corresponding civilization's factions.lua file; for instance, the Brising Clan is defined in the /scripts/civilizations/dwarf/factions.lua file. One of the fields available when defining a faction is "FactionUpgrade", which contains an upgrade to apply to the faction's units. In the civilization's upgrade_faction.lua file you can see the defined upgrades for the different tribes (defined with DefineUpgrade), along with their respective upgrade modifiers (defined with DefineModifier). The modifiers actually carry out the effects of the upgrade, such as changing a unit type's stat. Besides changing unit type stats, upgrade modifiers can also change one unit type into another. Some factions have faction-specific unit types, so their faction upgrades change their units accordingly; for instance, the Brising Clan's faction upgrade changes that player's dwarven Miners into Brising Miners.

Faction-specific units are defined in their respective "units" file. For example, the Brising units are defined in the /scripts/civilizations/dwarf/units_brising.lua file. Some aspects related to the units are defined in the main /scripts/civilizations/dwarf/units.lua file, however (such as the dwarven Mead Hall being able to train Brising Miners).

If a faction has a "ParentFaction" defined, but no "FactionUpgrade" of its own, then it will use the upgrade of its parent.

I've pushed a few commits improving the organization of the faction upgrades and units (previously they were in the main files of their civilization), and making it so the faction entries in the encyclopedia show the faction's color and effects (previously these elements were shown only when selecting a faction in a custom game).

The encyclopedia is generated through the /scrips/menu/encyclopedia.lua file.