模组文件免费下载和使用,谨防上当受骗。

YN226-遁形术(按键盘I键主角变身随机小动物,敌人会失去攻击目标,再按I键变回人)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二二六.遁形术(按键盘I键主角变身随机小动物,敌人会失去攻击目标,再按I键变回人) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/player_common.lua文件,在inst:AddComponent("playercontroller")的下一行插入以下内容: TheInput:AddKeyUpHandler(KEY_I, function() if not inst:HasTag("chameleon") then inst.components.locomotor:Stop() inst.components.talker:ShutUp() inst.components.playercontroller:Enable(false) local head = GetPlayer().components.inventory:GetEquippedItem(EQUIPSLOTS.HEAD) GetPlayer().components.inventory:DropItem(head) local hands = GetPlayer().components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS) GetPlayer().components.inventory:DropItem(hands) local body = GetPlayer().components.inventory:GetEquippedItem(EQUIPSLOTS.BODY) GetPlayer().components.inventory:DropItem(body) inst.components.health:SetInvincible(true) inst.components.hunger:Pause() inst.components.sanity.ignore = true inst.components.temperature:SetTemp(20) SpawnPrefab("collapse_small").Transform:SetPosition(inst.Transform:GetWorldPosition()) inst:DoTaskInTime(0.3, function() inst:AddTag("chameleon") inst.chameleon = inst:DoPeriodicTask(.5, function() local pos = Vector3(inst.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 25) for k,v in pairs(ents) do if v.components.combat and v.components.combat.target and v.components.combat.target == inst then v.components.combat:SetTarget(nil) end end end ) if math.random()<.18 then inst.AnimState:SetBank("rabbit") inst.AnimState:SetBuild("rabbit_build") inst.AnimState:PlayAnimation("idle") local rabbitsounds = { scream = "dontstarve/rabbit/scream", hurt = "dontstarve/rabbit/scream_short", } inst.sounds = rabbitsounds inst.data = {} inst:SetStateGraph("SGrabbit") shadow:SetSize( 1, .75 ) elseif math.random()<.36 then inst.AnimState:SetBank("perd") inst.AnimState:SetBuild("perd") inst.AnimState:PlayAnimation("idle_loop") inst:SetStateGraph("SGperd") shadow:SetSize( 1.5, .75 ) elseif math.random()<.54 then inst.AnimState:SetBank("frog") inst.AnimState:SetBuild("frog") inst.AnimState:PlayAnimation("idle") inst:SetStateGraph("SGfrog") shadow:SetSize( 1.5, .75 ) elseif math.random()<.72 then inst.AnimState:SetBank("butterfly") inst.AnimState:SetBuild("butterfly_basic") inst.AnimState:PlayAnimation("idle") inst:SetStateGraph("SGbutterfly") shadow:SetSize( .8, .5 ) else inst.AnimState:SetBank("bee") inst.AnimState:SetBuild("bee_build") inst.AnimState:PlayAnimation("idle") local workersounds = { takeoff = "dontstarve/bee/bee_takeoff", attack = "dontstarve/bee/bee_attack", buzz = "dontstarve/bee/bee_fly_LP", hit = "dontstarve/bee/bee_hurt", death = "dontstarve/bee/bee_death", } inst.sounds = workersounds inst:SetStateGraph("SGbee") shadow:SetSize( .8, .5 ) end inst.components.playercontroller:Enable(true) end ) else inst.components.locomotor:Stop() inst.components.talker:ShutUp() inst.components.playercontroller:Enable(false) SpawnPrefab("collapse_small").Transform:SetPosition(inst.Transform:GetWorldPosition()) inst:DoTaskInTime(0.3, function() inst:RemoveTag("chameleon") if inst.chameleon then inst.chameleon:Cancel() inst.chameleon = nil end inst.AnimState:SetBank("wilson") inst.AnimState:SetBuild(name) inst.AnimState:PlayAnimation("idle") inst:SetStateGraph("SGwilson") shadow:SetSize( 1.3, .6 ) inst.components.health:SetInvincible(false) inst.components.hunger:Resume() inst.components.sanity.ignore = false inst.components.temperature:SetTemp(nil) inst.components.playercontroller:Enable(true) end ) end end ) 即可在被敌人追得穷途末路时,大声喊出咒语“哎呀妈呀”(请使用东北口音),并按键盘I键,主角随机变身为兔子、火鸡、青蛙、蝴蝶、蜜蜂等小动物,敌人会被迷惑,从而失去攻击目标,让你可以成功脱身。每种小动物各有特色,火鸡可以快速采摘植物、蜜蜂可以蛰敌人等,体验一下作小动物的感觉吧。运用遁形术变身时,血、饥饿、脑会锁死,穿戴的装备会掉在地上,不想让其掉落,就提前卸下。再次按键盘I键,可变回主角

