代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。

原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html



三一九.猪人永久跟随

	用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/pigman.lua文件,

	1.将inst.components.follower:AddLoyaltyTime(item.components.edible:GetHunger() * TUNING.PIG_LOYALTY_PER_HUNGER)替换为--inst.components.follower:AddLoyaltyTime(item.components.edible:GetHunger() * TUNING.PIG_LOYALTY_PER_HUNGER)


	2.将inst.components.follower.maxfollowtime = TUNING.PIG_LOYALTY_MAXTIME替换为--inst.components.follower.maxfollowtime = TUNING.PIG_LOYALTY_MAXTIME

	即可让猪人永久跟随,饿了也不会离开。但晚上一样需要给它点火,它会呆在火旁,到白天继续跟随