Build 189 Alien armor evolve bug fix
BobLOLness
Join Date: 2011-12-07 Member: 136950Members
in Modding
<b>Note: This is a server side bugfix.</b>
There is currently a bug with alien armor that occurs in the following situation:
1) The alien commander has researched armor upgrades.
2) As an alien you evolve to another lifeform or evolve an upgrade.
The bug causes you to have your armor set to the max possible armor level of the lifeform, but without the upgrade applied. Meaning that after coming out of the egg you have to heal at hive,crag or gorge to get to your max armor level with upgrades. In the case of evolving upgrades it means you could have full armor and you will actually have your armor reduced after coming out the egg.
Here the fix
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->--- Embryo.lua Wed Dec 07 17:33:46 2011
+++ Embryo.lua Thu Dec 08 15:44:25 2011
@@ -206,7 +206,7 @@
end
newPlayer:SetHealth( self.healthScalar * LookupTechData(self.gestationTypeTechId, kTechDataMaxHealth) )
- newPlayer:SetArmor( self.armorScalar * LookupTechData(self.gestationTypeTechId, kTechDataMaxArmor) )
+ newPlayer:SetArmor( self.armorScalar * newPlayer:GetArmorAmount())
// Return false so that we don't get called again if the server time step
// was larger than the callback interval<!--c2--></div><!--ec2-->
For reference here is what happens to your armor in different situations before and after patch:
BEFORE
Evolving to new lifeforms sets armor to the max armor for that lifeform excluding armor upgrades.
Evolving upgrades keeps the percentage armor you had, but is applied to the max armor of lifeform without armor upgrades.
AFTER
Evolving to different lifeforms sets armor to max armor for that lifeform + armor upgrades.
Evolving upgrades keeps the percentage armor amount you had when you clicked evolve.
Extra fun fact, damage to egg has no effect on the health or armor of the lifeform after hatching.
There is currently a bug with alien armor that occurs in the following situation:
1) The alien commander has researched armor upgrades.
2) As an alien you evolve to another lifeform or evolve an upgrade.
The bug causes you to have your armor set to the max possible armor level of the lifeform, but without the upgrade applied. Meaning that after coming out of the egg you have to heal at hive,crag or gorge to get to your max armor level with upgrades. In the case of evolving upgrades it means you could have full armor and you will actually have your armor reduced after coming out the egg.
Here the fix
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->--- Embryo.lua Wed Dec 07 17:33:46 2011
+++ Embryo.lua Thu Dec 08 15:44:25 2011
@@ -206,7 +206,7 @@
end
newPlayer:SetHealth( self.healthScalar * LookupTechData(self.gestationTypeTechId, kTechDataMaxHealth) )
- newPlayer:SetArmor( self.armorScalar * LookupTechData(self.gestationTypeTechId, kTechDataMaxArmor) )
+ newPlayer:SetArmor( self.armorScalar * newPlayer:GetArmorAmount())
// Return false so that we don't get called again if the server time step
// was larger than the callback interval<!--c2--></div><!--ec2-->
For reference here is what happens to your armor in different situations before and after patch:
BEFORE
Evolving to new lifeforms sets armor to the max armor for that lifeform excluding armor upgrades.
Evolving upgrades keeps the percentage armor you had, but is applied to the max armor of lifeform without armor upgrades.
AFTER
Evolving to different lifeforms sets armor to max armor for that lifeform + armor upgrades.
Evolving upgrades keeps the percentage armor amount you had when you clicked evolve.
Extra fun fact, damage to egg has no effect on the health or armor of the lifeform after hatching.
Comments
also that just looks like a change log not a fix
YES!
Nice done BobLOLness...so simple?
Anyway i hate always running back to hive or search for a gorge...or maybe get killed (happend never, after i notice, i have just to hide :P )
in future the alien armor upgrades will be different: for each hive you have you get armor1 - armor3. those passive upgrades will not increase your armor values, but increase their effectiveness: armor1 translates 1:2 HP:AP, armor2: 1:3 etc. that change has been made since we also unlocked carapace and didn't want that the upgrades overlap. so that new armor upgrades are actually the same as in ns1, except that they will be shown in the buy menu instead of being entirely hidden
back to your bug fix: i made a similar change as you did here when setting the armor after evolving / ejecting from hive with the carapace upgrade. so that annoying bug we had before (evolving and need to heal up afterwards...) is finally gone ;)
Sorry but i don't understand.
You said "not increase your armor values" but you said HP:AP = 1:2 so it will double, right? or did you mean don't increase your HP values?
Or did you mean that with armor 1 passive upgrade, the aliens take half of the damage, like 50% instead of 100% damage?
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->kBaseArmorAbsorption = 0.7
kHealthPointsPerArmor = 2
...
// Damage types
kHealthPointsPerArmorLight = 4
kHealthPointsPerArmorHeavy = 1
kPuncturePlayerDamageScalar = 1.5
kStructuralDamageScalar = 2<!--c2--></div><!--ec2-->
The damage scalars are easy enough to understand, but the HealthPointsPerArmor aren't quite so intuitious. So let's pretend a lerk hits a 100/90 marine for 100 light damage. What will the marine end up having left? As long as we have armor, 70% of the damage is reduced, so we will take 70 damage? Then, we have the two HPA modifiers, supposedly they are multiplicative? So for each 8 health taken, one armor is reduced? If this is how it works, then you end up with 30 health and 82 armor. Can't be right.
And the khealthpointsperarmor is the normal damage : khealthpointsperarmor==khealthpointsperarmornormal
LightDMG: 4 light DMG hits reduce armor by 1
NormalDMG: 2 normalDMG hits reduce armor by 1
HeavyDMG: 1 heavyDMG hits reduces armor by 1
I even said that 70% of damage was reduced, next sentence I had messed that up.. fail :P