[Client] Script Error #1: lua/LiveMixin.lua
Katzenfleisch
Join Date: 2014-03-21 Member: 194881Members, Squad Five Blue, Squad Five Silver, NS2 Community Developer
in Modding
Hi,
I got an error on liveMixin.lua with self.timeLastHealed. This variable is correctly initialized Server side but not client side on the _initmixin function. I think it's that but can't be 100% sure the issue come from LiveMixin.
.
I got an error on liveMixin.lua with self.timeLastHealed. This variable is correctly initialized Server side but not client side on the _initmixin function. I think it's that but can't be 100% sure the issue come from LiveMixin.
.
[Client] Script Error #1: lua/LiveMixin.lua:74: attempt to perform arithmetic on field 'timeLastHealed' (a nil value)
#1: GetSyncHealth lua/LiveMixin.lua:74
self = LayFlameMines-996 {animationBlend=0, animationGraphIndex=0, animationGraphNode=-1, animationSequence2=-1, animationSequence=-1, animationSpeed2=1, animationSpeed=1, animationStart2=0, animationStart=0, collisionRep=0, droppingMine=false, expireTime=838, isHolstered=true, layer1AnimationBlend=0, layer1AnimationGraphNode=-1, layer1AnimationSequence2=-1, layer1AnimationSequence=-1, layer1AnimationSpeed2=1, layer1AnimationSpeed=1, layer1AnimationStart2=0, layer1AnimationStart=0, locationId=8, minesLeft=2, modelIndex=200, physicsGroup=16, physicsGroupFilterMask=524400, physicsType=3, primaryAttacking=false, secondaryAttacking=false, teamNumber=1, techId=3, weaponWorldState=true }
#1: GetSyncHealth lua/LiveMixin.lua:74
self = LayFlameMines-996 {animationBlend=0, animationGraphIndex=0, animationGraphNode=-1, animationSequence2=-1, animationSequence=-1, animationSpeed2=1, animationSpeed=1, animationStart2=0, animationStart=0, collisionRep=0, droppingMine=false, expireTime=838, isHolstered=true, layer1AnimationBlend=0, layer1AnimationGraphNode=-1, layer1AnimationSequence2=-1, layer1AnimationSequence=-1, layer1AnimationSpeed2=1, layer1AnimationSpeed=1, layer1AnimationStart2=0, layer1AnimationStart=0, locationId=8, minesLeft=2, modelIndex=200, physicsGroup=16, physicsGroupFilterMask=524400, physicsType=3, primaryAttacking=false, secondaryAttacking=false, teamNumber=1, techId=3, weaponWorldState=true }
local function GetSyncHealth(self)
return self.syncHealth or self.timeLastHealed + kSynchronizeDelay > Shared.GetTime()
end
function LiveMixin:__initmixin()
[...]
if Server then
self.lastDamageAttackerId = Entity.invalidId
self.timeLastCombatAction = 0
self.timeLastHealed = 0
self.syncHealth = false
self.timeSyncHealthEnabled = -kSynchronizeDelay
elseif Client then
self.healthClient = self.health
self.armorClient = self.armor
self.clientTimeLastHealed = self.timeLastHealed
end
Comments