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

YN266-虫洞地铁(虫洞可以搬到任意地点,搭建地铁网络)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二六六.虫洞地铁(虫洞可以搬到任意地点,搭建地铁网络) 用MT管理器打开游戏目录/assets/scripts/prefabs/wormhole.lua文件, 1.将doer.components.sanity:DoDelta(-TUNING.SANITY_MED)替换为doer.components.sanity:DoDelta(TUNING.SANITY_MED) 2.在inst:AddComponent("inspectable")的下一行插入以下内容: local function turnon(inst) inst.components.machine.ison = true inst.components.inventoryitem.canbepickedup = true end local function turnoff(inst) inst.components.machine.ison = false inst.components.inventoryitem.canbepickedup = false end inst:AddComponent("equippable") inst:AddComponent("inventoryitem") inst.components.inventoryitem:ChangeImageName("abigail_flower") inst.components.inventoryitem.canbepickedup = false inst:AddComponent("machine") inst.components.machine.turnonfn = turnon inst.components.machine.turnofffn = turnoff 即可对虫洞按鼠标右键解除锁在地上,再点左键就可以将它捡起(在物品栏里显示为一朵花的图片),到要放置的地点后,将虫洞拿出放在地上,对其点鼠标右键即可再次锁在地上。在家门口摆一排虫洞,将对应的虫洞放在想去的地方,组成自己的虫洞地铁网络吧。另外跳虫洞不但不会降脑,反而会补脑,让你出行的心情更加愉快

2025/04/23 · Bny

YN267-蜘蛛座骑(按键盘PageUP键召唤蜘蛛座骑,按PageDown键取消)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二六七.蜘蛛座骑(按键盘PageUP键召唤蜘蛛座骑,按PageDown键取消) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/player_common.lua文件,在inst:AddComponent("inventory")的下一行插入以下内容: TheInput:AddKeyUpHandler(KEY_PAGEUP, function() if inst.task then inst.task:Cancel() inst.task = nil end if inst.task2 then inst.task2:Cancel() inst.task2 = nil end if inst.doll then inst.doll:Remove() inst.doll = nil end inst.components.locomotor:Stop() inst.components.playercontroller:Enable(false) SpawnPrefab("collapse_big").Transform:SetPosition(inst.Transform:GetWorldPosition()) inst.SoundEmitter:PlaySound("dontstarve/creatures/spiderqueen/scream_short") inst:DoTaskInTime(0.1, function() inst.AnimState:SetBank("spider_queen") inst.AnimState:SetBuild("spider_queen_build") inst.AnimState:PlayAnimation("idle", true) inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst:SetStateGraph("SGspiderqueen") shadow:SetSize( 7, 3 ) inst.components.locomotor.walkspeed = 15 inst.components.locomotor.runspeed = 20 inst.components.health:SetInvincible(true) inst.components.hunger:Pause() inst.components.combat:SetDefaultDamage(300) inst.components.temperature:SetTemp(20) inst.components.playercontroller:Enable(true) local pt = GetPlayer():GetPosition() inst.doll = SpawnPrefab( "beardhair" ) inst.doll.Transform:SetPosition(pt.x, 3.5, pt.z) inst.doll.Physics:SetActive(false) inst.doll.AnimState:SetBank("wilson") inst.doll.AnimState:SetBuild(name) inst.doll.AnimState:OverrideSymbol("swap_object", "swap_spear", "swap_spear") inst.doll.AnimState:Hide("ARM_normal") inst.doll.AnimState:Show("ARM_carry") inst.doll.Transform:SetFourFaced() inst.doll.AnimState:PlayAnimation("idle") inst.doll:RemoveComponent("burnable") inst.doll:RemoveComponent("propagator") inst.doll:RemoveComponent("inspectable") inst.doll:RemoveComponent("inventoryitem") inst.doll:RemoveComponent("stackable") inst.doll:RemoveComponent("fuel") inst.task = inst:DoPeriodicTask(.05, function() local pt1 = GetPlayer():GetPosition() inst.doll.Transform:SetPosition(pt1.x, 3.5, pt1.z) inst.doll.Transform:SetRotation(GetPlayer().Transform:GetRotation()) end ) inst.task2 = inst:DoPeriodicTask(10, function() inst.doll.AnimState:PlayAnimation("give",true) inst:DoTaskInTime(2.2, function() inst.doll.AnimState:PlayAnimation("idle") end ) end ) end ) end ) TheInput:AddKeyUpHandler(KEY_PAGEDOWN, function() inst.components.locomotor:Stop() inst.components.playercontroller:Enable(false) SpawnPrefab("collapse_big").Transform:SetPosition(inst.Transform:GetWorldPosition()) inst.SoundEmitter:PlaySound("dontstarve/creatures/spiderqueen/scream_short") inst:DoTaskInTime(0.1, function() inst.AnimState:SetBank("wilson") inst.AnimState:SetBuild(name) inst.AnimState:PlayAnimation("idle") inst.AnimState:SetBloomEffectHandle("") inst:SetStateGraph("SGwilson") shadow:SetSize( 1.3, .6 ) inst.components.locomotor.walkspeed = TUNING.WILSON_WALK_SPEED inst.components.locomotor.runspeed = TUNING.WILSON_RUN_SPEED inst.components.health:SetInvincible(false) inst.components.hunger:Resume() inst.components.combat:SetDefaultDamage(TUNING.UNARMED_DAMAGE) inst.components.temperature:SetTemp(nil) inst.components.playercontroller:Enable(true) if inst.task then inst.task:Cancel() inst.task = nil end if inst.task2 then inst.task2:Cancel() inst.task2 = nil end if inst.doll then inst.doll:Remove() inst.doll = nil end end ) end ) 即可按键盘PageUP键召唤蜘蛛座骑(自动骑在蜘蛛身上),按PageDown键取消座骑。攻击时对敌人按Ctrl + 鼠标左键(也可以按住F键连续还击)。骑在蜘蛛身上时,敌人无法打到主角,所以主角不会掉血

2025/04/23 · Bny

