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

YN020-增加主角物品条的格子

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二十.增加主角物品条的格子 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/components/inventory.lua文件,将local MAXSLOTS = 15替换为local MAXSLOTS = 25 5 6 即可将主角物品条的格子由15个增加到25个

2025/04/23 · Bny

YN021-双层主角物品条(60格)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二十一.双层主角物品条(60格) 3 4 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/components/inventory.lua文件,将local MAXSLOTS = 15替换为local MAXSLOTS = 60 5 6 2.用MT管理器打开游戏目录/assets/scripts/widgets/inventorybar.lua文件,将self.bg:SetScale(1.15,1,1)替换为self.bg:SetScale(1.86,1.85,1) 7 8 3.将下列内容: 9 10 local num_intersep = math.floor(num_slots / 5) + 1 11 local total_w = (num_slots + num_equip)*(W) + (num_slots + num_equip - 2 - num_intersep) *(SEP) + INTERSEP*num_intersep 12 13 for k, v in ipairs(self.equipslotinfo) do 14 local slot = EquipSlot(v.slot, v.atlas, v.image, self.owner) 15 self.equip[v.slot] = self.toprow:AddChild(slot) 16 local x = -total_w/2 + (num_slots)*(W)+num_intersep*(INTERSEP - SEP) + (num_slots-1)*SEP + INTERSEP + W*(k-1) + SEP*(k-1) 17 slot:SetPosition(x,0,0) 18 table.insert(eslot_order, slot) 19 20 local item = self.owner.components.inventory:GetEquippedItem(v.slot) 21 if item then 22 slot:SetTile(ItemTile(item)) 23 end 24 25 end 26 27 for k = 1,num_slots do 28 local slot = InvSlot(k, HUD_ATLAS, "inv_slot.tex", self.owner, self.owner.components.inventory) 29 self.inv[k] = self.toprow:AddChild(slot) 30 local interseps = math.floor((k-1) / 5) 31 local x = -total_w/2 + W/2 + interseps*(INTERSEP - SEP) + (k-1)*W + (k-1)*SEP 32 slot:SetPosition(x,0,0) 33 34 slot.top_align_tip = W*0.5 + YSEP 35 36 local item = self.owner.components.inventory:GetItemInSlot(k) 37 if item then 38 slot:SetTile(ItemTile(item)) 39 end 40 41 end 42 43 替换为: 44 45 local num_intersep = math.floor(num_slots / 10) + 1 46 local total_w = (num_slots -30.85)*(W) + (num_slots -30.85 - 2 - num_intersep) *(SEP) + INTERSEP*num_intersep 47 48 for k, v in ipairs(self.equipslotinfo) do 49 local slot = EquipSlot(v.slot, v.atlas, v.image, self.owner) 50 self.equip[v.slot] = self.toprow:AddChild(slot) 51 local x = -total_w/2 + (num_slots*0+14.07)*(W)+num_intersep*(INTERSEP - SEP) + (num_slots-1)*SEP + INTERSEP + W*(k-1) + SEP*(k-1) 52 slot:SetPosition(x+341,190,0) 53 table.insert(eslot_order, slot) 54 55 local item = self.owner.components.inventory:GetEquippedItem(v.slot) 56 if item then 57 slot:SetTile(ItemTile(item)) 58 end 59 60 end 61 62 for k = 1,30 do 63 local slot = InvSlot(k, HUD_ATLAS, "inv_slot.tex", self.owner, self.owner.components.inventory) 64 self.inv[k] = self.toprow:AddChild(slot) 65 local interseps = math.floor((k-1) / 10) 66 local x = -total_w/2 + W/2 + interseps*(INTERSEP - SEP) + (k-1)*W + (k-1)*SEP 67 slot:SetPosition(x,0,0) 68 69 local item = self.owner.components.inventory:GetItemInSlot(k) 70 if item then 71 slot:SetTile(ItemTile(item)) 72 end 73 74 end 75 76 for k = 31,60 do 77 local slot = InvSlot(k, HUD_ATLAS, "inv_slot.tex", self.owner, self.owner.components.inventory) 78 self.inv[k] = self.toprow:AddChild(slot) 79 local interseps = math.floor((k-1-30) / 10) 80 local x = -total_w/2 + W/2 + interseps*(INTERSEP - SEP) + (k-1-30)*W + (k-1-30)*SEP 81 slot:SetPosition(x,80,0) 82 83 local item = self.owner.components.inventory:GetItemInSlot(k) 84 if item then 85 slot:SetTile(ItemTile(item)) 86 end 87 88 end 89 90 即可获得双层主角物品条(60格),注意必须将游戏设置(options) - (Settings) - HUD size项设为0,即显示最小物品条,才可完整显示60格哦

2025/04/23 · Bny

YN022-同时携带多个背包(背包可库存)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二十二.同时携带多个背包(背包可库存) 3 4 1.同时携带多个普通背包:用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/backpack.lua文件,将inst.components.inventoryitem.cangoincontainer = false替换为inst.components.inventoryitem.cangoincontainer = true 5 6 2.同时携带多个小猪包:用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/piggyback.lua文件,将inst.components.inventoryitem.cangoincontainer = false替换为inst.components.inventoryitem.cangoincontainer = true 7 8 3.同时携带多个坎普斯背包:用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/krampus_sack.lua文件,将inst.components.inventoryitem.cangoincontainer = false替换为inst.components.inventoryitem.cangoincontainer = true 9 10 4.同时携带多个冰包:用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/icepack.lua文件,将inst.components.inventoryitem.cangoincontainer = false替换为inst.components.inventoryitem.cangoincontainer = true 11 12 即可同时携带多个背包

