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

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

YN110-火炬不用尽(用到剩0%不消失,可继续用)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一一0.火炬不用尽(用到剩0%不消失,可继续用) 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/torch.lua文件, 5 6 1.将inst:Remove()替换为--inst:Remove() 7 8 9 2.将inst.components.fueled:SetDepletedFn(function(inst) inst:Remove() end)替换为--inst.components.fueled:SetDepletedFn(function(inst) inst:Remove() end) 10 11 即可让火炬用到剩0%后不消失,可继续用。在语句前加入--的功能就是将该句废掉

2025/04/23 · Bny

YN111-矿工灯无限使用

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2一一一.矿工灯无限使用 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/hats.lua文件,将下列内容: 5 6 inst.components.fueled:StartConsuming() 7 inst.SoundEmitter:PlaySound("dontstarve/common/minerhatAddFuel") 8 9 替换为: 10 11 inst.components.fueled:StopConsuming() 12 inst.SoundEmitter:PlaySound("dontstarve/common/minerhatAddFuel") 13 14 即可让矿工灯无限使用

2025/04/23 · Bny