YN268-喷气虫座骑(用夏日背心种喷气虫座骑,左键点虫可骑乘,右键点主角可下来,给草让它原地等待)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二六八.喷气虫座骑(用夏日背心种喷气虫座骑,左键点虫可骑乘,右键点主角可下来,给草让它原地等待) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/trunkvest.lua文件,在inst.AnimState:SetBuild("armor_trunkvest_summer")的下一行插入以下内容: local function OnDeploy (inst, pt) local jet = SpawnPrefab("trunkvest_summer") jet.Transform:SetPosition(pt.x, pt.y, pt.z) jet.AnimState:SetBank("glommer") jet.AnimState:SetBuild("glommer") jet.AnimState:PlayAnimation("idle_loop") jet.Transform:SetFourFaced() jet.entity:AddSoundEmitter() local shadow = jet.entity:AddDynamicShadow() shadow:SetSize( 2, .75 ) local minimap = jet.entity:AddMiniMapEntity() minimap:SetIcon("glommer.png") jet:AddComponent("named") jet.components.named:SetName("Glommer") jet:RemoveComponent("inventoryitem") jet:RemoveComponent("equippable") jet:RemoveComponent("insulator") jet:RemoveComponent("fueled") jet:RemoveComponent("waterproofer") jet:RemoveComponent("deployable") jet:AddComponent("knownlocations") jet:AddComponent("follower") jet.components.follower:SetLeader(GetPlayer()) jet:AddComponent("lootdropper") jet:AddComponent("health") jet.components.health:SetMaxHealth(2000) jet:AddComponent("combat") jet:AddComponent("locomotor") jet.components.locomotor.walkspeed = 15 jet:SetStateGraph("SGglommer") local brain = require "brains/chesterbrain" jet:SetBrain(brain) jet:AddComponent("trader") jet.components.trader:SetAcceptTest(function(jet, item) if not jet:HasTag("driving") then if item.prefab == "cutgrass" then return true end end return false end ) jet.components.trader.onaccept = function(jet, giver, item) jet.components.health:DoDelta(2000) if not jet:HasTag("stophere") then jet:AddTag("stophere") jet.components.locomotor:Stop() jet:SetBrain(nil) jet.components.follower:SetLeader(nil) else jet:RemoveTag("stophere") local brain = require "brains/chesterbrain" jet:SetBrain(brain) jet:RestartBrain() jet.components.follower:SetLeader(GetPlayer()) end end jet.components.inspectable.getstatus = function() if not jet:HasTag("driving") then jet:AddTag("driving") jet:RemoveTag("stophere") jet.components.locomotor:Stop() local shadow = jet.entity:AddDynamicShadow() shadow:SetSize( 0, 0 ) jet.Physics:SetActive(false) jet:SetStateGraph("SGshadowwaxwell") jet:SetBrain(nil) jet.components.follower:SetLeader(nil) jet.AnimState:SetBank("wilson") if GetPlayer().prefab == "wilson" then jet.AnimState:SetBuild("wilson") end if GetPlayer().prefab == "wendy" then jet.AnimState:SetBuild("wendy") end if GetPlayer().prefab == "wes" then jet.AnimState:SetBuild("wes") end if GetPlayer().prefab == "wickerbottom" then jet.AnimState:SetBuild("wickerbottom") end if GetPlayer().prefab == "willow" then jet.AnimState:SetBuild("willow") end if GetPlayer().prefab == "wolfgang" then jet.AnimState:SetBuild("wolfgang") end if GetPlayer().prefab == "wx78" then jet.AnimState:SetBuild("wx78") end if GetPlayer().prefab == "woodie" then jet.AnimState:SetBuild("woodie") end if GetPlayer().prefab == "waxwell" then jet.AnimState:SetBuild("waxwell") end if GetPlayer().prefab == "wathgrithr" then jet.AnimState:SetBuild("wathgrithr") end if GetPlayer().prefab == "webber" then jet.AnimState:SetBuild("webber") end jet.AnimState:PlayAnimation("idle") jet.AnimState:Hide("ARM_carry") jet.AnimState:Show("ARM_normal") jet.Transform:SetRotation( 0 ) jet.task = jet:DoPeriodicTask(0.05, function(jet) local pt1 = GetPlayer():GetPosition() jet.Transform:SetPosition(pt1.x, 3.5, pt1.z) jet.Transform:SetRotation(GetPlayer().Transform:GetRotation()) end ) GetPlayer().AnimState:SetBank("glommer") GetPlayer().AnimState:SetBuild("glommer") GetPlayer().AnimState:PlayAnimation("idle_loop") GetPlayer():SetStateGraph("SGglommer") local shadow = GetPlayer().entity:AddDynamicShadow() shadow:SetSize( 2, .75 ) GetPlayer().components.locomotor.walkspeed = 25 GetPlayer().components.locomotor.runspeed = 25 GetPlayer().components.health:SetInvincible(true) GetPlayer().components.hunger:Pause() GetPlayer().components.temperature:SetTemp(20) GetPlayer().components.playeractionpicker.leftclickoverride = function(target_ent, pos) if GetPlayer().components.combat:CanTarget(target_ent) then return GetPlayer().components.playeractionpicker:SortActionList({ACTIONS.LOOKAT}, target_ent, nil) end end else jet:RemoveTag("driving") local shadow = jet.entity:AddDynamicShadow() shadow:SetSize( 2, .75 ) jet.Physics:SetActive(true) jet.AnimState:SetBank("glommer") jet.AnimState:SetBuild("glommer") jet.AnimState:PlayAnimation("idle_loop") jet:SetStateGraph("SGglommer") local brain = require "brains/chesterbrain" jet:SetBrain(brain) jet:RestartBrain() jet.components.follower:SetLeader(GetPlayer()) if jet.task then jet.task:Cancel() jet.task = nil end local pt1 = GetPlayer():GetPosition() jet.Transform:SetPosition(pt1.x, 0, pt1.z) GetPlayer().AnimState:SetBank("wilson") if GetPlayer().prefab == "wilson" then GetPlayer().AnimState:SetBuild("wilson") end if GetPlayer().prefab == "wendy" then GetPlayer().AnimState:SetBuild("wendy") end if GetPlayer().prefab == "wes" then GetPlayer().AnimState:SetBuild("wes") end if GetPlayer().prefab == "wickerbottom" then GetPlayer().AnimState:SetBuild("wickerbottom") end if GetPlayer().prefab == "willow" then GetPlayer().AnimState:SetBuild("willow") end if GetPlayer().prefab == "wolfgang" then GetPlayer().AnimState:SetBuild("wolfgang") end if GetPlayer().prefab == "wx78" then GetPlayer().AnimState:SetBuild("wx78") end if GetPlayer().prefab == "woodie" then GetPlayer().AnimState:SetBuild("woodie") end if GetPlayer().prefab == "waxwell" then GetPlayer().AnimState:SetBuild("waxwell") end if GetPlayer().prefab == "wathgrithr" then GetPlayer().AnimState:SetBuild("wathgrithr") end if GetPlayer().prefab == "webber" then GetPlayer().AnimState:SetBuild("webber") end GetPlayer().AnimState:PlayAnimation("idle") GetPlayer():SetStateGraph("SGwilson") local shadow = GetPlayer().entity:AddDynamicShadow() shadow:SetSize( 1.3, .6 ) GetPlayer().components.locomotor.walkspeed = TUNING.WILSON_WALK_SPEED GetPlayer().components.locomotor.runspeed = TUNING.WILSON_RUN_SPEED GetPlayer().components.health:SetInvincible(false) GetPlayer().components.hunger:Resume() GetPlayer().components.temperature:SetTemp(nil) GetPlayer().components.playeractionpicker.leftclickoverride = nil end end jet:AddTag("jets") inst:Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("jets") then data.jets = true end if inst:HasTag("stophere") then data.stophere = true end end local function onload(inst, data) if data and data.jets then inst.AnimState:SetBank("glommer") inst.AnimState:SetBuild("glommer") inst.AnimState:PlayAnimation("idle_loop") inst.Transform:SetFourFaced() inst.entity:AddSoundEmitter() local shadow = inst.entity:AddDynamicShadow() shadow:SetSize( 2, .75 ) local minimap = inst.entity:AddMiniMapEntity() minimap:SetIcon("glommer.png") inst:AddComponent("named") inst.components.named:SetName("Glommer") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("equippable") inst:RemoveComponent("insulator") inst:RemoveComponent("fueled") inst:RemoveComponent("waterproofer") inst:RemoveComponent("deployable") inst:AddComponent("knownlocations") inst:AddComponent("follower") inst.components.follower:SetLeader(GetPlayer()) inst:AddComponent("lootdropper") inst:AddComponent("health") inst.components.health:SetMaxHealth(2000) inst:AddComponent("combat") inst:AddComponent("locomotor") inst.components.locomotor.walkspeed = 15 inst:SetStateGraph("SGglommer") local brain = require "brains/chesterbrain" inst:SetBrain(brain) inst:AddComponent("trader") inst.components.trader:SetAcceptTest(function(inst, item) if not inst:HasTag("driving") then if item.prefab == "cutgrass" then return true end end return false end ) inst.components.trader.onaccept = function(inst, giver, item) inst.components.health:DoDelta(2000) if not inst:HasTag("stophere") then inst:AddTag("stophere") inst.components.locomotor:Stop() inst:SetBrain(nil) inst.components.follower:SetLeader(nil) else inst:RemoveTag("stophere") local brain = require "brains/chesterbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(GetPlayer()) end end inst.components.inspectable.getstatus = function() if not inst:HasTag("driving") then inst:AddTag("driving") inst:RemoveTag("stophere") inst.components.locomotor:Stop() local shadow = inst.entity:AddDynamicShadow() shadow:SetSize( 0, 0 ) inst.Physics:SetActive(false) inst:SetStateGraph("SGshadowwaxwell") inst:SetBrain(nil) inst.components.follower:SetLeader(nil) inst.AnimState:SetBank("wilson") if GetPlayer().prefab == "wilson" then inst.AnimState:SetBuild("wilson") end if GetPlayer().prefab == "wendy" then inst.AnimState:SetBuild("wendy") end if GetPlayer().prefab == "wes" then inst.AnimState:SetBuild("wes") end if GetPlayer().prefab == "wickerbottom" then inst.AnimState:SetBuild("wickerbottom") end if GetPlayer().prefab == "willow" then inst.AnimState:SetBuild("willow") end if GetPlayer().prefab == "wolfgang" then inst.AnimState:SetBuild("wolfgang") end if GetPlayer().prefab == "wx78" then inst.AnimState:SetBuild("wx78") end if GetPlayer().prefab == "woodie" then inst.AnimState:SetBuild("woodie") end if GetPlayer().prefab == "waxwell" then inst.AnimState:SetBuild("waxwell") end if GetPlayer().prefab == "wathgrithr" then inst.AnimState:SetBuild("wathgrithr") end if GetPlayer().prefab == "webber" then inst.AnimState:SetBuild("webber") end inst.AnimState:PlayAnimation("idle") inst.AnimState:Hide("ARM_carry") inst.AnimState:Show("ARM_normal") inst.Transform:SetRotation( 0 ) inst.task = inst:DoPeriodicTask(0.05, function(inst) local pt1 = GetPlayer():GetPosition() inst.Transform:SetPosition(pt1.x, 3.5, pt1.z) inst.Transform:SetRotation(GetPlayer().Transform:GetRotation()) end ) GetPlayer().AnimState:SetBank("glommer") GetPlayer().AnimState:SetBuild("glommer") GetPlayer().AnimState:PlayAnimation("idle_loop") GetPlayer():SetStateGraph("SGglommer") local shadow = GetPlayer().entity:AddDynamicShadow() shadow:SetSize( 2, .75 ) GetPlayer().components.locomotor.walkspeed = 25 GetPlayer().components.locomotor.runspeed = 25 GetPlayer().components.health:SetInvincible(true) GetPlayer().components.hunger:Pause() GetPlayer().components.temperature:SetTemp(20) GetPlayer().components.playeractionpicker.leftclickoverride = function(target_ent, pos) if GetPlayer().components.combat:CanTarget(target_ent) then return GetPlayer().components.playeractionpicker:SortActionList({ACTIONS.LOOKAT}, target_ent, nil) end end else inst:RemoveTag("driving") local shadow = inst.entity:AddDynamicShadow() shadow:SetSize( 2, .75 ) inst.Physics:SetActive(true) inst.AnimState:SetBank("glommer") inst.AnimState:SetBuild("glommer") inst.AnimState:PlayAnimation("idle_loop") inst:SetStateGraph("SGglommer") local brain = require "brains/chesterbrain" inst:SetBrain(brain) inst:RestartBrain() inst.components.follower:SetLeader(GetPlayer()) if inst.task then inst.task:Cancel() inst.task = nil end local pt1 = GetPlayer():GetPosition() inst.Transform:SetPosition(pt1.x, 0, pt1.z) GetPlayer().AnimState:SetBank("wilson") if GetPlayer().prefab == "wilson" then GetPlayer().AnimState:SetBuild("wilson") end if GetPlayer().prefab == "wendy" then GetPlayer().AnimState:SetBuild("wendy") end if GetPlayer().prefab == "wes" then GetPlayer().AnimState:SetBuild("wes") end if GetPlayer().prefab == "wickerbottom" then GetPlayer().AnimState:SetBuild("wickerbottom") end if GetPlayer().prefab == "willow" then GetPlayer().AnimState:SetBuild("willow") end if GetPlayer().prefab == "wolfgang" then GetPlayer().AnimState:SetBuild("wolfgang") end if GetPlayer().prefab == "wx78" then GetPlayer().AnimState:SetBuild("wx78") end if GetPlayer().prefab == "woodie" then GetPlayer().AnimState:SetBuild("woodie") end if GetPlayer().prefab == "waxwell" then GetPlayer().AnimState:SetBuild("waxwell") end if GetPlayer().prefab == "wathgrithr" then GetPlayer().AnimState:SetBuild("wathgrithr") end if GetPlayer().prefab == "webber" then GetPlayer().AnimState:SetBuild("webber") end GetPlayer().AnimState:PlayAnimation("idle") GetPlayer():SetStateGraph("SGwilson") local shadow = GetPlayer().entity:AddDynamicShadow() shadow:SetSize( 1.3, .6 ) GetPlayer().components.locomotor.walkspeed = TUNING.WILSON_WALK_SPEED GetPlayer().components.locomotor.runspeed = TUNING.WILSON_RUN_SPEED GetPlayer().components.health:SetInvincible(false) GetPlayer().components.hunger:Resume() GetPlayer().components.temperature:SetTemp(nil) GetPlayer().components.playeractionpicker.leftclickoverride = nil end end inst:AddTag("jets") end if data and data.stophere then inst.components.locomotor:Stop() inst:SetBrain(nil) inst.components.follower:SetLeader(nil) inst:AddTag("stophere") end end inst.OnSave = onsave inst.OnLoad = onload 即可用夏日背心种喷气虫座骑,对喷气虫点鼠标左键(手里不要拿武器)可骑乘,对主角按鼠标右键可下来。骑着喷气虫时无法战斗,但遭到攻击时不会受伤(敌人够不到你)。喷气虫会跟随你,喂它一根草(拿着草对它点鼠标左键)可让其停在原地,并同时补血,再给一根草可继续跟随。喷气虫座骑在小地图上显示为格罗门图标,不想要喷气虫座骑了,杀掉即可(按Ctrl + 鼠标左键攻击)。夏日背心在穿戴选项(画着帽子)下,用1个红色象鼻、8个蛛丝制造

