游戏达人
- 贡献度
- 80
- 金元
- 18912
- 积分
- 2221
- 精华
- 1
- 注册时间
- 2010-11-27
|
有_人_坑我 发表于 2013-10-10 21:23
12, 15 是什么呢?怎样可以加大范围?
12是靠近点燃的距离,15是远离熄灭的距离,下面是更完善的版本
用硝石种麦斯威尔灯(靠近点燃、远离灭)
1.用记事本打开游戏目录\data\scripts\prefabs\nitre.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容:
local function OnDeploy (inst, pt)
local maxwelllight = SpawnPrefab("maxwelllight")
if maxwelllight then
maxwelllight:PushEvent("growfromnitre")
maxwelllight.Transform:SetPosition(pt.x, pt.y, pt.z)
inst.components.stackable:Get():Remove()
end
end
inst:AddComponent("deployable")
inst.components.deployable.ondeploy = OnDeploy
2.用记事本打开游戏目录\data\scripts\prefabs\maxwelllight.lua文件,在的下一行插入以下内容:
local function onhammered(inst, worker)
SpawnPrefab("collapse_small").Transform:SetPosition(inst.Transform:GetWorldPosition())
SpawnPrefab("nitre").Transform:SetPosition(inst.Transform:GetWorldPosition())
inst:Remove()
end
inst:AddComponent("playerprox")
inst.components.playerprox:SetDist(17, 27 )
inst.components.playerprox:SetOnPlayerNear(function() if not inst.components.burnable:IsBurning() then inst.components.burnable:Ignite() end end)
inst.components.playerprox:SetOnPlayerFar(extinguish)
inst:AddComponent("workable")
inst.components.workable:SetWorkAction(ACTIONS.HAMMER)
inst.components.workable:SetWorkLeft(1)
inst.components.workable:SetOnFinishCallback(onhammered)
用硝石种麦斯威尔灯,靠近自动点燃、远离自动灭,不想要时用锤子砸毁即可
|
|