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

YN090-空手抓蜜蜂、杀人蜂、蝴蝶、萤火虫(用橙色护身符可以快速吸取)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2九十.空手抓蜜蜂、杀人蜂、蝴蝶、萤火虫(用橙色护身符可以快速吸取) 3 4 1.空手抓蜜蜂、杀人蜂:用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/bee.lua文件,将inst.components.inventoryitem.canbepickedup = false替换为inst.components.inventoryitem.canbepickedup = true 5 6 7 2.空手抓蝴蝶:用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/butterfly.lua文件,将inst.components.inventoryitem.canbepickedup = false替换为inst.components.inventoryitem.canbepickedup = true 8 9 10 3.空手抓萤火虫:用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/fireflies.lua文件,将共2句inst.components.inventoryitem.canbepickedup = false均替换为inst.components.inventoryitem.canbepickedup = true 11 12 即可空手抓蜜蜂、杀人蜂、蝴蝶、萤火虫,也可以用橙色护身符快速吸取

2025/04/23 · Bny

YN091-快速找到牛(牛在地图上显示)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2九十一.快速找到牛(牛在地图上显示) 3 4 用MT管理器打开游戏目录/assets/scripts/prefabs/beefalo.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6 local minimap = inst.entity:AddMiniMapEntity() 7 minimap:SetIcon( "beemine.png" ) 8 9 即可在地图上看到牛的位置,显示为炸弹图标,因为你不知道它什么时候会发狂

2025/04/23 · Bny

YN092-牛产便便速度增加1倍

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2九十二.牛产便便速度增加1倍 3 4 用MT管理器打开游戏目录/assets/scripts/prefabs/beefalo.lua文件,将inst.components.periodicspawner:SetRandomTimes(40, 60)替换为inst.components.periodicspawner:SetRandomTimes(20, 30) 5 6 即可让牛产便便速度增加1倍,约20至30秒产一次。牛的附近如果有便便,就不会再拉了,要勤捡起哦

2025/04/23 · Bny

YN093-喂牛蔬菜无限产黄油

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2九十三.喂牛蔬菜无限产黄油 3 4 用MT管理器打开游戏目录/assets/scripts/prefabs/beefalo.lua文件,在inst.components.eater:SetVegetarian()的下一行插入以下内容: 5 6local function OnGetItemFromPlayer(inst, giver, item) 7 if item.components.edible.foodtype == "VEGGIE" then 8 SpawnPrefab("butter").Transform:SetPosition(inst.Transform:GetWorldPosition()) 9 end 10end 11 inst:AddComponent("trader") 12 inst.components.trader.onaccept = OnGetItemFromPlayer 13 14 即可喂牛胡罗卜、浆果等蔬菜无限产黄油,相当于挤牛奶

2025/04/23 · Bny

YN094-牛醒着也可剪牛毛

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2九十四.牛醒着也可剪牛毛 3 4 用MT管理器打开游戏目录/assets/scripts/prefabs/beefalo文件,将下列内容: 5 6 inst.components.beard.canshavetest = function() if not inst.components.sleeper:IsAsleep() then return false, "AWAKEBEEFALO" end return true end 7 8 替换为: 9 10 inst.components.beard.canshavetest = function() if not inst.components.sleeper:IsAsleep() then return true, "AWAKEBEEFALO" end return true end 11 12 即可在牛醒着时也可剪牛毛

2025/04/23 · Bny