2025/04/23 · Bny

YN227-人工降水(开关雨量计夏天下雨、冬天下雪,可以灭火)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二二七.人工降水(开关雨量计夏天下雨、冬天下雪,可以灭火) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/rainometer.lua文件,将inst:AddComponent("inspectable")替换为以下内容: function firefn(inst) local range = 3000 local pos = Vector3(inst.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, range) for k,v in pairs(ents) do local pt = v:GetPosition() if v.components.burnable and v.components.burnable:IsBurning() then if v.prefab == "grass" then v:Remove() SpawnPrefab("grass").Transform:SetPosition(pt.x, pt.y, pt.z) end if v.prefab == "sapling" then v:Remove() SpawnPrefab("sapling").Transform:SetPosition(pt.x, pt.y, pt.z) end if v.prefab == "reeds" then v:Remove() SpawnPrefab("reeds").Transform:SetPosition(pt.x, pt.y, pt.z) end if v.prefab == "berrybush" then v:Remove() SpawnPrefab("berrybush").Transform:SetPosition(pt.x, pt.y, pt.z) end if v.prefab == "marsh_bush" then v:Remove() SpawnPrefab("marsh_bush").Transform:SetPosition(pt.x, pt.y, pt.z) end if v.prefab == "flower_cave_triple" then v:Remove() SpawnPrefab("flower_cave_triple").Transform:SetPosition(pt.x, pt.y, pt.z) end if v.prefab == "lichen" then v:Remove() SpawnPrefab("lichen").Transform:SetPosition(pt.x, pt.y, pt.z) end end end end local function GetStatus(inst, viewer) if GetWorld().components.seasonmanager.precip then GetWorld().components.seasonmanager:StopPrecip() if inst.fire then inst.fire:Cancel() inst.fire = nil end else GetWorld().components.seasonmanager:ForcePrecip() inst.fire = inst:DoPeriodicTask(8, function() firefn(inst) end) end end inst:AddComponent("inspectable") inst.components.inspectable.getstatus = GetStatus 即可在雨量计上按鼠标左键开始降水,再按一次鼠标左键停止降水,夏天下雨、冬天下雪。可以浇灭大部分植物着的火,包括草、树枝、芦苇、果树丛、尖刺灌木、三朵洞穴花、苔藓

2025/04/23 · Bny

YN228-人工换季(鼠标左键点寒冬温度计切换季节)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二二八.人工换季(鼠标左键点寒冬温度计切换季节) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/winterometer.lua文件,将inst:AddComponent("inspectable")替换为以下内容: local function GetStatus(inst, viewer) if GetWorld().components.seasonmanager:IsWinter() then GetWorld().components.seasonmanager:StartSpring() elseif GetWorld().components.seasonmanager:IsSpring() then GetWorld().components.seasonmanager:StartSummer() elseif GetWorld().components.seasonmanager:IsSummer() then GetWorld().components.seasonmanager:StartAutumn() else GetWorld().components.seasonmanager:StartWinter() end GetWorld().components.seasonmanager:UpdateSegs() end inst:AddComponent("inspectable") inst.components.inspectable.getstatus = GetStatus 即可鼠标左键点寒冬温度计切换季节,每按一次切换到下个季节

2025/04/23 · Bny

YN229-光阴似箭(对指南针按右键跳到下个时段)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二二九.光阴似箭(对指南针按右键跳到下个时段) 用MT管理器打开游戏目录/assets/scripts/prefabs/compass.lua文件,在local function GetStatus(inst, viewer)的下一行插入GetClock():NextPhase() 即可对指南针按右键跳到下个时段,即白天变傍晚、傍晚变黑夜、黑夜变白天,采蘑菇、捉萤火虫等有时段要求的事情,无须再等待了

