Heavenfall Heavenfall

[eLIB] UnitStat Background Mod v.ZG for FE

[eLIB] UnitStat Background Mod v.ZG for FE

 

This library mod is for other modders to include in their mods. There is no point downloading this on its own as a player.

 

UnitStat Background Mod v.ZF = FE 1.34


As part of making the game have greater depth, which is the purpose of any mod, I will be releasing a UnitStat Background mod. The purpose of this library-type mod is to flag unittypes, items and traits with certain UnitStats that will allow the modders to identify them in various scenarios. It is a bit difficult to explain, so I will simply give an example: Imagine a dragon has UnitStat_BG_IsDragon = 1. Then we put this modifier on a weapon:

            <GameModifier>
                <ModType>Unit</ModType>
                <Attribute>AdjustUnitStat</Attribute>
                <StrVal>UnitStat_Accuracy</StrVal>
                <StrVal2>UnitStat_BG_IsDragon</StrVal2>
                <Value>10</Value>
                <vsHigher>1</vsHigher>
            </GameModifier>

The result is a weapon that gains +10 accuracy whenever it attacks against a dragon. Voilá, a dragon-slaying weapon. Or a trait. Such UnitStats can also be referred to in Calculate tags in spells, for example to make a damage spell deal even more damage against a dragon.

Note that this mod will only function as a library of back-ground unitstats. It will be up to the modders to use the unitstats as they see fit.

 

I want to open up the floor for what unitstat flags the modding community expect to find in such a mod.

 

This is my planned list of unitstats. Note that these unitstats will not have defaultvalue set to 0 for all units, they will simply have 0 by virtue of not having it. 

Equipment UnitStats:

UnitStat_BG_IsUsingMount - 1 for mounted units, 0 for un-mounted units

Unit UnitStats: (stats marked ^ are given through traits to help players understand what is what)

UnitStat_BG_IsChampion - 1 for champions and sovereigns
UnitStat_BG_IsSovereign - 1 for sovereigns, 0 for others (note that everyone with IsSovereign also have IsChampion)
UnitStat_BG_IsMilitia^ - 1 for city militia, 0 for all others
UnitStat_BG_IsHumanoid - 1 for any unit that resembles a human in shape, not necessarily in size
UnitStat_BG_IsNotAlive^ - 1 for any unit that does not have blood pumping in its veins, is incapable of consuming nutrition, and is incapable of reproduction
UnitStat_BG_IsEmpire - 1 for sovereigns, champions and designed units from empire factions. 0 for others
UnitStat_BG_IsKingdom - 1 for sovereigns, champions and designed units from Kingdom factions. 0 for others
UnitStat_BG_IsRace_ - These unitstats are given to mark all champions, sovereigns and designed units from certain racetypes. These are the "races" that appear in Unit Details when you create a normal unit. The wildcard (*) is replaced by the name of the race as it appears in-game. The vanilla game contains 10 races that have the following names: Altarians, Mancers, Ironeers, Amarians, Tarthans, Krax, Wraiths, Trogs, Urxen, Quendar. For example, all of the race Altarians have UnitStat_BG_IsRace_Altarians = 1
UnitStat_BG_IsMonster - for all units considered monsters. Note that this applies to recruited monsters as well. Anything that is not humanoid is considered a monster.
UnitStat_BG_IsDragon - 1 for dragon monsters, 0 for others
UnitStat_BG_IsElemental - 1 for elementals, 0 for others
UnitStat_BG_IsBeast - 1 for beasts, 0 for others
UnitStat_BG_IsTwisted - 1 for Twisted creatures, 0 for others
UnitStat_BG_IsConstruct - 1 for construct creatures, 0 for others (basically golems)
UnitStat_BG_IsDemon^ - 1 for demons, 0 for others
UnitStat_BG_IsGod^ - 1 for the 5 elemental gods found in the wildlands and other godtype units at your discretion, 0 for others
UnitStat_BG_IsSummoned^ - 1 for units that are specifically summoned through magical spells, and NOT those trained. 0 for others
UnitStat_BG_IsImmortal^ - 1 for certain units that cannot die from old age. In the core game, these include: Titans, Dragons and Butchermen, Elemental gods (NOT all elementals!). 0 for all others. Keep in mind constructs are not immortal and may die from old age (they basically turn to dust after a few thousand years), but they are also UnitStat_BG_IsNotAlive^ 1.
UnitStat_BG_IsOversized^ - It is 1 for units that are substantially larger than a single human-sized mounted man. Note that this indicates that a singular unit of this sort is oversized - a unit does not become oversized if it goes from 1 to 9 members. Dragons, Giant Slags, Giant Drakes, elemental gods, and so on. It is 0 for all others.
UnitStat_BG_IsMale - 1 for units specifically marked male. 0 for others. Note: This is only applied to champions and sovereigns and troops. Practically noone else has a gender. It is perfectly possible for a unit to have 0 in both _IsMale and _IsFemale.
UnitStat_BG_IsFemale - 1 for units specifically marked female. 0 for others. Note: This is only applied to champions and sovereigns and troops. Practically noone else has a gender. It is perfectly possible for a unit to have 0 in both _IsMale and _IsFemale.
UnitStat_BG_IsFlying^ - 0 (default) = incapable of flight. 1 = Capable of Flying (does not need to be constantly flying)

