[Client] Script Error #1: lua/LiveMixin.lua

KatzenfleischKatzenfleisch Join Date: 2014-03-21 Member: 194881Members, Squad Five Blue, Squad Five Silver, NS2 Community Developer
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.
.
[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 }

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

  • GhoulofGSG9GhoulofGSG9 Join Date: 2013-03-31 Member: 184566Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Supporter, WC 2013 - Supporter, Pistachionauts
    edited June 2015
    That LiveMixin differs from the ns2 vanilla version. I remember seeing a similar issue with LayMines before some builds ago. Basically the issue seems to be that timeLastHealed isn't networked fast enough.
  • KatzenfleischKatzenfleisch Join Date: 2014-03-21 Member: 194881Members, Squad Five Blue, Squad Five Silver, NS2 Community Developer
    I understand but it's strange, this code came directly from my "C:\Program Files (x86)\SteamDir\steamapps\common\Natural Selection 2\ns2\lua" directory and is a copy&past.

Sign In or Register to comment.