Updating Your Mod From Athena to EBSG Framework - KonradHeinser/EBSGFramework GitHub Wiki
This mod page is dedicated to just giving the quick version of how you update your mods from Athena Framework to this one. Many of the updates will just involve changing your AthenaFramework to say EBSGFramework, but some of them may be more involved, either through changes in how the xml is set up or through more options available to you. Most of the changes in question not related to the namespace change are just changes to the labels into something I thought made more sense.
If a comp/extension is not listed below, then it was not integrated due to either it not being something I'm interested in, or I did not find the code in question reliable enough to want to consider adding to the framework. If a part of a comp or extension isn't mentioned on this page, that means there was no change to that part that requires you to do something:
Credit to the base of most of this code goes to SmartKar
Butchery Changing Genes (Replaces Additional Gene Drops (GeneButcherProductExtension if you're using crtl + f to find stuff on this page))
The code for this has undergone massive changes from the Athena version, so you will need to go to the wiki page to create a new version
Damage Modifying Stats Extension (Partial replacement for Damage Modification (aka DamageModifierExtension, CompProperties_DamageModifier, and HediffCompProperties_DamageModifier))
I opted to not absorb most of the stuff in the Damage Modification page mostly due to its tangled nature in the code. Certain parts of that code already have a more simplified EBSG variant available, and another part of it is implemented within the Damage Modifying Stats Extension.
For those who have been using fleshTypes or factionDef as a way to single out humanlikes, insectoids, mechanoids, or entities, this framework already has a more simplified version of that in Stats. The Damage Stats section applies to the pawns themselves and can be used anywhere those types of stats can be used (i.e. traits, genes, hediffs, etc), and the Stats for non-pawn things contains stats you can add to weapons
For those using the DamageModificator for only stat multiplying damage stuff, the Damage Modifying Stats Extension will probably work about the same as DamageModificator, though due to the differences between how Smartkar and I handled the concept your existing xml will need to be rewritten
Changes:
- AthenaFramework.CompProperties_EquippableAbility => EBSGFramework.CompProperties_EquippableAbility
New Stuff:
- saveCooldown : Default (True) : While True, the comp will try to ensure that the cooldown of the ability is not reset when the equipment is put down and picked back up. You can set this to False if you do intend for the cooldown to reset each time
- saveCharges : Default (True) : While True, the comp will try to ensure that the ability given to the pawn has the same number of charges as when it was dropped. This does NOT work with the charges in Reloadable Abilities, so if you're looking for refuelable charges in your equipment's ability, I recommend sticking with vanilla's CompProperties_EquippableAbilityReloadable
Explode on Removal (Replaces Bomb Hediff Comp)
Changes:
- AthenaFramework.HediffCompProperties_Bomb => EBSGFramework.HediffCompProperties_ExplodeOnRemoval
- explodeOnDeath => allowDead
- gasType => extraGasType
- BlindSmoke => Smoke
- ToxGas => Tox
- RotStink => Rot
Removed:
- explodeOnRemoval (If you only wanted to have it activate on death, switch your comp properties to EBSGFramework.HediffCompProperties_ExplodeOnDeath)
- gasExplosion : The GasType is handled differently, removing the need for this
Added:
-
statRadius : The StatDef to use to determine the explosion size
-
multiplyRadiusBySeverity : Default (False) : Multiplies the radius whatever the current severity is. Works with both radius and statRadius
-
multiplyDamageBySeverity : Default (False) : Multiplies the damage amount by the severity. If True, then damageAmount must be filled in to avoid errors, even if the amount you put in is a copy paste of the DamageDef's default
-
damageFalloff : Default (False) : When true, the damage amount decreases the further they are from the center
-
chanceToStartFire : Default (0) : Chance to try to catch flammable things on fire
-
exclusions : Default (Self) : Determines what gets excluded from the explosion damage. The options are None, Self, Allies, and NonHostiles
-
validSeverities : Default (0~9999) : The range of seventies that the hediff needs to be in for the explosion to occur. If a single number is input instead of a range, then the severity must be above that number
-
explosionSound - The sound the explosion makes
-
postExplosionThingWater : Creates thing over water when the explosion overlaps with water
-
screenShakeFactor : Default (0) : Shake that screen
-
postExplosionThing : The ThingDef that is generated after explosion
-
postExplosionThingChance : Default (0) : The chances of the thing being created, with 1 being 100%
-
postExplosionSpawnThingCount : Default (1) : Number of things created
-
preExplosionThing : The ThingDef that is generated before the explosion
-
preExplosionThingChance : Default (0) : The chances of the thing being created, with 1 being 100%
-
preExplosionSpawnThingCount : Default (1) : Number of things created
Changes:
- AthenaFramework.CompProperties_HediffOnDamage => EBSGFramework.CompProperties_HediffOnDamage
- whitelistedDamageDefs => validDamageDefs
- blacklistedDamageDefs => ignoredDamageDefs
New Stuff:
- initialSeverity : Default (1) : The initial severity of the hediff that is added. If severityPerDamage is used, this will be ignored
- severityIncrease : Default (1) : The severity to add to an existing hediff. If severityPerDamage is used, this will be ignored
Launch Projectile Burst (AKA Burst Projectile Abilities)
Changes:
- AthenaFramework.CompProperties_AbilityLaunchProjectileBurst => EBSGFramework.CompProperties_AbilityLaunchProjectileBurst
- Fixed the comp being unable to target locations
- Fixed the comp having issues saving target. Not sure if it was an issue a lot of people were encountering, but it was one I was having
Added:
- immediateLaunch : Default (True) : Sets whether the first shot occurs immediately after the warmup is finished, or after one ticksBetweenShots interval has passed
Changes:
-
AthenaFramework.HediffCompProperties_Modular => EBSGFramework.HediffCompProperties_Modular
-
AthenaFramework.CompUsable_HediffModule => EBSGFramework.CompUsable_HediffModule
-
AthenaFramework.CompProperties_UseEffectHediffModule => EBSGFramework.CompProperties_UseEffectHediffModule
- requiredCapacity should be able to handle negative values properly now
-
AthenaFramework.Hediff_Modular => EBSGFramework.Hediff_Modular
-
AthenaFramework.Hediff_ModularAddedPart => EBSGFramework.Hediff_ModularAddedPart
-
AthenaFramework.Hediff_ModularImplant => EBSGFramework.Hediff_ModularImplant
-
Athena_InstallModule => EBSG_InstallItem
- The job should also properly display the name of what is being installed now
-
statFactors => statFactorOffsets
- statFactorOffsets will also now properly add factors to the stage if they don't already exist
- statOffsets also received this fix
- statFactorOffsets will also now properly add factors to the stage if they don't already exist
Added:
- stageOverlays has gained two new things, both of which are more stat stuff that are set up the same as statFactors and statOffsets. Both of the occur before the offsets for the current StageOverlay
- statFactors : statFactors now multiplies existing factors instead of adding to them
- statOffsetFactors : Multiplies existing statOffsets
Removed:
- additionalGraphics : Render nodes are a more ideal way of rendering things
Changes:
- AthenaFramework.CompProperties_ProjectileImpactEffect => EBSGFramework.CompProperties_ProjectileImpactEffect
Projectile Trails (aka CompProperties_ProjectileTrail)
This will not be ported into EBSG Framework because vanilla Rimworld code already has stuff for it, namely:
- CompProperties_ProjectileEffecter
- CompProperties_MoteEmitter
Changes:
-
AthenaFramework.Verb_RandomShot => EBSGFramework.Verb_RandomShot
-
AthenaFramework.RandomShotExtension => EBSGFramework.RandomShotExtension
-
projectiles technically had two changes, but the way you want to manage them is up to you.
- Simple update : probability => weight
- Slightly more involved update :
<projectiles>
<li>
<projectile>ProjectileDefName</projectile>
<probability>1</probability>
</li>
</projectiles>
=>
<projectiles>
<ProjectileDefName>1</ProjectileDefName>
</projectiles>
Changes:
- AthenaFramework.CompProperties_AbilityReloadable => EBSGFramework.CompProperties_AbilityReloadable
New Stuff
- disableAutoSearch : Default (False) : Prevents the job from making pawns automatically reload this ability. Generally only recommended if the ammoDef is something rare or valuable that has other purposes beyond reloading abilities
- remainingCharges : Default (ChargesRemaining) : The string used to tell the user how many charges remain
Remove at Severities (Replaces Remove on Severity Comp)
Changes:
- AthenaFramework.HediffCompProperties_RemoveOnSeverity => EBSGFramework.HediffCompProperties_RemoveAtSeverities
Added:
- severity can now accept a range of severities (i.e. 1~2). If you only want it to remove when severity is any value over the one you specify, just leave it as a singular value
- severities : A list of float ranges that can each remove the hediff. If any of them only have a single number input, then any severity higher than that will delete the hediff
Shield Equipment (Replacement for Advanced Equipment Shields)
Changes:
-
AthenaFramework.CompProperties_ShieldEquipment => EBSGFramework.CompProperties_ShieldEquipment
-
consumeOverdamage => reduceDamagePostDestroy
-
energyPerDamageModifier : This technically hasn't changed, but the alterations to how energy max and recharge are set (see Removed) mean you should still test out your shield to be sure this is working as expected. You will likely need to make your values 1% of their current values
-
damageInfoPacks had changes to the names of things inside it to hopefully make it easier to use. The melee/ranged/explosions stuff also acts differently. Instead of replacing the standard checks the comp makes, they determine when the factor applies to the energy cost. If the factor is set to a value below 0, then the damage pack will cause the shield to ignore the damage completely, resulting in the pawn getting damaged without the shield losing energy. Also fixed the bug where the factor never impacted energy loss
- energyModifier => factor
- blocksRangedDamage => ranged
- blocksExplosions => explosions
- blocksMeleeDamage => melee
-
whitelistedDamageDefs => blockedDamageDefs
-
blacklistedDamageDefs => ignoredDamageDefs
-
explosionDef
-
explosionRadius
- The explosion code has been revamped to be more flexible. The new equivalent will look similar to below
<shieldBreakExplosion>
<damageDef>EMP</damageDef>
<radius>3.9</radius>
</shieldBreakExplosion>
Added:
- immuneDamageDefs : A list of DamageDefs that can be blocked by the shield, and won't cause energy loss when blocked
- onlyBlockWhileDraftedOrHostile : Default (False) : Causes the shield to only block things if the pawn has attacked in the last 1000 ticks, is drafted, or has a hostile mental state
- shatterSound : SoundDef played when the shield shatters
- shieldBreakExplosion has a bunch of options for explosions that were not mentioned in the changes section, and due to how many there are I recommend taking a look at the Shield Equipment if you are interested. Alternatively, the explode on removal (or hediff bomb comp) replacement on this page also lists them all
- noDisplay : Default (False) : Prevents the shield bubble from appearing. This will cause graphicData to be ignored and prevent the vanilla shield appearance
Removed:
- explosionOnShieldBreak : Code automatically checks this for you now
- maxEnergy : I don't know why he made this part of the comp as there is something already in vanilla's statBases that is intended for this exact purpose. If needed, have a look at the Shield Equipment for an example
- EnergyShieldEnergyMax : Add this to statBases with a value equal to maxEnergy / 100. The amount players see will be the amount you used to have for maxEnergy. This should act the exact same as maxEnergy does
- energyRechargeRate : See maxEnergy
- EnergyShieldRechargeRate : Add this to statBases with a value equal to energyRechargeRate * 0.6. This should act the exact same as energyRechargeRate does
- All CompProperties_AdditionalApparelGraphics stuff not mentioned on the Shield Equipment page are gone
Changes:
-
AthenaFramework.HediffCompProperties_Shield => EBSGFramework.HediffCompProperties_Shield
-
consumeOverdamage => reduceDamagePostDestroy
-
energyPerDamageModifier : This technically hasn't changed, but the alterations to how energy max and recharge are set (see Removed) mean you should still test out your shield to be sure this is working as expected. You will likely need to make your values 1% of their current values
-
affectedByStats : Defaults to False instead of True
-
damageInfoPacks had changes to the names of things inside it to hopefully make it easier to use. The melee/ranged/explosions stuff also acts differently. Instead of replacing the standard checks the comp makes, they determine when the factor applies to the energy cost. If the factor is set to a value below 0, then the damage pack will cause the shield to ignore the damage completely, resulting in the pawn getting damaged without the shield losing energy. Also fixed the bug where the factor never impacted energy loss
- energyModifier => factor
- blocksRangedDamage => ranged
- blocksExplosions => explosions
- blocksMeleeDamage => melee
-
whitelistedDamageDefs => blockedDamageDefs
-
blacklistedDamageDefs => ignoredDamageDefs
-
explosionDef
-
explosionRadius
- The explosion code has been revamped to be more flexible. The new equivalent will look similar to below
<shieldBreakExplosion>
<damageDef>EMP</damageDef>
<radius>3.9</radius>
<extraGasType>None</extraGasType>
</shieldBreakExplosion>
Added:
- immuneDamageDefs : A list of DamageDefs that can be blocked by the shield, and won't cause energy loss when blocked
- onlyBlockWhileDraftedOrHostile : Default (False) : Causes the shield to only block things if the pawn has attacked in the last 1000 ticks, is drafted, or has a hostile mental state
- shatterSound : SoundDef played when the shield shatters
- shieldBreakExplosion has a bunch of options for explosions that were not mentioned in the changes section, and due to how many there are I recommend taking a look at the Shield Equipment if you are interested. Alternatively, the explode on removal (or hediff bomb comp) replacement on this page also lists them all
- noDisplay : Default (False) : Prevents the shield bubble from appearing. This will cause graphicData to be ignored and prevent the vanilla shield appearance
- blocksRangedWeapons : Default (False) : While True, the pawn becomes unable to launch projectiles
Removed:
- explosionOnShieldBreak : Code automatically checks this for you now
- maxEnergy : I don't know why he made this part of the comp as there is something already in vanilla's statBases that is intended for this exact purpose. If needed, have a look at the Shield Equipment for an example
- EnergyShieldEnergyMax : Add this to statBases with a value equal to maxEnergy / 100. The amount players see will be the amount you used to have for maxEnergy. This should act the exact same as maxEnergy does
- energyRechargeRate : See maxEnergy
- EnergyShieldRechargeRate : Add this to statBases with a value equal to energyRechargeRate * 0.6. This should act the exact same as energyRechargeRate does
- All Renderable Hediff stuff not mentioned on the Shield Hediff page are gone
Shockwave Ability (CompProperties_AbilityShockwave for those using ctrl + f to find things on this page)
This comp was not transferred because this framework has more advanced versions of the same concept already available for use, though switching to those probably requires editing some tags:
- Blast Attacks cause an explosion at the target
- Burst Attacks causes an explosion around the caster regardless of target
- Spew creates a cone effect similar to fire spew with a customizable angle
Changes:
- Athena_Metabolism => EBSG_HungerRateFactor
- Athena_SkillLoss => EBSG_SkillLossRate
Changes:
- AthenaFramework.TurretRoofBlocked => EBSGFramework.TurretRoofBlocked