Other Custom UnitStats:

UnitStat_BG_HasInjuries - 0 for all, each injury suffered by a champion adds +1. Note that there are many "flaws" that are NOT injuries. This tag is specifically for champion injuries suffered due to incapacitation in combat.
UnitStat_BG_Spellbooks - between 0 and 5, depending on how many spellbooks this champion/sov/unit has. It is enough to have rank 1 in a spellbook to get +1 in this unitstat.
UnitStat_BG_GreyMagic - Between 0 and 25+, depending on how many spelltraits this champion/sov/unit has. Each spelltrait adds 1, so a champion with Death2 Fire3 would have UnitStat_BG_GreyMagic = 5.

Non-unit Stats
A_Additive_TileYieldGrain - Faction-wide bonus additive to Grains. Ex: +1 Grain in every city
A_Additive_TileYieldMaterials - Faction-wide bonus additive to Materials. Ex: -1 Material in every city
A_Additive_TileYieldEssence - Faction-wide bonus additive to Essence. Ex: -1 Essence in every city

 


 

Currently disabled

UnitStat_BG_IsInSwamp - 0 for all units, 1 for those who are occupying a Swamp tile on the strategic map
UnitStat_BG_IsInPlains - 0 for all units, 1 for those who are occupying a Plains tile on the strategic map
UnitStat_BG_IsInHills - 0 for all units, 1 for those who are occupying a Hills tile on the strategic map
UnitStat_BG_IsInDesert - 0 for all units, 1 for those who are occupying a Desert tile on the strategic map
UnitStat_BG_IsInForest - 0 for all units, 1 for those who are occupying a Forest tile on the strategic map
UnitStat_BG_IsInCity - 0 for all units, 1 for those who are occupying a City tile on the strategic map
UnitStat_BG_IsInRiver - 0 for all units, 1 for those who are occupying a River tile on the strategic map



UnitStat_BG_IsUsingSmallShield - 1 for units with a small or normal shield equipped, 0 for others. Does not mark tower shields.
UnitStat_BG_IsUsingTowerShield - 1 for units with a tower shield equipped, 0 for others. Does not mark non-tower shields
UnitStat_BG_IsUsingSpear - 1 for units with a spear, 0 for others
UnitStat_BG_IsUsingStaff - 1 for units with a staff, 0 for others
UnitStat_BG_IsUsingBow - 1 for units with a bow, 0 for others
UnitStat_BG_IsUsingMace - 1 for units with a mace, 0 for others
UnitStat_BG_IsUsingSword - 1 for units with a sword, 0 for others
UnitStat_BG_IsUsingAxe - 1 for units with a axe, 0 for others
UnitStat_BG_IsUsingDagger - 1 for units with a dagger, 0 for others

UnitStat_BG_IsUsingTwoHanded - 1 for units with a Two-handed weapon equipped, 0 for others. This counts for all weaponry that requires both hands to use, such as staffs, bows and spear.
UnitStat_BG_IsUsingOneHanded - 1 for units with a one-handed weapon equipped, 0 for others.
UnitStat_BG_IsUsingDualWield - 1 for units with two one-handed weapons equipped, 0 for others
UnitStat_BG_IsWearingLeather - This value is between 0 and 7 - each equipped leatherpiece adds 1, chest and leggings add 2 instead of 1
UnitStat_BG_IsWearingChainmail - This value is between 0 and 7 - each equipped chainmailpiece adds 1, chest and leggings add 2 instead of 1
UnitStat_BG_IsWearingPlate - This value is between 0 and 7 - each equipped platepiece adds 1, chest and leggings add 2 instead of 1
UnitStat_Bg_MagicalNature - A custom value given to items of a magical nature. Any non-magical item should have nothing (0). As a base-line, magical items will start at UnitStat_Bg_MagicalNature = 100. Particularly powerful, or reality-bending items might have 200 or even 300. There is no clear line between rarity of items and this stat, because the game has many "uncommon" magical and non-magical items. Items will display their number in the item tooltip, unless it is 0 in case it won't be mentioned. Accessories can also have this stat.
UnitStat_BG_IsRanged - 1 for any weapon that turns the main attack of a unit into a ranged attack. 0 for others
UnitStat_BG_IsMelee - 1 for any melee weapon, and any unarmed monster. 0 for others


 

 

 

92,406 views 145 replies
Reply #101 Top

But how do I accomplish that? Tile yields follow a completely separate calculation. Sure, I can give a terrain tile a stat technically. But how do I make it equal the tile yield when the tile yield follows a fairly complex formula gathering its values from 1) adjacent tiles with different terrains and environments and 2) nearby world resources.

