[eLIB] UnitStat Background Mod v.M for LH 1.8

By on May 23, 2013 3:18:16 AM from Elemental Forums Elemental Forums

Heavenfall

Join Date 07/2008
+436

 

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

 

LH UnitStat Background Mod v.M = LH 1.8

(not compatible with leader pack DLC)


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.

 

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_IsUndead - 1 for Undead 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. Note that many (but not all) traits which unlock spells now grant Grey magic in LH.
 

 

 

 

Locked Post 61 Replies
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
May 23, 2013 3:18:38 AM from Elemental Forums Elemental Forums

If you find any errors, please post here.

Reason for Karma (Optional)
Successfully updated karma reason!
May 23, 2013 3:23:11 AM from Elemental Forums Elemental Forums

Oh yeah, changelog from the last FE version:

-vs champion attacks are no longer modified in this mod to work against IsChampion targets. This is because whether or not a target is a champion is static anyway. In addition, almost only champions use vs champions abilities/weapons, and the mod doesn't work like that since the effect would be "+x attack vs champions unless user is champion" (pointless)
-new type: IsUndead
-grey magic now includes any trait with <AbilityBonusType>Unit_Spell_Rank</AbilityBonusType>, which means the unit gets +1 Grey Magic from traits like Abjuration, Summon Wisp and Necromancy. In general expect more grey magic on summoners as a result
- removed non-unit stats from the mod, they can be done in separate mods instead: A_Additive_TileYieldGrain, A_Additive_TileYieldMaterials, A_Additive_TileYieldEssence

Edit: One more thing, the devs added their own Flying trait to some monsters now. This is going to be confusing, because this mod also adds a Flying trait, and to more units than the devs did in vanilla. I'll think about how to improve this.

Reason for Karma (Optional)
Successfully updated karma reason!
May 25, 2013 9:22:56 AM from Elemental Forums Elemental Forums

v.B, all undead now come with Not Alive and Immortal traits as well. No other difference.

Reason for Karma (Optional)
Successfully updated karma reason!
June 6, 2013 11:22:09 AM from Elemental Forums Elemental Forums

v.C = 1.1, no other changes than the expected changes after vanilla updates

Reason for Karma (Optional)
Successfully updated karma reason!
June 8, 2013 2:23:45 AM from Elemental Forums Elemental Forums

Does it matter if you have both the B version and the C version in your mod directory at the same time?

Reason for Karma (Optional)
Successfully updated karma reason!
June 8, 2013 2:50:39 AM from Elemental Forums Elemental Forums

Not really.

Reason for Karma (Optional)
Successfully updated karma reason!
July 6, 2013 4:13:25 AM from Elemental Forums Elemental Forums

Version D = 1.2. No changes except doing the same changes to core files as 1.1->1.2.

Reason for Karma (Optional)
Successfully updated karma reason!
August 22, 2013 2:13:16 PM from Elemental Forums Elemental Forums

Version E = 1.3. No special changes other than the patch notes.

Edit: Actually, version E fixes a bunch of monster Champions not having an allegiance. Also Kasst now properly counts as Monster, not Humanoid.

Reason for Karma (Optional)
Successfully updated karma reason!
August 22, 2013 11:21:32 PM from Elemental Forums Elemental Forums

this is just what i was looking for to add stats to creatures via questfile for my own personal mod.

 

now, if i only knew xml better

 

whoops, install to Mod file?

 

thanks Havenfall

 

 

Reason for Karma (Optional)
Successfully updated karma reason!
October 5, 2013 12:28:52 PM from Elemental Forums Elemental Forums

@HF,

I notice you have classified demons (Assassin Demon, Death Demon etc) as both Elemental AND Demon.  I would have thought that they were probably one or the other.... so maybe Demon and not Elemental.

What was the reasoning for making them both?  Is it because their base <CreatureType> is Elemental that you figure they should also get to be Elemental?

Thanks.

Reason for Karma (Optional)
Successfully updated karma reason!
October 5, 2013 12:36:55 PM from Elemental Forums Elemental Forums