2025/04/23 · Bny

YN269-公车站(用草席卷种公车站,买票坐到下一站)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二六九.公车站(用草席卷种公车站,买票坐到下一站) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/bedroll_straw.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: inst.kind = "" inst.soundpath = "dontstarve/creatures/rook/" inst.effortsound = "dontstarve/creatures/rook/steam" local function OnDeploy (inst, pt) local busstation = SpawnPrefab("bedroll_straw") busstation.Transform:SetPosition(pt.x, pt.y, pt.z) busstation.AnimState:SetBank("sign_home") busstation.AnimState:SetBuild("sign_home") busstation.AnimState:PlayAnimation("idle") busstation.Transform:SetScale(1.5, 1.5, 1.5) busstation.AnimState:SetMultColour(255/255,105/255,0/255,0.8) local minimap = busstation.entity:AddMiniMapEntity() minimap:SetIcon( "sign.png" ) busstation:RemoveComponent("inventoryitem") busstation:RemoveComponent("stackable") busstation:RemoveComponent("fuel") busstation:RemoveComponent("sleepingbag") busstation:RemoveComponent("burnable") busstation:RemoveComponent("propagator") busstation:RemoveComponent("deployable") busstation:AddTag("busstation") busstation:AddComponent("workable") busstation.components.workable:SetWorkAction(ACTIONS.HAMMER) busstation.components.workable:SetWorkLeft(3) busstation.components.workable:SetOnFinishCallback(function(busstation) SpawnPrefab("collapse_big").Transform:SetPosition(busstation.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") busstation:Remove() end ) busstation:AddComponent("trader") busstation.components.trader:SetAcceptTest(function(busstation, item) if item.prefab == "goldnugget" then return true end return false end ) busstation.components.trader.onaccept = function(busstation, giver, item) busstation:AddTag("startingpoint") local target = FindEntity(busstation, 3000, function(guy) return guy:HasTag("busstation") and not guy:HasTag("startingpoint") end ) if target then GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") GetPlayer().components.playercontroller:Enable(false) local pt1 = busstation:GetPosition() local bus = SpawnPrefab("bedroll_straw") bus.Transform:SetPosition(pt1.x+15+2, 0, pt1.z-15+2) bus.AnimState:SetBank("rook") bus.AnimState:SetBuild("rook_build") bus.AnimState:PlayAnimation("idle", true) bus.Transform:SetFourFaced() bus.Transform:SetScale(1.2, 1.2, 1.2) bus.AnimState:SetMultColour(255/255,105/255,0/255,1) local sound = bus.entity:AddSoundEmitter() bus:RemoveComponent("inventoryitem") bus:RemoveComponent("stackable") bus:RemoveComponent("fuel") bus:RemoveComponent("sleepingbag") bus:RemoveComponent("burnable") bus:RemoveComponent("propagator") bus:RemoveComponent("deployable") bus:AddTag("goodbye") bus:AddComponent("locomotor") bus.components.locomotor.walkspeed = 5 bus.components.locomotor.runspeed = 10 bus:SetStateGraph("SGrook") bus:AddComponent("health") bus.components.health:SetMaxHealth(1000) bus.components.health:SetInvincible(true) bus:AddComponent("combat") bus:AddComponent("follower") bus:AddComponent("knownlocations") bus:DoTaskInTime(1, function() bus.components.locomotor:GoToPoint(Point(pt1.x+2, 0, pt1.z+2)) end ) bus:DoTaskInTime(9, function() GetPlayer():Hide() GetPlayer().components.health:SetInvincible(true) local shadow = GetPlayer().entity:AddDynamicShadow() shadow:SetSize( 0, 0 ) bus.components.locomotor:GoToPoint(Point(pt1.x-15+2, 0, pt1.z+15+2)) end ) GetPlayer():DoTaskInTime(15, function() TheFrontEnd:Fade(false,1) bus:Remove() GetPlayer().Transform:SetPosition(target.Transform:GetWorldPosition()) GetPlayer():DoTaskInTime(2, function() TheFrontEnd:Fade(true,1) busstation:RemoveTag("startingpoint") GetPlayer():Show() GetPlayer().components.health:SetInvincible(false) GetPlayer().components.playercontroller:Enable(true) local shadow = GetPlayer().entity:AddDynamicShadow() shadow:SetSize( 1.3, .6 ) end ) end ) else SpawnPrefab("goldnugget").Transform:SetPosition(GetPlayer().Transform:GetWorldPosition()) busstation:RemoveTag("startingpoint") end end inst.components.stackable:Get():Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("goodbye") then data.goodbye = true end if inst:HasTag("busstation") then data.busstation = true end end local function onload(inst, data) if data and data.goodbye then inst:Remove() end if data and data.busstation then inst.AnimState:SetBank("sign_home") inst.AnimState:SetBuild("sign_home") inst.AnimState:PlayAnimation("idle") inst.Transform:SetScale(1.5, 1.5, 1.5) inst.AnimState:SetMultColour(255/255,105/255,0/255,0.8) local minimap = inst.entity:AddMiniMapEntity() minimap:SetIcon( "sign.png" ) inst:RemoveComponent("inventoryitem") inst:RemoveComponent("stackable") inst:RemoveComponent("fuel") inst:RemoveComponent("sleepingbag") inst:RemoveComponent("burnable") inst:RemoveComponent("propagator") inst:RemoveComponent("deployable") inst:AddTag("busstation") inst:AddComponent("workable") inst.components.workable:SetWorkAction(ACTIONS.HAMMER) inst.components.workable:SetWorkLeft(3) inst.components.workable:SetOnFinishCallback(function(inst) SpawnPrefab("collapse_big").Transform:SetPosition(inst.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") inst:Remove() end ) inst:AddComponent("trader") inst.components.trader:SetAcceptTest(function(inst, item) if item.prefab == "goldnugget" then return true end return false end ) inst.components.trader.onaccept = function(inst, giver, item) inst:AddTag("startingpoint") local target = FindEntity(inst, 3000, function(guy) return guy:HasTag("busstation") and not guy:HasTag("startingpoint") end ) if target then GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") GetPlayer().components.playercontroller:Enable(false) local pt1 = inst:GetPosition() local bus = SpawnPrefab("bedroll_straw") bus.Transform:SetPosition(pt1.x+15+2, 0, pt1.z-15+2) bus.AnimState:SetBank("rook") bus.AnimState:SetBuild("rook_build") bus.AnimState:PlayAnimation("idle", true) bus.Transform:SetFourFaced() bus.Transform:SetScale(1.2, 1.2, 1.2) bus.AnimState:SetMultColour(255/255,105/255,0/255,1) local sound = bus.entity:AddSoundEmitter() bus:RemoveComponent("inventoryitem") bus:RemoveComponent("stackable") bus:RemoveComponent("fuel") bus:RemoveComponent("sleepingbag") bus:RemoveComponent("burnable") bus:RemoveComponent("propagator") bus:RemoveComponent("deployable") bus:AddTag("goodbye") bus:AddComponent("locomotor") bus.components.locomotor.walkspeed = 5 bus.components.locomotor.runspeed = 10 bus:SetStateGraph("SGrook") bus:AddComponent("health") bus.components.health:SetMaxHealth(1000) bus.components.health:SetInvincible(true) bus:AddComponent("combat") bus:AddComponent("follower") bus:AddComponent("knownlocations") bus:DoTaskInTime(1, function() bus.components.locomotor:GoToPoint(Point(pt1.x+2, 0, pt1.z+2)) end ) bus:DoTaskInTime(9, function() GetPlayer():Hide() GetPlayer().components.health:SetInvincible(true) local shadow = GetPlayer().entity:AddDynamicShadow() shadow:SetSize( 0, 0 ) bus.components.locomotor:GoToPoint(Point(pt1.x-15+2, 0, pt1.z+15+2)) end ) GetPlayer():DoTaskInTime(15, function() TheFrontEnd:Fade(false,1) bus:Remove() GetPlayer().Transform:SetPosition(target.Transform:GetWorldPosition()) GetPlayer():DoTaskInTime(2, function() TheFrontEnd:Fade(true,1) inst:RemoveTag("startingpoint") GetPlayer():Show() GetPlayer().components.health:SetInvincible(false) GetPlayer().components.playercontroller:Enable(true) local shadow = GetPlayer().entity:AddDynamicShadow() shadow:SetSize( 1.3, .6 ) end ) end ) else SpawnPrefab("goldnugget").Transform:SetPosition(GetPlayer().Transform:GetWorldPosition()) inst:RemoveTag("startingpoint") end end end end inst.OnSave = onsave inst.OnLoad = onload 即可在地图的任意两个地点,用草席卷种公车站,给站牌1个黄金(拿着黄金对站牌点鼠标左键),会来公共汽车送你到另一个站牌,方便在两点间快速移动。公车站须种在空旷的地方,以便公共汽车行驶。如果只种了一个公车站,则站牌不会接受你的黄金。公车站在小地图上显示为路牌的图标。不想要公车站时,用锤子砸掉即可。草席卷在生存选项下(画着绳套)下,用6个草、1个绳子制造

2025/04/23 · Bny

YN270-筋斗云(按键盘Z键召唤筋斗云在天上飞行,再按Z键落地)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二七0.筋斗云(按键盘Z键召唤筋斗云在天上飞行,再按Z键落地) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/player_common.lua文件,在inst:AddComponent("resurrectable")的下一行插入以下内容: TheInput:AddKeyUpHandler(KEY_Z, function() if not inst:HasTag("flycloud") then inst:AddTag("flycloud") inst.components.locomotor:Stop() inst.components.talker:ShutUp() SpawnPrefab("collapse_small").Transform:SetPosition(inst.Transform:GetWorldPosition()) inst.AnimState:PlayAnimation("give") inst:DoTaskInTime(0.3, function() inst.cloud = SpawnPrefab("corn_cooked") inst.cloud.Physics:SetActive(false) inst.cloud.Transform:SetScale(1.8, 1.8, 1.8) inst.cloud.AnimState:SetMultColour(255/255,255/255,255/255,0.6) inst.cloud.AnimState:SetBloomEffectHandle("shaders/anim.ksh") inst.cloud:RemoveComponent("perishable") inst.cloud:RemoveComponent("edible") inst.cloud:RemoveComponent("stackable") inst.cloud:RemoveComponent("inventoryitem") inst.cloud:RemoveComponent("bait") inst.cloud:RemoveComponent("tradable") inst.cloud:RemoveComponent("burnable") inst.cloud:RemoveComponent("propagator") inst.cloud.persists = false inst.cloud:AddTag("NOCLICK") local follower = inst.cloud.entity:AddFollower() follower:FollowSymbol( inst.GUID, "swap_body", 0, 60, 0 ) local pt = inst:GetPosition() inst.Transform:SetPosition(pt.x, 10, pt.z) local shadow = inst.entity:AddDynamicShadow() shadow:SetSize( 0, 0 ) inst.gogogo = inst:DoPeriodicTask(.01, function() inst.Physics:SetMotorVelOverride(25,1.5,0) end) end ) else inst:RemoveTag("flycloud") inst.components.locomotor:Stop() inst.components.talker:ShutUp() SpawnPrefab("collapse_small").Transform:SetPosition(inst.Transform:GetWorldPosition()) inst.AnimState:PlayAnimation("give") inst:DoTaskInTime(0.3, function() if inst.cloud then inst.cloud:Remove() inst.cloud = nil end if inst.gogogo then inst.gogogo:Cancel() inst.gogogo = nil end local pt = inst:GetPosition() inst.Transform:SetPosition(pt.x, 0, pt.z) local shadow = inst.entity:AddDynamicShadow() shadow:SetSize( 1.3, .6 ) inst.Physics:ClearMotorVelOverride() inst.Physics:ClearMotorVelOverride() end ) end end ) 即可口中默念咒语——“走你”,并按下键盘Z键,召唤筋斗云在天上飞行,用键盘W、S、A、D键控制方向,再次按Z键可落地

2025/04/23 · Bny

YN271-全自动播种机(给避雷针植物,自动种下一百多个)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二七一.全自动播种机(给避雷针植物,自动种下一百多个) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/lightningrod.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local slotpos = { Vector3(0,-75,0)} local function itemtest(inst, item, slot) if item.prefab == "twigs" or item.prefab == "cutgrass" or item.prefab == "petals" or item.prefab == "petals_evil" or item.prefab == "cutreeds" or item.prefab == "red_cap" or item.prefab == "green_cap" or item.prefab == "blue_cap" or item.prefab == "carrot" or item.prefab == "berries" or item.prefab == "mandrake" or item.prefab == "foliage" or item.prefab == "cave_banana" or item.prefab == "cutlichen" or item.prefab == "lightbulb" or item.prefab == "pinecone" or item.prefab == "charcoal" or item.prefab == "acorn" or item.prefab == "cactus_meat" then return true end return false end local widgetbuttoninfo = { text = "Do", position = Vector3(0, -145, 0), fn = function(inst) if GetPlayer().components.inventory:Has("goldnugget", 50) then if inst.components.container:Has("twigs", 1) then inst.components.container:ConsumeByName("twigs", 1) inst.plants = "sapling" GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) end if inst.components.container:Has("cutgrass", 1) then inst.components.container:ConsumeByName("cutgrass", 1) inst.plants = "grass" GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) end if inst.components.container:Has("petals", 1) then inst.components.container:ConsumeByName("petals", 1) inst.plants = "flower" GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) end if inst.components.container:Has("petals_evil", 1) then inst.components.container:ConsumeByName("petals_evil", 1) inst.plants = "flower_evil" GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) end if inst.components.container:Has("cutreeds", 1) then inst.components.container:ConsumeByName("cutreeds", 1) inst.plants = "reeds" GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) end if inst.components.container:Has("red_cap", 1) then inst.components.container:ConsumeByName("red_cap", 1) inst.plants = "red_mushroom" GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) end if inst.components.container:Has("green_cap", 1) then inst.components.container:ConsumeByName("green_cap", 1) inst.plants = "green_mushroom" GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) end if inst.components.container:Has("blue_cap", 1) then inst.components.container:ConsumeByName("blue_cap", 1) inst.plants = "blue_mushroom" GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) end if inst.components.container:Has("carrot", 1) then inst.components.container:ConsumeByName("carrot", 1) inst.plants = "carrot_planted" GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) end if inst.components.container:Has("berries", 1) then inst.components.container:ConsumeByName("berries", 1) inst.plants = "berrybush2" GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) end if inst.components.container:Has("mandrake", 1) then inst.components.container:ConsumeByName("mandrake", 1) inst.plants = "mandrake" GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) end if inst.components.container:Has("foliage", 1) then inst.components.container:ConsumeByName("foliage", 1) inst.plants = "cave_fern" GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) end if inst.components.container:Has("cave_banana", 1) then inst.components.container:ConsumeByName("cave_banana", 1) inst.plants = "cave_banana_tree" GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) end if inst.components.container:Has("cutlichen", 1) then inst.components.container:ConsumeByName("cutlichen", 1) inst.plants = "lichen" GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) end if inst.components.container:Has("lightbulb", 1) then inst.components.container:ConsumeByName("lightbulb", 1) inst.plants = "flower_cave_triple" GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) end if inst.components.container:Has("pinecone", 1) then inst.components.container:ConsumeByName("pinecone", 1) inst.plants = "evergreen_tall" GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) end if inst.components.container:Has("charcoal", 1) then inst.components.container:ConsumeByName("charcoal", 1) inst.plants = "mushtree_tall" GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) end if inst.components.container:Has("acorn", 1) then inst.components.container:ConsumeByName("acorn", 1) inst.plants = "deciduoustree_tall" GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) end if inst.components.container:Has("cactus_meat", 1) then inst.components.container:ConsumeByName("cactus_meat", 1) inst.plants = "cactus" GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) end local pt = Vector3(inst.Transform:GetWorldPosition()) inst:StartThread(function() for k = 1, 25 do local result_offset = FindValidPositionByFan(1 * 2 * PI, 4, 25, function(offset) local x,y,z = (pt + offset):Get() local ents = TheSim:FindEntities(x,y,z , 1) return not next(ents) end) if result_offset then local plant = SpawnPrefab(inst.plants) plant.Transform:SetPosition((pt + result_offset):Get()) GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.2, 0.02, .25, 40) local fx = SpawnPrefab("splash_ocean") local pos = pt + result_offset fx.Transform:SetPosition(pos.x, pos.y, pos.z) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") end Sleep(.33) end for k = 1, 37 do local result_offset = FindValidPositionByFan(1 * 2 * PI, 6, 37, function(offset) local x,y,z = (pt + offset):Get() local ents = TheSim:FindEntities(x,y,z , 1) return not next(ents) end) if result_offset then local plant = SpawnPrefab(inst.plants) plant.Transform:SetPosition((pt + result_offset):Get()) GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.2, 0.02, .25, 40) local fx = SpawnPrefab("splash_ocean") local pos = pt + result_offset fx.Transform:SetPosition(pos.x, pos.y, pos.z) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") end Sleep(.23) end for k = 1, 50 do local result_offset = FindValidPositionByFan(1 * 2 * PI, 8, 50, function(offset) local x,y,z = (pt + offset):Get() local ents = TheSim:FindEntities(x,y,z , 1) return not next(ents) end) if result_offset then local plant = SpawnPrefab(inst.plants) plant.Transform:SetPosition((pt + result_offset):Get()) GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.2, 0.02, .25, 40) local fx = SpawnPrefab("splash_ocean") local pos = pt + result_offset fx.Transform:SetPosition(pos.x, pos.y, pos.z) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") end Sleep(.13) end end) end end } inst:AddComponent("container") inst.components.container:SetNumSlots(#slotpos) inst.components.container.widgetslotpos = slotpos inst.components.container.widgetpos = Vector3(0,180,0) inst.components.container.side_align_tip = 160 inst.components.container.itemtestfn = itemtest inst.components.container.acceptsstacks = false inst.components.container.widgetbuttoninfo = widgetbuttoninfo 即可在空旷的地上建一个避雷针,鼠标左键点避雷针可打开格子,在格子中放入植物后点Do按钮,可自动种下100多株该植物,将花费50个黄金,身上黄金数不足时不会种植。可种植的17种植物有:给树枝种树苗、给草种草、给花瓣种花、给噩梦花瓣种噩梦花、给芦苇种芦苇、给红蘑菇种红蘑菇、给绿蘑菇种绿蘑菇、给蓝蘑菇种蓝蘑菇、给胡萝卜种胡萝卜、给浆果种果树丛、给曼德拉草种曼德拉草、给叶子种蕨类植物、给香蕉种香蕉树、给苔藓种苔藓、给荧光果种三朵洞穴花、给松果种树、给木炭种蘑菇树、给仙人掌肉种仙人掌、给橡果种橡树(橡树种下时不显示,存档退出再读档就可正常显示)。注意,其中果树丛、香蕉树、树、蘑菇树等种好后人无法通行,可以用“瑞士手杖”瞬移(或“神奇跳跃”跳出来),并用“收割者”大面积收获

