游戏达人
![Rank: 7](static/image/common/star_level3.gif) ![Rank: 7](static/image/common/star_level2.gif) ![Rank: 7](static/image/common/star_level1.gif)
- 贡献度
- 80
- 金元
- 18922
- 积分
- 2222
- 精华
- 1
- 注册时间
- 2010-11-27
|
spore~刘 发表于 2013-8-31 23:23 ![](static/image/common/back.gif)
哦,那能给一个影灯晚上自动亮的吗?
暗影灯夜晚点燃、白天熄灭
用记事本打开游戏目录\data\scripts\prefabs\nightlight.lua文件,
1.在下列内容:
local prefabs =
{
"campfirefire",
}
的下一行插入以下内容:
local function LightsOn(inst)
inst.components.burnable:Ignite()
inst.components.fueled:InitializeFuelLevel(TUNING.NIGHTLIGHT_FUEL_MAX)
end
local function LightsOff(inst)
inst.components.burnable:Extinguish()
inst.components.fueled:InitializeFuelLevel(0)
end
2.在MakeObstaclePhysics(inst, .1)的下一行插入以下内容:
inst:ListenForEvent( "daytime", function() LightsOff(inst) end, GetWorld())
inst:ListenForEvent( "dusktime", function() LightsOn(inst) end, GetWorld())
inst:ListenForEvent( "nighttime", function() LightsOn(inst) end, GetWorld())
即可让暗影灯夜晚点燃、白天熄灭。暗影灯在魔法选项下用8个金块、2个噩梦燃料、1个红宝石制造
|
|