[分享]饥荒联机版,支持局域网联机。

YN100-养殖高鸟(种高鸟蛋得不攻击、下高鸟蛋的大高鸟)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一00.养殖高鸟(种高鸟蛋得不攻击、下高鸟蛋的大高鸟) 3 4 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/tallbirdegg.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6local function OnDeploy (inst, pt) 7 SpawnPrefab("tallbird").Transform:SetPosition(pt.x, pt.y, pt.z) 8 inst.components.stackable:Get():Remove() 9end 10 inst:AddComponent("deployable") 11 inst.components.deployable.ondeploy = OnDeploy 12 inst:AddComponent("stackable") 13 inst.components.stackable.maxsize = TUNING.STACK_SIZE_SMALLITEM 14 15 16 2.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/tallbird.lua文件,将inst.components.combat:SetRange(TUNING.TALLBIRD_ATTACK_RANGE)替换为inst.components.combat:SetRange(TUNING.TALLBIRD_ATTACK_RANGE*0) 17 18 19 3.在inst:AddComponent("inspectable")的下一行插入以下内容: 20 21 inst:AddComponent("periodicspawner") 22 inst.components.periodicspawner:SetPrefab("tallbirdegg") 23 inst.components.periodicspawner:SetRandomTimes(80, 110) 24 inst.components.periodicspawner:SetDensityInRange(20, 2) 25 inst.components.periodicspawner:SetMinimumSpacing(8) 26 inst.components.periodicspawner:Start() 27 28 即可种高鸟蛋得大高鸟,高鸟无攻击行为、下高鸟蛋,高鸟蛋可堆叠

2025/04/23 · Bny

YN101-下钩就上鱼(无限刷鱼)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一0一.下钩就上鱼(无限刷鱼) 3 4 1.用MT管理器打开游戏目录/assets/scripts/prefabs/fishingrod.lua文件,将inst.components.fishingrod:SetWaitTimes(4, 40)替换为inst.components.fishingrod:SetWaitTimes(0, 0) 5 6 7 2.用MT管理器打开游戏目录/assets/scripts/components/fishable.lua文件,将self.fishleft = self.fishleft - 1替换为self.fishleft = self.fishleft 8 9 即可在池塘钓鱼时,下钩就上鱼,且无限刷鱼。游戏原设定为钓10条需等一段时间才会再有鱼

2025/04/23 · Bny

YN102-用腐烂食物种普通池塘

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一0二.用腐烂食物种普通池塘 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/spoiledfood.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6local function OnDeploy (inst, pt) 7 SpawnPrefab("pond").Transform:SetPosition(pt.x, pt.y, pt.z) 8 inst.components.stackable:Get():Remove() 9end 10 inst:AddComponent("deployable") 11 inst.components.deployable.ondeploy = OnDeploy 12 13 即可用腐烂食物种普通池塘

2025/04/23 · Bny

YN103-用蛙腿种可钓鳗鱼池塘

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一0三.用蛙腿种可钓鳗鱼池塘 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/froglegs.lua文件,在inst.AnimState:PlayAnimation("idle")的下一行插入以下内容: 5 6local function OnDeploy (inst, pt) 7 SpawnPrefab("pond_cave").Transform:SetPosition(pt.x, pt.y, pt.z) 8 inst.components.stackable:Get():Remove() 9end 10 inst:AddComponent("deployable") 11 inst.components.deployable.ondeploy = OnDeploy 12 13 即可用蛙腿种可钓鳗鱼池塘

2025/04/23 · Bny

YN104-用铲子挖掉池塘

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一0四.用铲子挖掉池塘 3 4 用MT管理器打开游戏目录/assets/scripts/prefabs/pond.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6local function dig_up(inst, chopper) 7 inst:Remove() 8end 9 inst:AddComponent("workable") 10 inst.components.workable:SetWorkAction(ACTIONS.DIG) 11 inst.components.workable:SetOnFinishCallback(dig_up) 12 inst.components.workable:SetWorkLeft(1) 13 14 即可用铲子挖掉池塘

2025/04/23 · Bny

YN105-冬天池塘不上冻

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一0五.冬天池塘不上冻 3 4 用MT管理器打开游戏目录/assets/scripts/prefabs/pond.lua文件,将if snow_cover > thresh and not inst.frozen then替换为if snow_cover > thresh and inst.frozen then 5 6 即可冬天池塘不上冻,在冬天也能钓鱼

2025/04/23 · Bny

YN106-池塘不生青蛙、蚊子

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一0六.池塘不生青蛙、蚊子 3 4 用MT管理器打开游戏目录/assets/scripts/prefabs/pond.lua文件, 5 6 1.将inst.components.childspawner.childname = "mosquito"替换为--inst.components.childspawner.childname = "mosquito" 7 8 9 2.将inst.components.childspawner.childname = "frog"替换为--inst.components.childspawner.childname = "frog" 10 11 即可让池塘不生讨厌的青蛙、蚊子,怡然自得地垂钓吧

2025/04/23 · Bny

YN107-青蛙不偷东西

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一0七.青蛙不偷东西 3 4 用MT管理器打开游戏目录/assets/scripts/prefabs/frog.lua文件,将inst.components.combat.onhitotherfn = function(inst, other, damage) inst.components.thief:StealItem(other) end替换为--inst.components.combat.onhitotherfn = function(inst, other, damage) inst.components.thief:StealItem(other) end 5 6 即可让青蛙在攻击主角时,主角不掉物品

2025/04/23 · Bny

YN108-池塘边长满曼德拉草

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一0八.池塘边长满曼德拉草 3 4 用MT管理器打开游戏目录/assets/scripts/prefabs/pond.lua文件,将共2句inst.planttype = "marsh_plant"均替换为inst.planttype = "mandrake" 5 6 即可让池塘边长曼德拉草,采完过一段时间后又会长出一批。注意一共要替换2句哦

2025/04/23 · Bny

YN109-主角可夜视(按键盘H键开关夜视功能)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一0九.主角可夜视(按键盘H键开关夜视功能) 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/player_common.lua文件,在inst:AddComponent("playeractionpicker")的下一行插入以下内容: 5 6local function lightson(inst) 7 inst.components.machine.ison = true 8 inst.Light:Enable(true) 9end 10local function lightsoff(inst) 11 inst.components.machine.ison = false 12 inst.Light:Enable(false) 13end 14 local light = inst.entity:AddLight() 15 light:SetFalloff(1) 16 light:SetIntensity(.8) 17 light:SetRadius(10) 18 light:Enable(false) 19 light:SetColour(0/255, 255/255, 0/255) 20 inst:AddComponent("machine") 21 inst.components.machine.turnonfn = lightson 22 inst.components.machine.turnofffn = lightsoff 23TheInput:AddKeyUpHandler(KEY_H, function() if inst.components.machine:IsOn() then inst.components.machine:TurnOff() else inst.components.machine:TurnOn() end end ) 24 25 即可在游戏中按键盘H键开关主角夜视功能,不再需要火炬、矿工灯

2025/04/23 · Bny