2025/04/23 · Bny

YN272-智能播种机器人(将独奏乐器扔在地上自动种100棵香蕉树)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二七二.智能播种机器人(将独奏乐器扔在地上自动种100棵香蕉树) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/onemanband.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function ondropped(inst) local player = GetPlayer() if player.components.inventory:Has("goldnugget", 50) then player.components.inventory:ConsumeByName("goldnugget", 50) RemovePhysicsColliders(inst) inst.name = "cave_banana_tree" inst.components.inventoryitem.canbepickedup = false inst:DoTaskInTime(1, function() inst.task = inst:DoPeriodicTask(.5, function() inst.Physics:SetMotorVelOverride(2,0,2) inst.Physics:ClearMotorVelOverride() player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") SpawnPrefab(inst.name).Transform:SetPosition(inst.Transform:GetWorldPosition()) end) end) inst:DoTaskInTime(11, function() if inst.task then inst.task:Cancel() inst.task = nil end player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") inst.Physics:SetMotorVelOverride(-3,0,3) inst.Physics:ClearMotorVelOverride() end) inst:DoTaskInTime(12, function() inst.task = inst:DoPeriodicTask(.5, function() inst.Physics:SetMotorVelOverride(-2,0,-2) inst.Physics:ClearMotorVelOverride() player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") SpawnPrefab(inst.name).Transform:SetPosition(inst.Transform:GetWorldPosition()) end) end) inst:DoTaskInTime(22, function() if inst.task then inst.task:Cancel() inst.task = nil end player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") inst.Physics:SetMotorVelOverride(-3,0,3) inst.Physics:ClearMotorVelOverride() end) inst:DoTaskInTime(23, function() inst.task = inst:DoPeriodicTask(.5, function() inst.Physics:SetMotorVelOverride(2,0,2) inst.Physics:ClearMotorVelOverride() player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") SpawnPrefab(inst.name).Transform:SetPosition(inst.Transform:GetWorldPosition()) end) end) inst:DoTaskInTime(33, function() if inst.task then inst.task:Cancel() inst.task = nil end player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") inst.Physics:SetMotorVelOverride(-3,0,3) inst.Physics:ClearMotorVelOverride() end) inst:DoTaskInTime(34, function() inst.task = inst:DoPeriodicTask(.5, function() inst.Physics:SetMotorVelOverride(-2,0,-2) inst.Physics:ClearMotorVelOverride() player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") SpawnPrefab(inst.name).Transform:SetPosition(inst.Transform:GetWorldPosition()) end) end) inst:DoTaskInTime(44, function() if inst.task then inst.task:Cancel() inst.task = nil end player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") inst.Physics:SetMotorVelOverride(-3,0,3) inst.Physics:ClearMotorVelOverride() end) inst:DoTaskInTime(45, function() inst.task = inst:DoPeriodicTask(.5, function() inst.Physics:SetMotorVelOverride(2,0,2) inst.Physics:ClearMotorVelOverride() player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") SpawnPrefab(inst.name).Transform:SetPosition(inst.Transform:GetWorldPosition()) end) end) inst:DoTaskInTime(55, function() if inst.task then inst.task:Cancel() inst.task = nil end player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") inst.Physics:SetMotorVelOverride(-3,0,3) inst.Physics:ClearMotorVelOverride() inst.components.inventoryitem.canbepickedup = true end) end end inst:ListenForEvent("ondropped", ondropped) 即可将独奏乐器扔在开阔的空地上,它会自动行驶种下100棵香蕉树(5行,每行20棵),同时收取主角50个黄金,身上黄金不足时不会干活。将其中的cave_banana_tree(洞穴香蕉树)改为其他植物,如flower_cave_triple(三朵洞穴花)等,就可以种其他植物了(见本修改技巧“常用物品中英文名称”)。独奏乐器在魔法选项(画着红骷髅)下,用2个黄金、4个噩梦燃料、2个猪皮制造

