YN260-奶报箱(用苔藓种奶报箱,放入黄金,每天清晨送来报纸和5瓶牛奶,读报纸可补脑)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二六0.奶报箱(用苔藓种奶报箱,放入黄金,每天清晨送来报纸和5瓶牛奶,读报纸可补脑) 用MT管理器打开游戏目录/assets/scripts/prefabs/cutlichen.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function itemtest(inst, item, slot) if item.prefab == "goldnugget" or item.prefab == "goatmilk" or item.prefab == "cutlichen" then return true end return false end local slotpos = { Vector3(0,32+4,0), Vector3(0,-(32+4),0), Vector3(0,-(64+32+8+4),0)} local widgetbuttoninfo = { text = "Buy", position = Vector3(0, 95, 0), fn = function(inst) if inst:HasTag("milkcartons") and inst.components.container:Has("goldnugget", 1) then inst.components.container:ConsumeByName("goldnugget", 1) GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") local newspaper = SpawnPrefab("cutlichen") newspaper.AnimState:SetBank("blueprint") newspaper.AnimState:SetBuild("blueprint") newspaper.AnimState:PlayAnimation("idle") newspaper.components.inventoryitem:ChangeImageName("blueprint") newspaper.Transform:SetScale(1.2, 1.2, 1.2) newspaper:AddComponent("named") newspaper.components.named:SetName("Newspaper") newspaper:RemoveComponent("stackable") newspaper:RemoveComponent("edible") newspaper:RemoveComponent("perishable") newspaper:RemoveComponent("container") newspaper:RemoveComponent("deployable") newspaper.components.inspectable.getstatus = function(newspaper) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_clothing") GetPlayer().components.sanity:DoDelta(GetPlayer().components.sanity.max) newspaper:Remove() end newspaper:AddTag("newspapers") GetPlayer().components.inventory:GiveItem(newspaper) end end } local function OnDeploy (inst, pt) local milkcarton = SpawnPrefab("cutlichen") milkcarton.Transform:SetPosition(pt.x, pt.y, pt.z) milkcarton.AnimState:SetBank("icebox") milkcarton.AnimState:SetBuild("ice_box") milkcarton.AnimState:PlayAnimation("closed") milkcarton.Transform:SetScale(0.6, 0.6, 0.6) milkcarton.AnimState:SetMultColour(0/255,185/255,255/255,1) milkcarton:AddComponent("named") milkcarton.components.named:SetName("Milk carton") milkcarton:RemoveComponent("stackable") milkcarton:RemoveComponent("inventoryitem") milkcarton:RemoveComponent("edible") milkcarton:RemoveComponent("perishable") milkcarton:RemoveComponent("deployable") milkcarton.components.container.canbeopened = true milkcarton:AddComponent("workable") milkcarton.components.workable:SetWorkAction(ACTIONS.HAMMER) milkcarton.components.workable:SetWorkLeft(3) milkcarton.components.workable:SetOnFinishCallback(function(milkcarton) SpawnPrefab("collapse_big").Transform:SetPosition(milkcarton.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") milkcarton:Remove() end ) milkcarton:ListenForEvent( "daytime", function() if milkcarton.components.container:Has("goldnugget", 5) then milkcarton.components.container:ConsumeByName("goldnugget", 5) for k = 1, 5 do local goatmilk = SpawnPrefab("goatmilk") milkcarton.components.container:GiveItem(goatmilk) end local newspaper = SpawnPrefab("cutlichen") newspaper.AnimState:SetBank("blueprint") newspaper.AnimState:SetBuild("blueprint") newspaper.AnimState:PlayAnimation("idle") newspaper.components.inventoryitem:ChangeImageName("blueprint") newspaper.Transform:SetScale(1.2, 1.2, 1.2) newspaper:AddComponent("named") newspaper.components.named:SetName("Newspaper") newspaper:RemoveComponent("stackable") newspaper:RemoveComponent("edible") newspaper:RemoveComponent("perishable") newspaper:RemoveComponent("container") newspaper:RemoveComponent("deployable") newspaper.components.inspectable.getstatus = function(newspaper) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_clothing") GetPlayer().components.sanity:DoDelta(GetPlayer().components.sanity.max) newspaper:Remove() end newspaper:AddTag("newspapers") milkcarton.components.container:GiveItem(newspaper) end end, GetWorld()) milkcarton:AddTag("milkcartons") inst.components.stackable:Get():Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy inst.components.deployable.min_spacing = 1 inst:AddComponent("container") inst.components.container.widgetbuttoninfo = widgetbuttoninfo inst.components.container:SetNumSlots(#slotpos) inst.components.container.widgetslotpos = slotpos inst.components.container.widgetpos = Vector3(0,150,0) inst.components.container.side_align_tip = 160 inst.components.container.canbeopened = false inst.components.container.onopenfn = function(inst) inst.AnimState:PlayAnimation("open") GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") end inst.components.container.onclosefn = function(inst) inst.AnimState:PlayAnimation("close") GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") end inst.components.container.itemtestfn = itemtest inst:AddTag("fridge") local function onsave(inst, data) if inst:HasTag("milkcartons") then data.milkcartons = true end if inst:HasTag("newspapers") then data.newspapers = true end end local function onload(inst, data) if data and data.milkcartons then inst.AnimState:SetBank("icebox") inst.AnimState:SetBuild("ice_box") inst.AnimState:PlayAnimation("closed") inst.Transform:SetScale(0.6, 0.6, 0.6) inst.AnimState:SetMultColour(0/255,185/255,255/255,1) inst:AddComponent("named") inst.components.named:SetName("Milk carton") inst:RemoveComponent("stackable") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("edible") inst:RemoveComponent("perishable") inst:RemoveComponent("deployable") inst.components.container.canbeopened = true 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:ListenForEvent( "daytime", function() if inst.components.container:Has("goldnugget", 5) then inst.components.container:ConsumeByName("goldnugget", 5) for k = 1, 5 do local goatmilk = SpawnPrefab("goatmilk") inst.components.container:GiveItem(goatmilk) end local newspaper = SpawnPrefab("cutlichen") newspaper.AnimState:SetBank("blueprint") newspaper.AnimState:SetBuild("blueprint") newspaper.AnimState:PlayAnimation("idle") newspaper.components.inventoryitem:ChangeImageName("blueprint") newspaper.Transform:SetScale(1.2, 1.2, 1.2) newspaper:AddComponent("named") newspaper.components.named:SetName("Newspaper") newspaper:RemoveComponent("stackable") newspaper:RemoveComponent("edible") newspaper:RemoveComponent("perishable") newspaper:RemoveComponent("container") newspaper:RemoveComponent("deployable") newspaper.components.inspectable.getstatus = function(newspaper) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_clothing") GetPlayer().components.sanity:DoDelta(GetPlayer().components.sanity.max) newspaper:Remove() end newspaper:AddTag("newspapers") inst.components.container:GiveItem(newspaper) end end, GetWorld()) inst:AddTag("milkcartons") end if data and data.newspapers then inst.AnimState:SetBank("blueprint") inst.AnimState:SetBuild("blueprint") inst.AnimState:PlayAnimation("idle") inst.components.inventoryitem:ChangeImageName("blueprint") inst.Transform:SetScale(1.2, 1.2, 1.2) inst:AddComponent("named") inst.components.named:SetName("Newspaper") inst:RemoveComponent("stackable") inst:RemoveComponent("edible") inst:RemoveComponent("perishable") inst:RemoveComponent("container") inst:RemoveComponent("deployable") inst.components.inspectable.getstatus = function(inst) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_clothing") GetPlayer().components.sanity:DoDelta(GetPlayer().components.sanity.max) inst:Remove() end inst:AddTag("newspapers") end end inst.OnSave = onsave inst.OnLoad = onload 即可用苔藓种奶报箱,鼠标左键点奶报箱可打开格子,在格子中放入黄金(订奶预付款,最少5个黄金),第二天清晨将送来5瓶牛奶,并免费赠送一份报纸,同时扣除5个黄金。将报纸放入物品栏,对其点鼠标右键可读报,将补满脑值。如果格子中有黄金,点格子上方的“Buy”按钮,可以额外购买报纸,每份1个黄金。如果每天想多订牛奶和报纸,就多种几个奶报箱吧。不想要奶报箱了,用锤子砸毁即可。苔藓可在洞穴中采到。不要与“用苔藓种苔藓(苔藓可移植)”一同修改

2025/04/23 · Bny

YN261-智能路灯(用蓝色护身符种智能路灯,夜晚自动点亮,白天熄灭,可手动开关、防雷击)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二六一.智能路灯(用蓝色护身符种智能路灯,夜晚自动点亮,白天熄灭,可手动开关、防雷击) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/amulet.lua文件,在inst.AnimState:PlayAnimation("blueamulet")的下一行插入以下内容: local function makestreetlight(inst) local pt = inst:GetPosition() local streetlight = SpawnPrefab("blueamulet") streetlight.Transform:SetPosition(pt.x, pt.y, pt.z) streetlight.AnimState:SetBank("nightstick") streetlight.AnimState:SetBuild("nightstick") streetlight.AnimState:PlayAnimation("idle") streetlight.Transform:SetScale(1.5, 1.5, 1.5) streetlight.AnimState:SetMultColour(255/255,255/255,0/255,1) MakeObstaclePhysics(streetlight, .5 ) streetlight:RemoveComponent("equippable") streetlight:RemoveComponent("inventoryitem") streetlight:RemoveComponent("heater") streetlight:RemoveComponent("fueled") streetlight:RemoveComponent("deployable") streetlight:AddComponent("named") streetlight.components.named:SetName("Street Light") streetlight:AddComponent("workable") streetlight.components.workable:SetWorkAction(ACTIONS.HAMMER) streetlight.components.workable:SetWorkLeft(3) streetlight.components.workable:SetOnFinishCallback(function(streetlight, worker) SpawnPrefab("collapse_big").Transform:SetPosition(streetlight.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") local pos = Vector3(streetlight.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 2) for k,v in pairs(ents) do if v:HasTag("bulbs") then v:Remove() end end streetlight:Remove() end ) streetlight:AddTag("streetlights") local bulb = SpawnPrefab("blueamulet") bulb.AnimState:SetBank("bulb") bulb.AnimState:SetBuild("bulb") bulb.AnimState:PlayAnimation("idle") bulb.Transform:SetScale(1.6, 1.6, 1.6) bulb.Physics:SetActive(false) bulb:RemoveComponent("equippable") bulb:RemoveComponent("inventoryitem") bulb:RemoveComponent("heater") bulb:RemoveComponent("fueled") bulb:RemoveComponent("deployable") bulb.persists = false bulb:AddComponent("named") bulb.components.named:SetName("Street Light") bulb.entity:AddSoundEmitter() local light = bulb.entity:AddLight() light:SetFalloff(1) light:SetIntensity(.8) light:SetRadius(10) light:SetColour(255/255,255/255,255/255) light:Enable(false) local follower = bulb.entity:AddFollower() follower:FollowSymbol( streetlight.GUID, "swap_object", 15, -160, 0.1 ) bulb:AddComponent("machine") bulb.components.machine.turnonfn = function() bulb.SoundEmitter:PlaySound("dontstarve/wilson/lantern_on") bulb.AnimState:SetBloomEffectHandle("shaders/anim.ksh") bulb.Light:Enable(true) end bulb.components.machine.turnofffn = function() bulb.SoundEmitter:PlaySound("dontstarve/wilson/lantern_off") bulb.AnimState:SetBloomEffectHandle( "" ) bulb.Light:Enable(false) end bulb:ListenForEvent( "daytime", function() bulb.components.machine:TurnOff() end , GetWorld() ) bulb:ListenForEvent( "dusktime", function() bulb.components.machine:TurnOn() end , GetWorld() ) bulb:AddTag("lightningrod") bulb:AddTag("bulbs") if not GetClock():IsDay() then bulb.components.machine:TurnOn() else bulb.components.machine:TurnOff() end end local function OnDeploy (inst, pt) makestreetlight(inst) inst:Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("streetlights") then data.streetlights = true end end local function onload(inst, data) if data and data.streetlights then makestreetlight(inst) inst:Remove() end end inst.OnSave = onsave inst.OnLoad = onload 即可用蓝色护身符种智能路灯,夜晚自动点亮,白天自动熄灭。鼠标右键点灯泡,可手动开关。智能路灯靠太阳能和闪电做能源,无须手动充能,靠近可防雷击。不想要智能路灯了,用锤子砸掉即可。蓝色护身符在魔法选项(画着红骷髅)下,用3个黄金、1个蓝宝石制造

2025/04/23 · Bny

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