Jump to content

grogginess crash


xiaochency
  • Pending
Quote

[string "scripts/components/grogginess.lua"]:62: attempt to index local 'self' (a nil value)
LUA ERROR stack traceback:
scripts/components/grogginess.lua:62 in (field) whilegroggyfn (Lua) <59-67>
   inst = 121191 - wolfgang (valid:true)
   self = nil
scripts/components/grogginess.lua:278 in (method) OnUpdate (Lua) <254-280>
   self =
      _resistance_sources = table: 0x37df4de0
      knockouttestfn = function - scripts/prefabs/player_common_extensions.lua:12
      enablespeedmod = true
      knockoutduration = 6
      inst = 121191 - wolfgang (valid:true)
      knockouttime = 0.60000003129244
      grog_amount = 2.9
      resistance = 3
      cometotestfn = function - scripts/components/grogginess.lua:54
      speedmodmult = 1
      wearofftime = 0
      onwearofffn = function - scripts/components/grogginess.lua:79
      speedmod = 0.4
      whilewearingofffn = function - scripts/components/grogginess.lua:69
      decayrate = 0.01
      wearoffduration = 0.5
      isgroggy = true
      whilegroggyfn = function - scripts/components/grogginess.lua:59
      knockedout = true
   dt = 0.033333335071802
scripts/update.lua:262 in () ? (Lua) <224-298>
   dt = 0.033333335071802
   tick = 2739
   k = 121191
   v = 121191 - wolfgang (valid:true)
   cmp = table: 0x37df4db0

[00:02:13]: [string "scripts/components/grogginess.lua"]:62: attempt to index local 'self' (a nil value)
LUA ERROR stack traceback:
    scripts/components/grogginess.lua:62 in (field) whilegroggyfn (Lua) <59-67>
    scripts/components/grogginess.lua:278 in (method) OnUpdate (Lua) <254-280>
    scripts/update.lua:262 in () ? (Lua) <224-298>

Quote

function DefaultWhileWearingOff(inst)
    --assume wearofftime > 0
    local self = inst.components.grogginess
    local pct = self.wearofftime < self.wearoffduration and easing.inQuad(self.wearofftime / self.wearoffduration, 0, 1, 1) or 1
    self.speedmod = Remap(pct, 0, 1, TUNING.MAX_GROGGY_SPEED_MOD, 1)
    if self.enablespeedmod then
        inst.components.locomotor:SetExternalSpeedMultiplier(inst, "grogginess", self.speedmod * self.speedmodmult)
    end
end

 


Steps to Reproduce
Quote

local function do_summon_spawn(inst)
    local player_in_range = false
    local ix, _, iz = inst.Transform:GetWorldPosition()
    for i, p in ipairs(AllPlayers) do
        local dsq_to_player = p:GetDistanceSqToPoint(ix, 0, iz)
        if dsq_to_player < TUNING.ALTERGUARDIAN_PHASE3_SUMMONRSQ then
            -- Don't count ghosts, and don't "sleep-camp" players that are knocked out.
            if (p.components.grogginess ~= nil and not p.components.grogginess:IsKnockedOut())
                    and not p:HasTag("playerghost") then
                player_in_range = true

                local spawn_prefab = (math.random() < 0.4 and "largeguard_alterguardian_projectile") or "gestalt_alterguardian_projectile"
                local gestalt = SpawnPrefab(spawn_prefab)

                local px, py, pz = p.Transform:GetWorldPosition()

                local radius = GetRandomMinMax(3, 5)
                local angle = (inst:GetAngleToPoint(px, py, pz) + GetRandomMinMax(-90, 90)) * DEGREES
                gestalt.Transform:SetPosition(
                    px + radius * math.cos(angle),
                    py,
                    pz + radius * -math.sin(angle)
                )
                gestalt:ForceFacePoint(px, py, pz)
                gestalt:SetTargetPosition(Vector3(px, py, pz))
            end
        end
    end

    if not player_in_range then
        inst.sg.statemem.ready_to_finish = true
    end
end

在天体英雄三阶段召唤水晶时,击中玩家时,触发服务器崩溃。
When a alterguardian_phase3 summons a crystal in the third stage, hitting the player triggers a server crash.
以下临时方案是否有效?
Are the following interim solutions effective?
 

Quote

function DefaultWhileGroggy(inst)
    --assume grog_amount > 0
    local self = inst.components.grogginess
    if self then
        local pct = self.grog_amount < self:GetResistance() and self.grog_amount / self:GetResistance() or 1
        self.speedmod = Remap(pct, 1, 0, TUNING.MIN_GROGGY_SPEED_MOD, TUNING.MAX_GROGGY_SPEED_MOD)
        if self.enablespeedmod then
            inst.components.locomotor:SetExternalSpeedMultiplier(inst, "grogginess", self.speedmod * self.speedmodmult)
        end
    end
end

 




User Feedback


There are no comments to display.



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...