2025/04/23 · Bny

YN273-磁悬浮建筑机器人(将针线包扔在地上自动建50块农田)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二七三.磁悬浮建筑机器人(将针线包扔在地上自动建50块农田) 用MT管理器打开游戏目录/assets/scripts/prefabs/sewingkit.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function startbuild(inst) inst.name = "fast_farmplot" local space = 2.1 local row = 10 local num = 0 local num2 = 0 local num3 = 0 local num4 = 0 local num5 = 0 local pt = GetPlayer():GetPosition() inst:StartThread(function() for k = 1,row do num = num + space inst.Transform:SetPosition(pt.x+num, 5, pt.z+num) SpawnPrefab(inst.name).Transform:SetPosition(pt.x+num, 0, pt.z+num) GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.2, 0.02, .25, 40) GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/rock_break") Sleep(.5) end for k = 1,row do num2 = num2 + space inst.Transform:SetPosition(pt.x-2.6+num2, 5, pt.z+2.6+num2) SpawnPrefab(inst.name).Transform:SetPosition(pt.x-2.6+num2, 0, pt.z+2.6+num2) GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.2, 0.02, .25, 40) GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/rock_break") Sleep(.5) end for k = 1,row do num3 = num3 + space inst.Transform:SetPosition(pt.x-5.2+num3, 5, pt.z+5.2+num3) SpawnPrefab(inst.name).Transform:SetPosition(pt.x-5.2+num3, 0, pt.z+5.2+num3) GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.2, 0.02, .25, 40) GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/rock_break") Sleep(.5) end for k = 1,row do num4 = num4 + space inst.Transform:SetPosition(pt.x-7.8+num4, 5, pt.z+7.8+num4) SpawnPrefab(inst.name).Transform:SetPosition(pt.x-7.8+num4, 0, pt.z+7.8+num4) GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.2, 0.02, .25, 40) GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/rock_break") Sleep(.5) end for k = 1,row do num5 = num5 + space inst.Transform:SetPosition(pt.x-10.4+num5, 5, pt.z+10.4+num5) SpawnPrefab(inst.name).Transform:SetPosition(pt.x-10.4+num5, 0, pt.z+10.4+num5) GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.2, 0.02, .25, 40) GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/rock_break") Sleep(.5) end end) end local function ondropped(inst) if GetPlayer().components.inventory:Has("goldnugget", 100) then GetPlayer().components.inventory:ConsumeByName("goldnugget", 100) GetPlayer().SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") inst.components.inventoryitem.canbepickedup = false inst.Physics:SetMotorVelOverride(0,2,0) inst:DoTaskInTime(3, function() startbuild(inst) end) inst:DoTaskInTime(28, function() inst.Physics:ClearMotorVelOverride() inst.components.inventoryitem.canbepickedup = true GetPlayer().components.inventory:GiveItem(inst) end) end end inst:ListenForEvent("ondropped", ondropped) 即可将针线包扔在开阔的空地上,它会悬浮在空中自动建50块农田,同时收取主角100个黄金,身上黄金不足时不会干活。将其中的fast_farmplot(高级农田)改为其他建筑,如cookpot(煮锅)、birdcage(鸟笼)等,就可以建其他建筑了(见本修改技巧“常用物品中英文名称”)。针线包在穿戴选项(画着礼帽)下,用1个木头、8个蛛丝、2个犬牙制造

