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.
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.
- 1
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 accountSign in
Already have an account? Sign in here.
Sign In Now