Effects 'nil' for footsteps on metal
Soul_Rider
Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue
I have an issue where I get errors in the log everytime I move. (Yes, I have finally got enough code working to get me to the ready room, woohoo). Here is the log:
Player is confirming the correct material, but GameEffectsMixin tells me there is no effect for this. I have compared this to vanilla NS2 and cannot see any changes between these two functions, so I think I have messed up somewhere else. Any advice anyone can give?
Here is the kSurfaceList from globals.lua:
Here is the get material below player function:
And the mixin code:
The precache of the events is done in EffectManager.lua in the local function:
I'll let you read the whole function, it's a bit long to be posting in here..
edit - spelling
[Predict] Script Error #1: lua/GameEffectsMixin.lua:35: bad argument #2 to 'band' (number expected, got nil) Call stack: #1: band [C]:-1 #2: GetGameEffectMask lua/GameEffectsMixin.lua:35 self = ReadyRoomPlayer-3806 {activeWeaponId=-1, alive=true, animateAngles=false, animateDistance=false, animatePosition=false, animateYOffset=false, animationBlend=0.19999998807907, animationGraphIndex=2, animationGraphNode=14, animationSequence2=0, animationSequence=1, animationSpeed2=1, animationSpeed=1, animationStart2=60.58984375, animationStart=102.78125, armor=0, baseYaw=0, bodyYaw=0, bodyYawRun=0, cameraDistance=0, clientIndex=1, collisionRep=0, communicationStatus=1, countingDown=false, darwinMode=false, desiredCameraAngles=cdata, desiredCameraDistance=0, desiredCameraPosition=cdata, desiredCameraYOffset=0, followingTransition=false, fov=90, frozen=false, fullPrecisionOrigin=cdata, gameEffectsFlags=0, gameStarted=false, giveDamageTime=0, health=100, healthIgnored=false, isMale=true, isMoveBlocked=false, isOnEntity=false, isUsing=false, jumpHandled=false, jumping=false, layer1AnimationBlend=0, layer1AnimationGraphNode=134, layer1AnimationSequence2=-1, layer1AnimationSequence=-1, layer1AnimationSpeed2=1, layer1AnimationSpeed=1, layer1AnimationStart2=0, layer1AnimationStart=0, locationId=1, maxArmor=0, maxHealth=100, mode=1, modeTime=-1, modelIndex=12, moveButtonPressed=true, moveTransition=false, onGround=true, physicsGroup=8, physicsGroupFilterMask=0, physicsType=1, playerLevel=0, playerSkill=129, primaryAttackLastFrame=false, processMove=true, pushImpulse=cdata, pushTime=0, quickSwitchSlot=1, reinforcedTierNum=0, resetMouse=0, runningBodyYaw=6.0274863243103, secondaryAttackLastFrame=false, shoulderPadIndex=0, slowAmount=0, standingBodyYaw=6.0274863243103, startCameraAngles=cdata, startCameraDistance=0, startCameraPosition=cdata, startCameraYOffset=0, stepAmount=0.010000000707805, stepStartTime=60.55078125, syncHealth=false, teamNumber=0, techId=43, timeGroundAllowed=0, timeGroundTouched=0, timeLastHealed=0, timeLastMenu=0, timeOfLastJump=0, timeOfLastUse=0, timeOfLastWeaponSwitch=0, transitionDuration=0, transitionStart=0, tweeningFunction=1, upgrade1=1, upgrade2=1, upgrade3=1, upgrade4=1, upgrade5=1, upgrade6=1, variant=2, velocity=cdata, velocityLength=5, velocityPitch=0, velocityYaw=1.8268841505051, viewModelId=452, viewPitch=0.10718854516745, viewRoll=0, viewYaw=6.0274863243103, weaponsWeight=0 } effect = nil #3: GetMaterialBelowPlayer lua/Player.lua:1759 self = ReadyRoomPlayer-3806 {activeWeaponId=-1, alive=true, animateAngles=false, animateDistance=false, animatePosition=false, animateYOffset=false, animationBlend=0.19999998807907, animationGraphIndex=2, animationGraphNode=14, animationSequence2=0, animationSequence=1, animationSpeed2=1, animationSpeed=1, animationStart2=60.58984375, animationStart=102.78125, armor=0, baseYaw=0, bodyYaw=0, bodyYawRun=0, cameraDistance=0, clientIndex=1, collisionRep=0, communicationStatus=1, countingDown=false, darwinMode=false, desiredCameraAngles=cdata, desiredCameraDistance=0, desiredCameraPosition=cdata, desiredCameraYOffset=0, followingTransition=false, fov=90, frozen=false, fullPrecisionOrigin=cdata, gameEffectsFlags=0, gameStarted=false, giveDamageTime=0, health=100, healthIgnored=false, isMale=true, isMoveBlocked=false, isOnEntity=false, isUsing=false, jumpHandled=false, jumping=false, layer1AnimationBlend=0, layer1AnimationGraphNode=134, layer1AnimationSequence2=-1, layer1AnimationSequence=-1, layer1AnimationSpeed2=1, layer1AnimationSpeed=1, layer1AnimationStart2=0, layer1AnimationStart=0, locationId=1, maxArmor=0, maxHealth=100, mode=1, modeTime=-1, modelIndex=12, moveButtonPressed=true, moveTransition=false, onGround=true, physicsGroup=8, physicsGroupFilterMask=0, physicsType=1, playerLevel=0, playerSkill=129, primaryAttackLastFrame=false, processMove=true, pushImpulse=cdata, pushTime=0, quickSwitchSlot=1, reinforcedTierNum=0, resetMouse=0, runningBodyYaw=6.0274863243103, secondaryAttackLastFrame=false, shoulderPadIndex=0, slowAmount=0, standingBodyYaw=6.0274863243103, startCameraAngles=cdata, startCameraDistance=0, startCameraPosition=cdata, startCameraYOffset=0, stepAmount=0.010000000707805, stepStartTime=60.55078125, syncHealth=false, teamNumber=0, techId=43, timeGroundAllowed=0, timeGroundTouched=0, timeLastHealed=0, timeLastMenu=0, timeOfLastJump=0, timeOfLastUse=0, timeOfLastWeaponSwitch=0, transitionDuration=0, transitionStart=0, tweeningFunction=1, upgrade1=1, upgrade2=1, upgrade3=1, upgrade4=1, upgrade5=1, upgrade6=1, variant=2, velocity=cdata, velocityLength=5, velocityPitch=0, velocityYaw=1.8268841505051, viewModelId=452, viewPitch=0.10718854516745, viewRoll=0, viewYaw=6.0274863243103, weaponsWeight=0 } fixedOrigin = cdata trace = cdata material = "metal"
Player is confirming the correct material, but GameEffectsMixin tells me there is no effect for this. I have compared this to vanilla NS2 and cannot see any changes between these two functions, so I think I have messed up somewhere else. Any advice anyone can give?
Here is the kSurfaceList from globals.lua:
// Surface list. Add more materials here to precache ricochets, bashes, footsteps, etc // Used with PrecacheMultipleAssets kSurfaceList = { "electronic", "metal", "rock", "thin_metal", "armor", "flame", "glass" }
Here is the get material below player function:
function Player:GetMaterialBelowPlayer() local fixedOrigin = Vector(self:GetOrigin()) // Start the trace a bit above the very bottom of the origin because // of cases where a large velocity has pushed the origin below the // surface the player is on fixedOrigin.y = fixedOrigin.y + self:GetExtents().y / 2 local trace = Shared.TraceRay(fixedOrigin, fixedOrigin + Vector(0, -(2.5*self:GetExtents().y + .1), 0), CollisionRep.Move, PhysicsMask.AllButPCs, EntityFilterOne(self)) local material = trace.surface // Default to metal if no surface material is found. if not material or string.len(material) == 0 then material = "metal" end // Have squishy footsteps on infestation if self:GetGameEffectMask(kGameEffect.OnInfestation) then material = "organic" end return material end
And the mixin code:
function GameEffectsMixin:GetGameEffectMask(effect) return bit.band(self.gameEffectsFlags, effect) ~= 0 end
The precache of the events is done in EffectManager.lua in the local function:
local function InternalPrecacheEffectTable(self, globalEffectTable)
I'll let you read the whole function, it's a bit long to be posting in here..
edit - spelling
Comments