2025/04/23 · Bny

YN274-电动斧子(拿黄金斧子自动放倒身边的树)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二七四.电动斧子(拿黄金斧子自动放倒身边的树) 用MT管理器打开游戏目录/assets/scripts/prefabs/axe.lua文件, 1.将下列内容: local function onequipgold(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_goldenaxe", "swap_goldenaxe") owner.SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end 替换为: local function pickup(inst, owner) local range = 3 local pos = Vector3(owner.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, range) for k,v in pairs(ents) do if v:HasTag("tree") and v.components.workable and v.components.workable.workleft > 0 then v.components.workable:Destroy(GetPlayer()) end end inst.SoundEmitter:PlaySound("dontstarve/forest/treeCrumble") end local function onequipgold(inst, owner) if owner.components.inventory:Has("lightbulb", 1) then inst.task = inst:DoPeriodicTask(.033, function() pickup(inst, owner) end) owner.components.inventory:ConsumeByName("lightbulb", 1) end owner.AnimState:OverrideSymbol("swap_object", "swap_goldenaxe", "swap_goldenaxe") owner.SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end local function onunequipgold(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") if inst.task then inst.task:Cancel() inst.task = nil end end 2.在inst.components.equippable:SetOnEquip( onequipgold )的下一行插入inst.components.equippable:SetOnUnequip( onunequipgold ) 即可拿黄金斧子自动放倒身边的树(类似电锯),效率极高,且不留树根,方便种新树。电动斧子需要能源,每次装备时自动开启,会消耗1个荧光果,如果身上没有荧光果,则不会开启电动功能,只能手动砍树了

