Jump to content

Pigmen will never use "PIG_TALK_LOOKATWILSON" strings.


Hornete
  • Pending

Pigmen will never use any of the strings in the "PIG_TALK_LOOKATWILSON" table.

IfNode(function() return GetLeader(self.inst) end, "has leader",
    ChattyNode(self.inst, "PIG_TALK_FOLLOWWILSON",
        FaceEntity(self.inst, GetFaceTargetFn, KeepFaceTargetFn ))),

Leash(self.inst, GetNoLeaderHomePos, LEASH_MAX_DIST, LEASH_RETURN_DIST),

ChattyNode(self.inst, "PIG_TALK_RUNAWAY_WILSON",
    RunAway(self.inst, "player", START_RUN_DIST, STOP_RUN_DIST)),
ChattyNode(self.inst, "PIG_TALK_LOOKATWILSON",
    FaceEntity(self.inst, GetFaceTargetFn, KeepFaceTargetFn)),

This is because in pigbrain.lua. GetFaceTargetFn gets the pigmans leader, and if it has one, the ChattyNode at the end for "PIG_TALK_LOOKAT_WILSON" should work. Right? However, an earlier behaviour, the first one in this snippet of code, has essentially the exact same requirements, and since it is earlier, it'll always take priority.

It seems in DS, GetFaceTargetFn would grab the closest player instead of the leader, and for the context of the PIG_TALK_LOOKATWILSON strings this makes sense. The solution should just be porting that function in DS and using it for PIG_TALK_LOOKATWILSON instead.

local function GetFaceTargetFn(inst) --Could be renamed to GetClosetPlayerFn
    local target = GetClosestInstWithTag("player", inst, START_FACE_DIST)
    if target and not target:HasTag("notarget") then
        return target
    end
end

 


Steps to Reproduce

1. Go to a pigman
2. Try to get it to say any of the strings found in PIG_TALK_LOOKATWILSON
3. Notice it never happens.

  • Like 1



User Feedback


Oh, and not a bug per-say, but rather a suggestion, since one of the strings in PIG_TALK_LOOKATWILSON is "UGLY MONKEY PERSON". It might be a cute detail to change that string depending on the character once this bug is fixed since we've got quite a bit of non-human characters haha :>

  • Like 1

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