Yes, but not all demons have to be elemental (my chaos legion aren't).

Reason for Karma (Optional)
Successfully updated karma reason!
October 5, 2013 12:56:20 PM from Elemental Forums Elemental Forums

OK cool.

 

Hmmm.... you have some nifty unitstats in COS that aren't in the BG unitstats library, specifically this one:

UnitStat_BG_IsCelestial

and these:

UnitStat_ImmuneToFear

UnitStat_IgnoreMaul

(as well as the changes to the spells to allow them to work).

 

If I want to use the UnitStat_BG_IsCelestial in my mod.... and I'm trying to make it work with or without COS, i'm guessing I can just include definitions for these few unitstats in my mod also (using the same definition as used in COS). 

Do you see any problems with defining them in a separate file in my mod, I doubt that would cause any problems?

 

Actually.... just thinking about it, based on the way the file loading thing works... couldn't I just take the entire COS_newunitstats.xml file and include it in my mod?  That way it will only load once anyway right and I can use these unitstats from COS in my mod... and it should also still be COS compatable.... do you think that would work?

 

 

Edit -> Sorry got another question (just working on all this stuff now)... am I correct that Angels from COS do not count as UnitStat_BG_IsImmortal ?     I guess that's a lore thing more than anything... but the presumption is that after x amount of years they eventually die of or retire or whatever ?  

 

 

Thanks.

 

Reason for Karma (Optional)
Successfully updated karma reason!
October 5, 2013 2:15:31 PM from Elemental Forums Elemental Forums

You can include the new unitstats yourself, but I'd rather you didn't have the same file name on purpose (since that may give me problems with updating it for users later on).

IsCelestial should work, ImmuneToFear also, IgnoreMaul was scrapped in FE:LH I think.

Angels in CoS are not immortal, they are humans given wings thousands of years ago. Although they probably still live much longer than a human would due to their affinity to magic powering their bodies.

Reason for Karma (Optional)
Successfully updated karma reason!
October 6, 2013 9:38:57 AM from Elemental Forums Elemental Forums

Quoting Heavenfall,
You can include the new unitstats yourself, but I'd rather you didn't have the same file name on purpose (since that may give me problems with updating it for users later on).

Yeah makes sense, will just borrow the Celestial stat for now, will be great some stuff I have in mind.

 

Just noticed this sort of thing crops up now and then in COS:

<GameModifier>
  <ModType>Unit</ModType>
  <Attribute>AdjustUnitStat</Attribute>
  <StrVal>UnitStat_ResistPierce</StrVal>
  <StrVal2>UnitStat_BG_IsRace_DeathLegion</StrVal2>
  <Provides>+10 physical resistance against enemies from Race: Death Legion</Provides>
  <Value>10</Value>
  <vsHigher>1</vsHigher>
</GameModifier>

 

I knew how to do this with attack stats already, and damage from spells etc.... but does this really work?  (defensive type bonuses).  So you can have say a bonus to defense or dodge vs a unitstat also....?  

It's not really a question because you've got similar stuff in a few places so obviously it does work.  I guess i'm just a bit surprised that the defensive stuff will work.  That's great.   And thanks for the ideas and all that 

 

Reason for Karma (Optional)
Successfully updated karma reason!
October 6, 2013 11:25:57 AM from Elemental Forums Elemental Forums

Yeah, it even works for spell resist and spell mastery when casting spells.

Reason for Karma (Optional)
Successfully updated karma reason!
November 10, 2013 2:00:08 AM from Elemental Forums Elemental Forums

Uploading new version F for FE:LH 1.4: https://dl.dropboxusercontent.com/u/32649007/A_LHLIB_UnitStat_BG_vF.rar

Thank you jeffqyzt2 for updating it since my own GPU doesn't run FE:LH at the moment.

Besides being updated to 1.4, the following changes are in:

-The background unitstat library now properly overwrites AI-only unit designs (new file: CoreAIUnits.xml)
-The background unitstat library now properly summons "summoned" versions of monsters in some token/scroll cases. Effects that create new units that aren't "summoned" no longer use the phrase summon in the description.
-Background unitstat library is now compatible with DLC 4 (the Undead DLC), thank you Derek Paxton!

Reason for Karma (Optional)
Successfully updated karma reason!
November 23, 2013 4:28:25 AM from Elemental Forums Elemental Forums

Heavenfall/jeffqyzt2,

Just been checking out the changes in vF.  I don't quite get what you've done with the DLC Undead units... as far as I can tell, they don't count as Undead, i.e. they don't have UnitStat_BG_IsUndead set anywhere in this library?

Thanks.

Reason for Karma (Optional)
Successfully updated karma reason!
November 23, 2013 5:19:15 AM from Elemental Forums Elemental Forums

The compatibility comes from Stardock actually putting in the background stats for each of the monster units. But, the aDLC04_units.xml do not have the appropriate background stats (probably an oversight).

Reason for Karma (Optional)
Successfully updated karma reason!
November 23, 2013 7:18:16 AM from Elemental Forums Elemental Forums

I think that HF normally clones the CoreUnits etc files and adds in the stats himself, and thats what goes in the library.  So to make the aDLC04_units compatible I would have expected to find that file in the new version of the library, with the stats added.

Reason for Karma (Optional)
Successfully updated karma reason!
November 23, 2013 11:50:06 AM from Elemental Forums Elemental Forums

Yeah, it's not part of the mod. Derek Paxton was kind enough to add it to the main game, meaning everyone should have it that has the DLC installed. I think I might have forgotten about aDLC04_units, I'll send a message to Derek again but it might not be updated officially for quite a while (he only agreed to update the files when they needed updating anyway, ie not just because of my stuff going in).

Reason for Karma (Optional)
Successfully updated karma reason!
November 23, 2013 11:57:37 AM from Elemental Forums Elemental Forums

Ah ok thanks parrott/HF.

Reason for Karma (Optional)
Successfully updated karma reason!
May 11, 2014 2:49:14 AM from Elemental Forums Elemental Forums

version H uploaded

 

Not compatible with dlc leader pack


vsUnitType_Overwrite.xml now makes use of the new modifier against unitstats, so all those things contained in the file are no longer "against x unless user is X", and now just "against x" (regardless of if user is x)

Reason for Karma (Optional)
Successfully updated karma reason!
May 11, 2014 4:35:11 AM from Elemental Forums Elemental Forums

Quoting Heavenfall,
version H uploaded

Great thanks.

 

Quoting Heavenfall,
Not compatible with dlc leader pack

Is there anything specific you're aware of that would not be compatible?  

Reason for Karma (Optional)
Successfully updated karma reason!
May 11, 2014 5:14:44 AM from Elemental Forums Elemental Forums

Sovereigns in the leader pack don't have the background unitstats. I've sent a file to Derek Paxton, hopefully he will include them in a future release like he has been so kind to do for dlc 1-4.

Reason for Karma (Optional)
Successfully updated karma reason!
May 11, 2014 8:14:13 AM from Elemental Forums Elemental Forums

Ah right okey.

Reason for Karma (Optional)
Successfully updated karma reason!
Stardock Forums v1.0.0.0    #108432  walnut2   Server Load Time: 00:00:00.0000969   Page Render Time: