第294页:神奇跳跃
展开二四四.神奇跳跃(按键盘R键主角可向前跳跃)
用记事本打开游戏目录\data\DLC0001\scripts\prefabs\player_common.lua文件,在inst:AddComponent("resurrectable")的下一行插入以下内容:
TheInput:AddKeyUpHandler(KEY_R, function()
inst.Physics:SetCollides(false)
inst:DoTaskInTime(0, function()
inst.AnimState:PlayAnimation("give")
inst.components.playercontroller:Enable(false)
inst.components.locomotor:Stop()
inst.Physics:SetMotorVelOverride(50,45,0) end )
inst:DoTaskInTime(0.2, function()
inst.Physics:ClearMotorVelOverride()
inst.Physics:SetMotorVelOverride(50,0,0) end )
inst:DoTaskInTime(0.3, function()
inst.Physics:ClearMotorVelOverride()
inst.Physics:SetMotorVelOverride(50,-25,0) end )
inst:DoTaskInTime(0.5, function()
inst.Physics:ClearMotorVelOverride()
inst.components.locomotor:Stop()
local pt = inst:GetPosition()
inst.Transform:SetPosition(pt.x, 0, pt.z)
inst.components.playercontroller:Enable(true)
inst.Physics:SetCollides(true)
inst.AnimState:PlayAnimation("idle")
inst.SoundEmitter:PlaySound("dontstarve/movement/bodyfall_dirt", "bodyfall") end )
end )
即可按键盘R键,让主角向前跳跃,用以方便地越过沟壑、墙等障碍,也可以跳到海面上,渡海而行。当身边有障碍物时,会影响跳跃高度。将其中KEY_R替换为其他键,比如KEY_C,就可以按键盘C键跳跃
更多相关内容请关注:饥荒专区
责任编辑:Shy夏夏
《007 初露锋芒》新DLC官宣!国庆节免费送
育碧官宣10.2大动作!发神秘预告 网友全在喊《圣歌》
曝影之刃零已收入1.2亿!Steam销量逼近40万份
PS5破解惨遭大突破!盗版或将泛滥 据称可玩巫师3RE
《巫师3RE》DLSS5效果惊艳!叶奈法皮肤白皙美貌绝伦
PS5惨遭破解!全机型失守 逼索尼发PS6?