饥荒mod吧 关注:57,789贴子:235,515
  • 3回复贴,共1

有没有大佬说一下瞬移代码是那个,我想把它删了

只看楼主收藏回复

手柄玩家用不到瞬移,而且和挖掘键重合了,最主要是人物下面的瞬移键就很烦
一五九.瑞士手杖(砍树、凿石、锤墙、挖草、祛暑、取暖、防雨、补脑、瞬移、10倍攻击力、2倍速度、照明)
用记事本打开游戏目录\data\scripts\prefabs\cane.lua文件,
1.在local function onequip(inst, owner)的下一行插入以下内容:
inst.Light:Enable(true)
GetPlayer().components.temperature:SetTemp(20)
GetPlayer():PushEvent("stopfreezing")
GetPlayer():PushEvent("stopoverheating")
GetPlayer().components.moisture:SetMoistureLevel(0)
2.在local function onunequip(inst, owner)的下一行插入以下内容:
inst.Light:Enable(false)
GetPlayer().components.temperature:SetTemp(nil)
3.在anim:PlayAnimation("idle")的下一行插入以下内容:
inst:AddComponent("tool")
inst.components.tool:SetAction(ACTIONS.CHOP, 15)
inst.components.tool:SetAction(ACTIONS.MINE, 15)
inst.components.tool:SetAction(ACTIONS.HAMMER,15)
inst.components.tool:SetAction(ACTIONS.DIG)
inst:AddComponent("waterproofer")
inst.components.waterproofer:SetEffectiveness(TUNING.WATERPROOFNESS_ABSOLUTE)
inst:AddComponent("blinkstaff")
local light = inst.entity:AddLight()
light:SetFalloff(0.4)
light:SetIntensity(.7)
light:SetRadius(2.5)
light:SetColour(180/255, 195/255, 150/255)
light:Enable(true)
4.将inst.components.weapon:SetDamage(TUNING.CANE_DAMAGE)替换为inst.components.weapon:SetDamage(TUNING.CANE_DAMAGE*10)
5.将inst.components.equippable.walkspeedmult = TUNING.CANE_SPEED_MULT替换为以下内容:
inst.components.equippable.walkspeedmult = TUNING.CANE_SPEED_MULT*2
inst.components.equippable.dapperness = TUNING.DAPPERNESS_HUGE
即可让手杖拥有瑞士军刀般的多功能。装备手杖时,在空地上点鼠标右键可瞬移,借此可跳过较窄沟壑,少走冤枉路【图片】【图片】【图片】




IP属地:陕西来自Android客户端1楼2019-10-14 17:26回复
    3里面,最后括号里有staff的那行删掉


    IP属地:湖北来自Android客户端2楼2019-10-15 07:29
    回复
      2025-06-29 20:55:40
      广告
      那局话是瞬移手杖的组件。


      IP属地:湖北来自Android客户端3楼2019-10-15 07:30
      回复
        --用记事本打开游戏目录\data\scripts\prefabs\cane.lua文件,
        1.在local function onequip(inst, owner)的下一行插入以下内容:
        inst.Light:Enable(true) --照明打开
        GetPlayer().components.temperature:SetTemp(20) --设置温度20
        GetPlayer():PushEvent("stopfreezing") --冰冻停留
        GetPlayer():PushEvent("stopoverheating") --温度停留
        GetPlayer().components.moisture:SetMoistureLevel(0) --潮湿等级0
        2.在local function onunequip(inst, owner)的下一行插入以下内容:
        inst.Light:Enable(false) --照明关闭
        GetPlayer().components.temperature:SetTemp(nil) --设置温度(取消)
        3.在anim:PlayAnimation("idle")的下一行插入以下内容:
        inst:AddComponent("tool") --增加组件(工具)
        inst.components.tool:SetAction(ACTIONS.CHOP, 15) --砍,work=15, 其实就是砍一下等于砍15下
        inst.components.tool:SetAction(ACTIONS.MINE, 15) --挖,work=15 --采矿
        inst.components.tool:SetAction(ACTIONS.HAMMER,15) --锤,work=15 --一锤拆家
        inst.components.tool:SetAction(ACTIONS.DIG) --掘 --挖树苗
        inst:AddComponent("waterproofer") --增加组件(防水)
        inst.components.waterproofer:SetEffectiveness(TUNING.WATERPROOFNESS_ABSOLUTE) --设为绝对防水
        inst:AddComponent("blinkstaff") --增加组件(闪现魔杖) 不想要闪现 就删除此行
        local light = inst.entity:AddLight() --增加照明(以下为参数)
        light:SetFalloff(0.4) --衰减,值越大, 光线渐变越大
        light:SetIntensity(.7) --变度,值越大越亮
        light:SetRadius(2.5) --半径,值越大照的范围越大
        light:SetColour(180/255, 195/255, 150/255) --颜色(180/红,195/绿,150/蓝),255不能变, 前面的数越大,对应色彩越浓
        light:Enable(true) --这里设置正常为false, true的意思 把手杖扔地上, 它也会发光, 当灯笼用,但是前面的代码 onunequip未装备时,光照还是会被关闭
        4.将inst.components.weapon:SetDamage(TUNING.CANE_DAMAGE*10)替换为inst.components.weapon:SetDamage(TUNING.CANE_DAMAGE*10)--10倍手杖攻击
        5.将inst.components.equippable.walkspeedmult = TUNING.CANE_SPEED_MULT替换为以下内容:
        inst.components.equippable.walkspeedmult = TUNING.CANE_SPEED_MULT*2 --2倍手杖移速
        inst.components.equippable.dapperness = TUNING.DAPPERNESS_HUGE --整洁状态可恢复智力_HUGE巨大


        4楼2019-11-09 00:33
        回复