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

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


 1
 2三一九.猪人永久跟随
 3
 4	MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/pigman.lua文件
 5
 6	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)
 7
 8
 9	2.inst.components.follower.maxfollowtime = TUNING.PIG_LOYALTY_MAXTIME替换为--inst.components.follower.maxfollowtime = TUNING.PIG_LOYALTY_MAXTIME
10
11	即可让猪人永久跟随,饿了也不会离开。但晚上一样需要给它点火,它会呆在火旁,到白天继续跟随