surface creation code in control.lua
Code: Select all
script.on_event(defines.events.on_built_entity, function(event)
local entity = event.created_entity
local surface = game.surfaces
if entity.name == "rocket-silo" then
if game.surfaces["Space"] == nil then
surface = game.create_surface("Space",
{
terrain_segmentation = "normal",
water = "none",
starting_area = "normal",
default_enable_all_autoplace_controls = false,
autoplace_controls =
{
["moon-grass-4"] =
{
frequency = "very-high",
size = "very-high",
richness = "very-high"
}
},
seed = null
})
surface.daytime = 0
end
end
end)
Code: Select all
data:extend(
{
{
name = "moon-grass-4",
type = "tile",
collision_mask = {"ground-tile"},
--autoplace = autoplace_settings("grass-4", "grass", {{0, 0.55}, {0.55, 0.8}}),
layer = 29,
variants = tile_variations_template(
"__SpaceFinalFrontier__/graphics/tiles/moon-grass-4.png", "__base__/graphics/terrain/masks/transition-3.png",
"__SpaceFinalFrontier__/graphics/tiles/hr-moon-grass-4.png", "__base__/graphics/terrain/masks/hr-transition-3.png",
{
max_size = 4,
[1] = { weights = {0.085, 0.085, 0.085, 0.085, 0.087, 0.085, 0.065, 0.085, 0.045, 0.045, 0.045, 0.045, 0.005, 0.025, 0.045, 0.045 } },
[2] = { probability = 1, weights = {0.018, 0.020, 0.015, 0.025, 0.015, 0.020, 0.025, 0.015, 0.025, 0.025, 0.010, 0.025, 0.020, 0.025, 0.025, 0.010 }, },
[4] = { probability = 0.5, weights = {0.018, 0.020, 0.015, 0.025, 0.015, 0.020, 0.025, 0.015, 0.025, 0.025, 0.010, 0.025, 0.020, 0.025, 0.025, 0.010 }, },
--[8] = { probability = 1.00, weights = {0.090, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.025, 0.125, 0.005, 0.010, 0.100, 0.100, 0.010, 0.020, 0.020} },
}
),
transitions = grass_transitions,
transitions_between_transitions = grass_transitions_between_transitions,
walking_sound =
{
{
filename = "__base__/sound/walking/grass-01.ogg",
volume = 0.8
},
{
filename = "__base__/sound/walking/grass-02.ogg",
volume = 0.8
},
{
filename = "__base__/sound/walking/grass-03.ogg",
volume = 0.8
},
{
filename = "__base__/sound/walking/grass-04.ogg",
volume = 0.8
}
},
map_color={r=54, g=47, b=35},
ageing=0.0004,
vehicle_friction_modifier = grass_vehicle_speed_modifier
},
{
type = "autoplace-control",
name = "moon-grass-4",
order = "c-a",
category = "terrain",
},
}
)