2025/04/23 · Bny

YN230-五彩木箱(找东西直接看木箱颜色,木箱可搬动)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二三0.五彩木箱(找东西直接看木箱颜色,木箱可搬动) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/treasurechest.lua文件,将下列内容: inst.OnSave = onsave inst.OnLoad = onload 替换为: local colours= { {198/255,43/255,43/255}, {79/255,153/255,68/255}, {35/255,105/255,235/255}, {233/255,208/255,69/255}, {109/255,50/255,163/255}, {222/255,126/255,39/255}, } local function onequip(inst, owner) owner.AnimState:OverrideSymbol("swap_body", "swap_backpack", "swap_body") end local function onunequip(inst, owner) owner.AnimState:ClearOverrideSymbol("swap_body") end local function turnon(inst) inst.components.machine.ison = true if inst.prefab == "treasurechest" then inst:AddComponent("inventoryitem") end end local function turnoff(inst) inst.components.machine.ison = false if inst.prefab == "treasurechest" then inst:RemoveComponent("inventoryitem") end end local function onsave2(inst, data) data.num = inst.balloon_num data.colour_idx = inst.colour_idx end local function onload2(inst, data) if data then if data.num then inst.balloon_num = data.num inst.AnimState:OverrideSymbol("swap_balloon", "balloon_shapes", "balloon_" .. tostring(inst.balloon_num)) end if data.colour_idx then inst.colour_idx = math.min(#colours, data.colour_idx) inst.AnimState:SetMultColour(colours[inst.colour_idx][1],colours[inst.colour_idx][2],colours[inst.colour_idx][3],1) end end end inst:AddComponent("machine") inst.components.machine.turnonfn = turnon inst.components.machine.turnofffn = turnoff inst:AddComponent("equippable") inst.components.equippable:SetOnEquip( onequip ) inst.components.equippable:SetOnUnequip( onunequip ) inst.colour_idx = math.random(#colours) inst.AnimState:SetMultColour(colours[inst.colour_idx][1],colours[inst.colour_idx][2],colours[inst.colour_idx][3],1) inst.OnSave = onsave2 inst.OnLoad = onload2 即可使木箱具备不同颜色,找东西直接看颜色,再也不用翻箱倒柜了。木箱可搬动,对地上的木箱按鼠标右键,可拿起木箱。将木箱放在地上后,对其按鼠标右键,可以锁定在地上

2025/04/23 · Bny

YN231-随笔涂鸦(用蓝魔杖为物品涂上色彩)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二三一.随笔涂鸦(用蓝魔杖为物品涂上色彩) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/staff.lua文件,在local inst = commonfn("blue")的下一行插入以下内容: local function cancreatecolour(staff, caster, target, pos) return true end local function createcolour(staff, target, pos) local caster = staff.components.inventoryitem.owner if caster.components.sanity then caster.components.sanity:DoDelta(5) end local colours= { {198/255,43/255,43/255}, {79/255,153/255,68/255}, {35/255,105/255,235/255}, {233/255,208/255,69/255}, {109/255,50/255,163/255}, {222/255,126/255,39/255}, } inst.colour_idx = math.random(#colours) target.AnimState:SetMultColour(colours[inst.colour_idx][1],colours[inst.colour_idx][2],colours[inst.colour_idx][3],1) end inst:AddComponent("spellcaster") inst.components.spellcaster:SetSpellFn(createcolour) inst.components.spellcaster:SetSpellTestFn(cancreatecolour) inst.components.spellcaster.canuseontargets = true inst.components.spellcaster.canusefrominventory = false 即可用蓝魔杖右键点任何物品,为其涂上随机色彩,存档退出后消失。每涂鸦一次补脑5点。将你涂好的缤纷世界截下图片,给朋友秀秀吧

2025/04/23 · Bny

YN232-移动垃圾桶(狗箱增加删除物品按钮作垃圾桶)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二三二.移动垃圾桶(狗箱增加删除物品按钮作垃圾桶) 用MT管理器打开游戏目录/assets/scripts/prefabs/chester.lua文件,在inst:AddComponent("container")的下一行插入以下内容: local widgetbuttoninfo = { text = "Delete", position = Vector3(0, -195, 0), fn = function(inst) inst.components.container:DestroyContents() inst.SoundEmitter:PlaySound("dontstarve/common/destroy_stone") end } inst.components.container.widgetbuttoninfo = widgetbuttoninfo 即可在切斯特狗箱的格子下方增加一个Delete按钮,将不想要的物品放入狗箱,按下Delete按钮即可清除掉,让游戏不会因垃圾太多而越来越卡。不按钮的话,照常可以储存物品。千万不要把骨眼放入狗箱清除掉哦

2025/04/23 · Bny

YN233-垃圾洞(用饥饿腰带种垃圾洞,不想要的物品可扔进去销毁,夜晚自燃,白天熄灭)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二三三.垃圾洞(用饥饿腰带种垃圾洞,不想要的物品可扔进去销毁,夜晚自燃,白天熄灭) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/armor_slurper.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function wastehole(inst) local pt = inst:GetPosition() local wastehole = SpawnPrefab("armorslurper") wastehole.Transform:SetPosition(pt.x, pt.y, pt.z) wastehole.AnimState:SetBank("tentaclepillar") wastehole.AnimState:SetBuild("tentacle_pillar") wastehole.AnimState:PlayAnimation("idle_hole",true) wastehole.Transform:SetScale(0.5, 0.5, 0.5) wastehole.entity:AddSoundEmitter() MakeObstaclePhysics(wastehole, .5) wastehole:RemoveComponent("inventoryitem") wastehole:RemoveComponent("equippable") wastehole:RemoveComponent("fueled") wastehole:RemoveComponent("deployable") wastehole:RemoveTag("fur") wastehole:RemoveTag("ruins") local minimap = wastehole.entity:AddMiniMapEntity() minimap:SetIcon( "firepit.png" ) wastehole:AddComponent("burnable") wastehole.components.burnable:SetFXLevel(5) wastehole.components.burnable:AddBurnFX("character_fire", Vector3(0,1.5,0) ) wastehole:ListenForEvent("onignite", function() wastehole:AddComponent("heater") wastehole.components.heater.heat = 50 end ) wastehole:ListenForEvent("onextinguish", function() wastehole.SoundEmitter:PlaySound("dontstarve/common/fireOut") if wastehole.components.heater then wastehole:RemoveComponent("heater") end end ) wastehole:ListenForEvent( "daytime", function() wastehole.components.burnable:Extinguish() end , GetWorld()) wastehole:ListenForEvent( "dusktime", function() wastehole.components.burnable:Ignite(true) end , GetWorld()) wastehole:ListenForEvent( "nighttime", function() wastehole.components.burnable:Ignite(true) end , GetWorld()) if GetClock():IsDay() then wastehole.components.burnable:Extinguish() else wastehole.components.burnable:Ignite(true) end wastehole:AddComponent("workable") wastehole.components.workable:SetWorkAction(ACTIONS.HAMMER) wastehole.components.workable:SetWorkLeft(3) wastehole.components.workable:SetOnFinishCallback(function(wastehole) SpawnPrefab("collapse_big").Transform:SetPosition(wastehole.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") wastehole:Remove() end ) local slotpos = { Vector3(0,-75,0)} wastehole:AddComponent("container") wastehole.components.container:SetNumSlots(#slotpos) wastehole.components.container.widgetslotpos = slotpos wastehole.components.container.widgetpos = Vector3(0,600,0) wastehole.components.container.side_align_tip = 160 wastehole.components.container.itemtestfn = function(wastehole, item, slot) if item.prefab == "teleportato_ring" or item.prefab == "teleportato_box" or item.prefab == "teleportato_crank" or item.prefab == "teleportato_potato" or item.prefab == "chester_eyebone" or item.prefab == "abigail_flower" or item.prefab == "lucy" or item.prefab == "balloons_empty" or item.prefab == "lighter" or item.prefab == "waxwelljournal" then return false end return true end wastehole:DoPeriodicTask(0.25, function(wastehole) if not wastehole.components.container:IsEmpty() then wastehole.components.container:DestroyContents() wastehole.SoundEmitter:PlaySound("dontstarve/common/destroy_stone") local pt0 = wastehole:GetPosition() SpawnPrefab("collapse_small").Transform:SetPosition(pt0.x, 1, pt0.z) end end ) wastehole:AddTag("wastehole") end local function OnDeploy (inst, pt) wastehole(inst) inst:Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("wastehole") then data.wastehole = true end end local function onload(inst, data) if data and data.wastehole then wastehole(inst) inst:Remove() end end inst.OnSave = onsave inst.OnLoad = onload 即可用饥饿腰带种垃圾洞,除重要物品外(如露西斧子等),任何不想要的物品都可以扔进去销毁(拿着物品对垃圾洞点鼠标左键),再也不用发愁垃圾越来越多了。垃圾洞里有沼气,在夜晚时会自燃,白天熄灭,可用于照明和取暖,但不能用来烤食物。垃圾洞在小地图上显示为石头营火的图标,不想要垃圾洞时,用锤子砸毁即可。饥饿腰带在魔法选项(画着红骷髅)下,用6个啜食者皮、2个绳子、2个噩梦燃料制造

2025/04/23 · Bny

YN234-生物传送机(探矿杖左键点生物,右键传送到任意地点)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二三四.生物传送机(探矿杖左键点生物,右键传送到任意地点) 用MT管理器打开游戏目录/assets/scripts/prefabs/diviningrod.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function onattack(inst, owner, target) SpawnPrefab("lightning_rod_fx").Transform:SetPosition(target.Transform:GetWorldPosition()) target:AddTag("send") end local function canteleport(inst) return true end local function teleport(inst) local player = GetPlayer() local range = 3000 local pos = Vector3(player.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, range) for k,v in pairs(ents) do if v:HasTag("send") then v.Transform:SetPosition(TheInput:GetWorldPosition():Get()) v:RemoveTag("send") end end end inst:AddComponent("spellcaster") inst.components.spellcaster:SetSpellFn(teleport) inst.components.spellcaster:SetSpellTestFn(canteleport) inst.components.spellcaster.canusefrominventory = false inst.components.spellcaster.canuseonpoint = true inst:AddComponent("weapon") inst.components.weapon:SetDamage(0) inst.components.weapon:SetRange(30, 35) inst.components.weapon:SetOnAttack(onattack) inst.components.weapon:SetProjectile("bishop_charge") 即可在装备探矿杖时,用鼠标左键点生物(几个都可以),无论走到地图何处,装备探矿杖用鼠标右键点地面,都可将选中的生物传送过来。生物传送机可让群体性动物落单,让不会相遇的动物碰面,调离守护某处的敌人等。探矿杖在科学选项(画着原子)下,用1个树枝、4个噩梦燃料、1个齿轮制造

2025/04/23 · Bny

YN235-极速快递(拿着背包对地面点右键,将它传送回家)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二三五.极速快递(拿着背包对地面点右键,将它传送回家) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/backpack.lua文件,将inst.components.inventoryitem.cangoincontainer = false替换为以下内容: inst.components.inventoryitem.cangoincontainer = true local function OnDeploy (inst, pt) SpawnPrefab("collapse_small").Transform:SetPosition(inst.Transform:GetWorldPosition()) local pos = Vector3(inst.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 3000) for k,v in pairs(ents) do if v.prefab == "firepit" then inst.Transform:SetPosition(v.Transform:GetWorldPosition()) end end end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy inst:AddTag("fridge") 即可将拿不下的东西放在普通背包里,拿着背包对地面点鼠标右键,会自动传送到石头营火旁,再多的战利品都可以快递回家。背包同时具备冷藏功能,里面的食物可以长久保鲜。快递只在同一地层服务(不能从地下传送到地面),为保证快递投送准确,请在同一地层只保留一处石头营火(多处的话将随机投送)。如果之前修改过“同时携带多个背包”,就查找不到inst.components.inventoryitem.cangoincontainer = false这句,将inst.components.inventoryitem.cangoincontainer = true替换为下面的内容即可

2025/04/23 · Bny