Anyway making unitstats out of tile yields would still only mean it was given to units in the area, not cities. I haven't seen any indication that cities collect unitstats, and I was certainly never able to refer to them inside a city.

Reply #102 Top

U = 0.981

Added henchmen magical traits to CoreModificantionFiles/Spelltraits.xml so they give Henchmen Grey magic and Spellbook unitstats

Reply #103 Top

uhm hidden doesnt seem to work

its hidden only in the unit panel but not in the item that provides the stats, is this correct?

Reply #104 Top

Correct. I suggest you use the <Provides> tag to make a custom text.

Reply #105 Top

but i dont want any text at all

 

for example for isusingstuff and other internal stats i need just to adjust calculations etc

Reply #106 Top

Too bad! :)

Reply #107 Top

Do note that isusingstaff and most other equipment stats were turned off due to loot bugs in the game.

Reply #108 Top

what kind of bugs ?

Reply #109 Top

Basically the old version of the mod overwrote most gameitemtypes (armor, weapons and some other stuff). When I did this, the game's loot system would go haywire and started dropping nonsense loot for players. For example, a shrill lord was previously set to give the player a random item - the result was that the shrill lord would give the player things like clothes, heads and hairstyles instead of proper items we can use.

 

Reply #110 Top

I tested if the bugs were still active and they are. Overwriting all CoreWeapons, CoreArmor and CoreItems from outside the core file causes massive issues with random loot from monsters.

Reply #111 Top

yeah i just added them to core files

Reply #112 Top

Uploaded version V for 0.982

One big change, Sovereigns now count as Champions as well (everyone with isSovereign now has isChampion). Previously, a hero was either champion or sovereign. The change is necessary because the game now has functions to deal extra damage against "Champions". The game does not distinguish between Champions and Sovereigns like this mod does, in the vanilla game a Sovereign and a Champion both count as Champions.

In addition, Henchmen are treated as fully fledged Champions in this mod. In the un-modded 0.982 they are not treated as Champions for the purposes of suffering from weapons that specifically target champions. I reported the issue here https://forums.elementalgame.com/433155 and since Derek Paxton says it is going to change, I am including the up-coming change in this mod. If you got lost in the sentences, all you need to know is that Henchmen fully count as champions in every way in this mod, while weapons and traits that target champions do not function against them without the mod (0.982 only).

 

Reply #113 Top

I forgot to change the mounts, please download version V again if you did already.

Reply #114 Top

version W uploaded

Reply #115 Top

version X uploaded

Reply #116 Top

Y = 0.991

Reply #117 Top

Version 0.992 only had three very small backstory edits for three sovereigns, not going to update this mod for that.

 

Reply #118 Top

Z = FE 1.00

Reply #119 Top

Uploaded version ZA to OP which is 1.004 pre-release. Version Z is still for FE 1.00.

Reply #120 Top

Suggestion for a new UnitStat: check if a unit is knocked down, so that other effects can chain off it (i.e. always critical damage, never dodges, animals easier to tame).

Another one: flying/floating (so that a spell like Earthquake does not affect it, but a spell based on storm/wind/freezing/lightning is increased in its effect)

Reply #121 Top

The first one is better off in a spell as it is 100% dynamic. There is no creature that is knocked down all the time, so it doesn't really belong in this library. I would personally categorize it as a "temporary status" in which case there could really be any number of them - is the character blind? cursed? slowed? feared? And so on.

The second one is a great idea though. Air Elementals and Crow Demons are Flying, obviously. I have some modded creatures that are also Flying. There is also the Air Walker Scroll that causes a champion to become Flying, although there are no new animations. I'll hook this up in the next version.

Should Dragons and Dragon Mounts make the unit count as Flying? They certainly can fly, but they mostly sit on the ground in combat. They also cannot "cross any tile" in strategic mode. I would still say they should count as flying, as they are capable and have the wings to support them (and are depicted as flying in the lore).

 

Reply #122 Top

I'd say yes. Even if they spend most of the time on the ground, I'm sure dragons would take off the second it starts shaking.

Reply #123 Top

Small heads up, I found some wrong values for Shortsword_Hunters where it has 5 ini instead of 3, and is available for custom sovs. Will be fixed in next version ZB (thursday). Also

Introduced new unitstat UnitStat_BG_IsFlying, given through traits to Air Elemental, Crow Demon (all versions), Fell Dragon, Sarog, Storm Dragon, Ashwake Dragon, Clambercoil Dragon. Ability also given to any champion that reads the Air Walker Scroll. Also any unit mounted on a dragon mount gets +1 to the stat (visible in dragon's equipment tooltip) .0 (default) = incapable of flight. 1 = Capable of Flying (does not need to be constantly flying)

Reply #124 Top

ZB = 1.01 with the changes above

Reply #125 Top

ZC = 1.02