2025/04/23 · Bny

YN275-电动镐(拿黄金镐自动凿开身边的石头)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二七五.电动镐(拿黄金镐自动凿开身边的石头) 1.用MT管理器打开游戏目录/assets/scripts/prefabs/pickaxe.lua文件,将下列内容: local function onequipgold(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_goldenpickaxe", "swap_goldenpickaxe") owner.SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end 替换为: local function pickup(inst, owner) local range = 3 local pos = Vector3(owner.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, range) for k,v in pairs(ents) do if v.components.workable and v.components.workable.action == ACTIONS.MINE and v.components.workable.workleft > 0 then v.components.workable:Destroy(GetPlayer()) end end inst.SoundEmitter:PlaySound("dontstarve/wilson/rock_break") end local function onequipgold(inst, owner) if owner.components.inventory:Has("lightbulb", 1) then inst.task = inst:DoPeriodicTask(.033, function() pickup(inst, owner) end) owner.components.inventory:ConsumeByName("lightbulb", 1) end owner.AnimState:OverrideSymbol("swap_object", "swap_goldenpickaxe", "swap_goldenpickaxe") owner.SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end local function onunequipgold(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") if inst.task then inst.task:Cancel() inst.task = nil end end 2.在inst.components.equippable:SetOnEquip( onequipgold )的下一行插入inst.components.equippable:SetOnUnequip( onunequipgold ) 即可拿黄金镐自动凿开身边的石头,效率极高,连大理石树、蜘蛛洞、远古雕像都可轻松凿平。电动镐需要能源,每次装备时自动开启,会消耗1个荧光果,如果身上没有荧光果,则不会开启电动功能,只能手动开矿了

2025/04/23 · Bny