Spider Queen makes babies at wrong angles


Tykvesh
  • Pending

There appear to be a couple of miscalculations at MakeBaby:

Quote

local function MakeBaby(inst)
  --local angle = inst.Transform:GetRotation() / DEGREES
    local angle = (inst.Transform:GetRotation() + 180) * DEGREES
    local prefab = inst.components.combat:HasTarget() and math.random() < .333 and "spider_warrior" or "spider"
    local spider = inst.components.lootdropper:SpawnLootPrefab(prefab)
    if spider ~= nil then
        local rad = spider:GetPhysicsRadius(0) + inst:GetPhysicsRadius(0) + .25
        local x, y, z = inst.Transform:GetWorldPosition()
      --spider.Transform:SetPosition(x + rad * math.cos(angle), 0, z + rad * math.sin(angle))
        spider.Transform:SetPosition(x + rad * math.cos(angle), 0, z - rad * math.sin(angle))

Since the animation has no faces, this doesn't fully get rid of the issue, but at least the offset will be consistent with her rotation.

P.S. This part of her poop stategraph is not necessary for dedicated servers as it always rotates her to 0.7853975:

Quote

State{
    name = "poop_pre",
    tags = {"busy", "nointerrupt"},

    onenter = function(inst, cb)
        inst.Physics:Stop()
        inst.components.locomotor:Stop()
        local angle = TheCamera:GetHeadingTarget()*DEGREES -- -22.5*DEGREES
        inst.Transform:SetRotation(angle / DEGREES)


Steps to Reproduce

:snarlingspider:

Spoiler

1435784398_Yourrewardwillbegreat.png.b393e1ce64b626c03055879558272abd.png

1856496597_GIF14-Jun-2113-23-04.gif.abb068023fffb83e0ec4788401acfe20.gif

Whoopsie.png.e5845d8ce08ba87981b72eed9d1c19e1.png

1689628304_GIF14-Jun-2113-27-03.gif.85cbe5c0828065941a8c7006d36b10e3.gif

  • Like 6


User Feedback




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