YN262-传送石(右键点装备的保温石,将主角传送到另一块保温石处)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二六二.传送石(右键点装备的保温石,将主角传送到另一块保温石处) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/heatrock.lua文件,在inst:AddComponent("inspectable")下一行插入以下内容: local function canteleport(inst, caster) return true end local function teleport(inst) local caster = inst.components.inventoryitem.owner local range = 3000 local pos = Vector3(caster.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, range) for k,v in pairs(ents) do if v.prefab == "heatrock" and not v.components.inventoryitem:IsHeld() then caster.Transform:SetPosition(v.Transform:GetWorldPosition()) end end return true 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("equippable") inst.components.equippable.equipslot = EQUIPSLOTS.HANDS 即可制造2块保温石,1块扔在要传到的地点(比如家、洞穴出口处等),另1块带在身上,无论走到地图何处,只要装备保温石对空地按鼠标右键,马上传送回扔在地上的保温石处。如果制造3块保温石,将2块扔在不同地点,这2点间将形成虫洞效果,装备保温石对空地按鼠标右键,会在这2点间来回传送

2025/04/23 · Bny

YN263-御风飞翔(装备羽毛飞翔10秒)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二六三.御风飞翔(装备羽毛飞翔10秒) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/feathers.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function onequip(inst, owner) inst.fire = SpawnPrefab( "feather_"..name ) inst.fire.Physics:SetActive(false) local follower = inst.fire.entity:AddFollower() follower:FollowSymbol( inst.GUID, "swap_object", 0, 60, 0 ) local pt = owner:GetPosition() owner.Transform:SetPosition(pt.x, pt.y+30, pt.z) inst:DoTaskInTime(10, function() local pt = owner:GetPosition() owner.Transform:SetPosition(pt.x, pt.y-30, pt.z) inst:Remove() end) end local function onunequip(inst, owner) local pt = owner:GetPosition() owner.Transform:SetPosition(pt.x, pt.y-30, pt.z) inst.fire:Remove() inst.fire = nil end inst:AddComponent("equippable") inst.components.equippable:SetOnEquip( onequip ) inst.components.equippable:SetOnUnequip( onunequip ) inst.components.equippable.equipslot = EQUIPSLOTS.HEAD inst.components.equippable.walkspeedmult = TUNING.CANE_SPEED_MULT*5 即可装备羽毛飞翔10秒,体会饥荒世界从未有过的美妙感觉,洞穴也可飞行。10秒后羽毛被耗尽,想飞就要多捕鸟哦。注意飞行时不要佩戴橙色护身符和带宠物

2025/04/23 · Bny

YN264-风力滑板车(饥荒世界陆上交通工具)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二六四.风力滑板车(饥荒世界陆上交通工具) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/umbrella.lua文件, 1.将下列内容: local function onequip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_umbrella", "swap_umbrella") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") UpdateSound(inst) owner.DynamicShadow:SetSize(2.2, 1.4) inst.components.fueled:StartConsuming() end local function onunequip(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") UpdateSound(inst) owner.DynamicShadow:SetSize(1.3, 0.6) inst.components.fueled:StopConsuming() end 替换为: local function onequip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_umbrella", "swap_umbrella") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") UpdateSound(inst) inst.task = inst:DoPeriodicTask(.01, function() owner.Physics:SetMotorVelOverride(20,0,0) end) inst.fire = SpawnPrefab( "telebase" ) inst.fire.Physics:SetActive(false) local follower = inst.fire.entity:AddFollower() follower:FollowSymbol( owner.GUID, "swap_object", -90, 130, 0 ) end local function onunequip(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") UpdateSound(inst) if inst.task then inst.task:Cancel() inst.task = nil end inst.fire:Remove() inst.fire = nil end 2.在inst.components.fueled:SetDepletedFn(onperish)的下一行插入inst:AddComponent("blinkstaff") 即可在装备雨伞时,脚下踩着滑板自动行驶,伞就是你的风帆,卸载雨伞后停下。鼠标左键点地可以控制方向(也可以用键盘W、S、A、D键控制方向),鼠标右键点地可以瞬移(用以跳过障碍),有空儿去兜兜风吧。雨伞在生存选项(画着绳套)下,用6个树枝、1个猪皮、2个蛛丝制造

2025/04/23 · Bny

YN265-动力飞行帽(戴羽毛帽在天空自由飞翔)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二六五.动力飞行帽(戴羽毛帽在天空自由飞翔) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/hats.lua文件,将下列内容: local function feather_equip(inst, owner) onequip(inst, owner) local ground = GetWorld() if ground and ground.components.birdspawner then ground.components.birdspawner:SetSpawnTimes(TUNING.BIRD_SPAWN_DELAY_FEATHERHAT) ground.components.birdspawner:SetMaxBirds(TUNING.BIRD_SPAWN_MAX_FEATHERHAT) end end local function feather_unequip(inst, owner) onunequip(inst, owner) local ground = GetWorld() if ground and ground.components.birdspawner then ground.components.birdspawner:SetSpawnTimes(TUNING.BIRD_SPAWN_DELAY) ground.components.birdspawner:SetMaxBirds(TUNING.BIRD_SPAWN_MAX) end end local function feather() local inst = simple() inst.components.equippable.dapperness = TUNING.DAPPERNESS_SMALL inst.components.equippable:SetOnEquip( feather_equip ) inst.components.equippable:SetOnUnequip( feather_unequip ) inst:AddComponent("fueled") inst.components.fueled.fueltype = "USAGE" inst.components.fueled:InitializeFuelLevel(TUNING.FEATHERHAT_PERISHTIME) inst.components.fueled:SetDepletedFn(generic_perish) 替换为: local function feather_equip(inst, owner) onequip(inst, owner) local shadow = GetPlayer().entity:AddDynamicShadow() shadow:SetSize( 0, 0 ) inst.task = inst:DoPeriodicTask(.01, function() owner.Physics:SetMotorVelOverride(20,10,0) end ) inst:DoTaskInTime(3, function() if inst.task then inst.task:Cancel() inst.task = nil end inst.task = inst:DoPeriodicTask(.01, function() owner.Physics:SetMotorVelOverride(20,1,0) end) end ) end local function feather_unequip(inst, owner) if inst.task then inst.task:Cancel() inst.task = nil end inst.task = inst:DoPeriodicTask(.01, function() owner.Physics:SetMotorVelOverride(20,-10,0) end) inst:DoTaskInTime(3, function() if inst.task then inst.task:Cancel() inst.task = nil end onunequip(inst, owner) local shadow = GetPlayer().entity:AddDynamicShadow() shadow:SetSize( 1.3, .6 ) end) end local function feather() local inst = simple() inst.components.equippable.dapperness = TUNING.DAPPERNESS_SMALL inst.components.equippable:SetOnEquip( feather_equip ) inst.components.equippable:SetOnUnequip( feather_unequip ) 即可在戴羽毛帽时开始起飞,爬升3秒后平飞,用键盘W、S、A、D键控制方向。想降落时卸载羽毛帽即可开始着陆,落地后会滑行一段(按W、S、A、D键可以减少滑行距离)。注意不要在爬升阶段卸载羽毛帽(平飞时再卸载即可),否则在惯性作用下将滑出很长一段距离

2025/04/23 · Bny

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