2025/04/23 · Bny

YN023-背包格子增大至39格

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二十三.背包格子增大至39格 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/backpack.lua文件, 5 6 1.将下列内容: 7 8for y = 0, 3 do 9 table.insert(slotpos, Vector3(-162, -y*75 + 114 ,0)) 10 table.insert(slotpos, Vector3(-162 +75, -y*75 + 114 ,0)) 11 12 替换为: 13 14for y = 0, 12 do 15 table.insert(slotpos, Vector3(-162, -y*75 + 350 ,0)) 16 table.insert(slotpos, Vector3(-162 +75, -y*75 + 350 ,0)) 17 table.insert(slotpos, Vector3(-162 +150, -y*75 + 350 ,0)) 18 19 2.将下列内容: 20 21 inst.components.container.widgetanimbank = "ui_backpack_2x4" 22 inst.components.container.widgetanimbuild = "ui_backpack_2x4" 23 inst.components.container.widgetpos = Vector3(-5,-70,0) 24 25 替换为: 26 27 --inst.components.container.widgetanimbank = "ui_backpack_2x4" 28 --inst.components.container.widgetanimbuild = "ui_backpack_2x4" 29 inst.components.container.widgetpos = Vector3(-25,-50,0) 30 31 即可让普通背包格子增大至39格.将游戏设置(options) - (Settings) - HUD size项设为0,即显示最小物品条,才可完整显示

2025/04/23 · Bny

YN024-制造坎普斯背包

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二十四.制造坎普斯背包 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/recipes.lua文件,在Recipe("piggyback", {Ingredient("pigskin", 4), Ingredient("silk", 6), Ingredient("rope", 2)}, RECIPETABS.SURVIVAL, TECH.SCIENCE_TWO)的下一行插入以下内容: 5 6Recipe("krampus_sack", {Ingredient("cutgrass", 5),Ingredient("twigs", 5)}, RECIPETABS.SURVIVAL, TECH.NONE) 7 8 即可在生存选项(画着绳套)下,用5个草、5个树杈制造坎普斯背包。不要与“巨型超市”一同修改,因为“巨型超市”中已经有坎普斯背包出售

2025/04/23 · Bny

YN025-伍迪砍树不会变海狸

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二十五.伍迪砍树不会变海狸 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/woodie.lua文件,将inst.components.beaverness:DoDelta(3)替换为inst.components.beaverness:DoDelta(0) 5 6 即可让伍迪砍树不会变海狸

2025/04/23 · Bny

YN026-伍迪吃疯肉立即变海狸且随身物品不掉落

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二十六.伍迪吃疯肉立即变海狸且随身物品不掉落 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/woodie.lua文件, 5 6 1.将inst.components.inventory:DropEverything()替换为--inst.components.inventory:DropEverything() 7 8 9 2.在inst.Light:SetColour(245/255,40/255,0/255)的下一行插入以下内容: 10 11local function OnEat(inst, food) 12 if food.prefab == "monstermeat" and not inst.components.beaverness:IsBeaver() then 13 if not inst.components.beaverness.doing_transform then 14 inst.components.beaverness:SetPercent(1) 15 end 16 end 17end 18 inst.components.eater:SetOnEatFn(OnEat) 19 20 即可让伍迪吃疯肉立即变海狸,随身物品还保留在身上(只是看不见),等变回伍迪即可使用。不要在伍迪佩戴橙色护身符时变海狸,否则砍的木头都自动被吸走,海狸无法吃到。不要与“小病小灾”一同修改

2025/04/23 · Bny

YN027-图书管理员不再失眠(老太太可以睡帐篷)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二十七.图书管理员不再失眠(老太太可以睡帐篷) 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/wickerbottom.lua文件,将inst:AddTag("insomniac")替换为--inst:AddTag("insomniac") 5 6 即可让老太太也可以睡帐篷

2025/04/23 · Bny

YN028-麦斯威尔用魔法书召唤分身不减脑上限

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二十八.麦斯威尔用魔法书召唤分身不减脑上限 3 4 1.用MT管理器打开游戏目录/assets/scripts/prefabs/waxwelljournal.lua文件,将reader.components.sanity:RecalculatePenalty()替换为--reader.components.sanity:RecalculatePenalty() 5 6 7 2.用MT管理器打开游戏目录/assets/scripts/prefabs/shadowwaxwell.lua文件,将下列内容: 8 9 inst:ListenForEvent("death", ondeath) 10 11 inst:AddComponent("inventory") 12 inst.components.inventory.dropondeath = false 13 14 inst:AddComponent("sanityaura") 15 inst.components.sanityaura.penalty = TUNING.SHADOWWAXWELL_SANITY_PENALTY 16 17 替换为: 18 19 --inst:ListenForEvent("death", ondeath) 20 21 inst:AddComponent("inventory") 22 inst.components.inventory.dropondeath = false 23 24 --inst:AddComponent("sanityaura") 25 --inst.components.sanityaura.penalty = TUNING.SHADOWWAXWELL_SANITY_PENALTY 26 27 即可在麦斯威尔用魔法书召唤分身时不减脑上限

2025/04/23 · Bny

YN029-瓦丝格雷斯可以吃蔬菜

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二十九.瓦丝格雷斯可以吃蔬菜 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/wathgrithr.lua文件,将inst.components.eater:SetCarnivore(true)替换为--inst.components.eater:SetCarnivore(true) 5 6 即可让红发妹瓦丝格雷斯不止可以吃肉,也可以吃蔬菜

2025/04/23 · Bny