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