Jump to content

Tallbirds kill Smallbirds hatched from nests due to an oversight in retarget function


hoxi
  • Pending

In tallbird.lua, in the following function:

local function Retarget(inst)
    local function IsValidTarget(guy)
        return not guy.components.health:IsDead()
            and inst.components.combat:CanTarget(guy)
            --smallbirds that aren't companions are parented
            --to other tallbirds, so don't target them!
            and (not inst:HasTag("smallbird") or inst:HasTag("companion")) -- ISSUE HERE
    end

The highlighted line should be:

and (not guy:HasTag("smallbird") or guy:HasTag("companion"))

This would cause the function to check the potential target, as intended, instead of the Tallbird, which is why the check always fails on Smallbirds and causes them to be targeted regardless if they were hatched from a nest or not.

Also I want to suggest to maybe change the local guy to target or similar to make it more clear? I wouldn't be surprised if that's the reason this went under the radar for so long.

Also, this function in smallbird.lua might need to be modified:

local function SpawnTeen(inst)
    --print("smallbird - SpawnTeen")

    local teenbird = SpawnPrefab("teenbird")
    teenbird.Transform:SetPosition(inst.Transform:GetWorldPosition())
    teenbird.sg:GoToState("idle")

    if inst.components.follower.leader then
        teenbird.components.follower:SetLeader(inst.components.follower.leader)
    end

    inst:Remove()
end

To:

local function SpawnTeen(inst)
    --print("smallbird - SpawnTeen")

    local teenbird = SpawnPrefab("teenbird")
    teenbird.Transform:SetPosition(inst.Transform:GetWorldPosition())
    teenbird.sg:GoToState("idle")

    if inst.components.follower.leader then
        teenbird.components.follower:SetLeader(inst.components.follower.leader)
    end

    if not inst:HasTag("companion") then
        SetSpringBirdState(teenbird)
    end

    inst:Remove()
end

Unless it's intended for Teen Tallbirds hatched from nests and raised there to be able to get attacked by their parents and also be able to starve to death, since the "spring bird" state is lost when growing up from small to teen.


Steps to Reproduce

Pretty self-explanatory. Tallbird eggs hatch offscreen after a while, so check on some that you found after some time, and notice how the child will be attacked by their parent.

  • Like 1



User Feedback


Don't patch this it's funny watching an "innocent" creature murder their children or get murked by 5 of their children when they finally load.

Share this comment


Link to comment
Share on other sites

Or that could be turned into some sort of feature in some way (maybe if there's too many in a biome or nearby or something to avoid overcrowding, if deemed an issue), instead of leaving all the very intended functionality there but never used due to a small oversight.

Tallbirds not killing their children means that they can keep increasing their numbers as time passes, making them sorta scale with time. 1 turns into 2, 2 turns into 4, etc. And they tend to make new nests nearby, like that one set piece with a lot of them and some rocks.

Share this comment


Link to comment
Share on other sites



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...