饥荒筋斗云修改方法介绍的是使用文本形式修改,让您在饥荒游戏中能使用筋斗云的方法,按键盘Z键召唤筋斗云在天上飞行,再按Z键落地。
用记事本打开游戏目录\data\DLC0001\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键可落地。
累计评论0条
展开其余评论