第127页:用岩石种海洋
展开一二七.用岩石种海洋(建造护城河)
用记事本打开游戏目录\data\DLC0001\scripts\prefabs\inv_rocks.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容:
local function ondeploy(inst, pt, deployer)
local ground = GetWorld()
if ground then
local original_tile_type = ground.Map:GetTileAtPoint(pt.x, pt.y, pt.z)
local x, y = ground.Map:GetTileCoordsAtPoint(pt.x, pt.y, pt.z)
if x and y then
ground.Map:SetTile(x,y, GROUND.IMPASSABLE)
ground.Map:RebuildLayer( original_tile_type, x, y )
ground.Map:RebuildLayer( GROUND.IMPASSABLE, x, y )
end
local minimap = TheSim:FindFirstEntityWithTag("minimap")
if minimap then
minimap.MiniMap:RebuildLayer( original_tile_type, x, y )
minimap.MiniMap:RebuildLayer( GROUND.IMPASSABLE, x, y )
end
end
inst.components.stackable:Get():Remove()
end
inst:AddComponent("deployable")
inst.components.deployable.ondeploy = ondeploy
inst.components.deployable.min_spacing = 0
inst.components.deployable.placer = "gridplacer"
即可用岩石种海洋,建造护城河。如果对自己建的岛不满意,也可以用岩石修改哦。岩石种过海洋后,会保留岸边的贴图,存档退出后再进入游戏就正常了。不要将海洋建在路底下
更多相关内容请关注:饥荒专区
责任编辑:Shy夏夏