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

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一00.养殖高鸟(种高鸟蛋得不攻击、下高鸟蛋的大高鸟) 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/tallbirdegg.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function OnDeploy (inst, pt) SpawnPrefab("tallbird").Transform:SetPosition(pt.x, pt.y, pt.z) inst.components.stackable:Get():Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy inst:AddComponent("stackable") inst.components.stackable.maxsize = TUNING.STACK_SIZE_SMALLITEM 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) 3.在inst:AddComponent("inspectable")的下一行插入以下内容: inst:AddComponent("periodicspawner") inst.components.periodicspawner:SetPrefab("tallbirdegg") inst.components.periodicspawner:SetRandomTimes(80, 110) inst.components.periodicspawner:SetDensityInRange(20, 2) inst.components.periodicspawner:SetMinimumSpacing(8) inst.components.periodicspawner:Start() 即可种高鸟蛋得大高鸟,高鸟无攻击行为、下高鸟蛋,高鸟蛋可堆叠

2025/04/23 · Bny

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

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

2025/04/23 · Bny

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

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

2025/04/23 · Bny

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

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

2025/04/23 · Bny

YN104-用铲子挖掉池塘

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

2025/04/23 · Bny

YN105-冬天池塘不上冻

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

2025/04/23 · Bny

YN106-池塘不生青蛙、蚊子

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

2025/04/23 · Bny

YN107-青蛙不偷东西

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一0七.青蛙不偷东西 用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 即可让青蛙在攻击主角时,主角不掉物品

2025/04/23 · Bny

YN108-池塘边长满曼德拉草

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

2025/04/23 · Bny

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

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

2025/04/23 · Bny