YN095-游牧生涯(带牛毛帽让牛群跟随,牛不集体攻击主角)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2九十五.游牧生涯(带牛毛帽让牛群跟随,牛不集体攻击主角) 3 4 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/hats.lua文件,将下列内容: 5 6 local function beefalo_equip(inst, owner) 7 onequip(inst, owner) 8 owner:AddTag("beefalo") 9 end 10 local function beefalo_unequip(inst, owner) 11 onunequip(inst, owner) 12 owner:RemoveTag("beefalo") 13 end 14 local function beefalo() 15 local inst = simple() 16 inst.components.equippable:SetOnEquip( beefalo_equip ) 17 inst.components.equippable:SetOnUnequip( beefalo_unequip ) 18 19 inst:AddComponent("insulator") 20 inst.components.insulator:SetInsulation(TUNING.INSULATION_LARGE) 21 22 inst:AddComponent("waterproofer") 23 inst.components.waterproofer:SetEffectiveness(TUNING.WATERPROOFNESS_SMALL) 24 25 inst:AddComponent("fueled") 26 inst.components.fueled.fueltype = "USAGE" 27 inst.components.fueled:InitializeFuelLevel(TUNING.BEEFALOHAT_PERISHTIME) 28 inst.components.fueled:SetDepletedFn(generic_perish) 29 30 31 return inst 32 end 33 34 替换为: 35 36 local function beefalo_disable(inst) 37 if inst.updatetask then 38 inst.updatetask:Cancel() 39 inst.updatetask = nil 40 end 41 local owner = inst.components.inventoryitem and inst.components.inventoryitem.owner 42 owner.components.leader:RemoveFollowersByTag("beefalo") 43 end 44 local function beefalo_update(inst) 45 local owner = inst.components.inventoryitem and inst.components.inventoryitem.owner 46 if owner and owner.components.leader then 47 local x,y,z = owner.Transform:GetWorldPosition() 48 local ents = TheSim:FindEntities(x,y,z, TUNING.SPIDERHAT_RANGE, {"beefalo"}) 49 for k,v in pairs(ents) do 50 if v.components.follower and not v.components.follower.leader and not owner.components.leader:IsFollower(v) and owner.components.leader.numfollowers < 50 then 51 owner.components.leader:AddFollower(v) 52 end 53 end 54 end 55 end 56 local function beefalo_enable(inst) 57 inst.updatetask = inst:DoPeriodicTask(0.5, beefalo_update, 1) 58 end 59 local function beefalo_equip(inst, owner) 60 onequip(inst, owner) 61 beefalo_enable(inst) 62 owner:AddTag("beefalo") 63 end 64 local function beefalo_unequip(inst, owner) 65 onunequip(inst, owner) 66 beefalo_disable(inst) 67 owner:RemoveTag("beefalo") 68 end 69 local function beefalo_perish(inst) 70 beefalo_disable(inst) 71 inst:Remove() 72 end 73 local function beefalo() 74 local inst = simple() 75 inst.components.equippable:SetOnEquip( beefalo_equip ) 76 inst.components.equippable:SetOnUnequip( beefalo_unequip ) 77 inst:AddComponent("insulator") 78 inst.components.insulator.insulation = TUNING.INSULATION_LARGE 79 inst:AddComponent("waterproofer") 80 inst.components.waterproofer:SetEffectiveness(TUNING.WATERPROOFNESS_SMALL) 81 inst:AddComponent("fueled") 82 inst.components.fueled.fueltype = "USAGE" 83 inst.components.fueled:InitializeFuelLevel(TUNING.BEEFALOHAT_PERISHTIME) 84 inst.components.fueled:SetDepletedFn(beefalo_perish) 85 return inst 86 end 87 88 89 2.用MT管理器打开游戏目录/assets/scripts/prefabs/beefalo.lua文件,将return not guy:HasTag("beefalo") and替换为return not guy:HasTag("beefalo") and not guy:HasTag("player") and 90 91 92 3.将return dude:HasTag("beefalo") and not dude:HasTag("player") and not dude.components.health:IsDead()替换为return dude:HasTag("beefalo") and dude:HasTag("player") and not dude.components.health:IsDead() 93 94 95 4.将inst.components.locomotor.walkspeed = 1.5替换为inst.components.locomotor.walkspeed = 3 96 97 即可带牛毛帽让牛群跟随,杀牛它们不会集体反击,也提高了牛走路的速度。加上“牛产便便速度增加1倍”、“喂牛蔬菜无限产黄油”、“牛醒着也可剪牛毛”的修改(见本修改技巧),就可以烧着便便取暖,吃牛肉、黄油,经营自己的牛群吧

2025/04/23 · Bny

YN096-养殖牛(用牛毛种小牛)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2九十六.养殖牛(用牛毛种小牛) 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/beefalowool.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6local function OnDeploy (inst, pt) 7 SpawnPrefab("babybeefalo").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

YN097-养殖兔子(用兔子种兔子洞、兔子可堆叠)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2九十七.养殖兔子(用兔子种兔子洞、兔子可堆叠) 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/rabbit.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6local function OnDeploy (inst, pt) 7 SpawnPrefab("rabbithole").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_LARGEITEM 14 15 即可种兔子得兔子洞、兔子可堆叠

2025/04/23 · Bny

YN098-养殖火鸡(用鸡蛋种会下蛋且不用圈养的火鸡)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2九十八.养殖火鸡(用鸡蛋种会下蛋且不用圈养的火鸡) 3 4 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/egg.lua文件,在inst.components.cookable.product = "bird_egg_cooked"的下一行插入以下内容: 5 6local function OnDeploy (inst, pt) 7 SpawnPrefab("perd").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 14 2.用MT管理器打开游戏目录/assets/scripts/prefabs/perd.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 15 16 inst:AddComponent("periodicspawner") 17 inst.components.periodicspawner:SetPrefab("bird_egg") 18 inst.components.periodicspawner:SetRandomTimes(360, 480) 19 inst.components.periodicspawner:Start() 20 21 22 3.用MT管理器打开游戏目录/assets/scripts/brains/perdbrain.lua文件,将下列内容: 23 24 WhileNode(function() return clock and not clock:IsDay() end, "IsNight", 25 DoAction(self.inst, GoHomeAction, "Go Home", true )), 26 DoAction(self.inst, EatFoodAction, "Eat Food"), 27 RunAway(self.inst, "scarytoprey", SEE_PLAYER_DIST, STOP_RUN_DIST), 28 DoAction(self.inst, PickBerriesAction, "Pick Berries", true), 29 Wander(self.inst, HomePos, MAX_WANDER_DIST), 30 31 替换为: 32 33 DoAction(self.inst, EatFoodAction, "Eat Food"), 34 RunAway(self.inst, "scarytoprey", SEE_PLAYER_DIST/2.5, STOP_RUN_DIST/3), 35 36 即可用鸡蛋种会下蛋且不用圈养的火鸡,火鸡不会乱跑,养在果树丛旁也不会消失,一天左右下一个蛋

2025/04/23 · Bny

YN099-养殖大象(用兔人尾巴种大象)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2九十九.养殖大象(用兔人尾巴种大象) 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/manrabbit_tail.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6local function OnDeploy (inst, pt) 7 local names = {"koalefant_summer","koalefant_winter"} 8 inst.name = names[math.random(#names)] 9 SpawnPrefab(inst.name).Transform:SetPosition(pt.x, pt.y, pt.z) 10 inst.components.stackable:Get():Remove() 11end 12 inst:AddComponent("deployable") 13 inst.components.deployable.ondeploy = OnDeploy 14 15 即可用兔人尾巴种大象,品种随机,可能是冬象、也可能是夏象

2025/04/23 · Bny