mirror of
https://github.com/Oarcinae/FactorioScenarioMultiplayerSpawn.git
synced 2025-03-03 14:42:27 +02:00
Rework of resource configuration.
This commit is contained in:
parent
2f4fef256a
commit
e3771acb2b
241
config.lua
241
config.lua
@ -55,7 +55,7 @@ FRONTIER_ROCKET_SILO_MODE = true
|
||||
|
||||
-- Enable Undecorator
|
||||
-- Removes decorative items to reduce save file size.
|
||||
ENABLE_UNDECORATOR = false
|
||||
ENABLE_UNDECORATOR = true
|
||||
|
||||
-- Enable Tags
|
||||
ENABLE_TAGS = true
|
||||
@ -85,6 +85,23 @@ ENABLE_ABANDONED_BASE_REMOVAL = true
|
||||
-- Enable the new 0.17 research queue by default.
|
||||
ENABLE_RESEARCH_QUEUE = true
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- MAP CONFIGURATION OPTIONS
|
||||
-- In past versions I had a way to config map settings here to be used for cmd
|
||||
-- line launching, but now you should just be using --map-gen-settings and
|
||||
-- --map-settings option since it works with --start-server-load-scenario
|
||||
-- Read the README.md file for instructions.
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Alien Options
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
-- Adjust enemy spawning based on distance to spawns. All it does it make things
|
||||
-- more balanced based on your distance and makes the game a little easier.
|
||||
-- No behemoth worms everywhere just because you spawned far away.
|
||||
OARC_MODIFIED_ENEMY_SPAWNING = true
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Spawn Options
|
||||
--------------------------------------------------------------------------------
|
||||
@ -141,11 +158,6 @@ FAR_MAX_DIST = 300
|
||||
-- Resource & Spawn Circle Options
|
||||
---------------------------------------
|
||||
|
||||
-- Enable this to have a vanilla style starting spawn for all new spawns.
|
||||
-- This scenario normally gives you a fixed circle with resources.
|
||||
-- USE_VANILLA_STARTING_SPAWN = true
|
||||
-- TODO - Requires pre-allocating spawns...
|
||||
|
||||
-- Allow players to choose to spawn with a moat
|
||||
SPAWN_MOAT_CHOICE_ENABLED = true
|
||||
-- If you change the spawn area size, you might have to adjust this as well
|
||||
@ -156,66 +168,129 @@ MOAT_SIZE_MODIFIER = 1
|
||||
-- If you make this much bigger than a few chunks, good luck.
|
||||
ENFORCE_LAND_AREA_TILE_DIST = CHUNK_SIZE*1.8
|
||||
|
||||
-- Location of water strip (horizontal)
|
||||
WATER_SPAWN_OFFSET_X = -4
|
||||
WATER_SPAWN_OFFSET_Y = -38
|
||||
WATER_SPAWN_LENGTH = 8
|
||||
|
||||
-- Start resource amounts (per tile/oil spot)
|
||||
START_IRON_AMOUNT = 1500
|
||||
START_COPPER_AMOUNT = 1500
|
||||
START_STONE_AMOUNT = 1000
|
||||
START_COAL_AMOUNT = 1500
|
||||
START_URANIUM_AMOUNT = 1000
|
||||
START_OIL_AMOUNT = 300000
|
||||
-- This is where you can modify what resources spawn, how much, where, etc.
|
||||
-- Once you have a config you like, it's a good idea to save it for later use
|
||||
-- so you don't lost it if you update the scenario.
|
||||
OARC_CFG = {
|
||||
-- Misc spawn related config.
|
||||
gen_settings = {
|
||||
-- Start resource shape. true = circle, false = square.
|
||||
resources_circle_shape = true,
|
||||
-- Force the land area circle at the spawn to be fully grass
|
||||
force_grass = true,
|
||||
-- Spawn a circle/octagon of trees around the base outline.
|
||||
tree_circle = true,
|
||||
tree_octagon = false,
|
||||
},
|
||||
-- Location of water strip (horizontal)
|
||||
water = {
|
||||
x_offset = -4,
|
||||
y_offset = -48,
|
||||
length = 8
|
||||
},
|
||||
-- Handle placement of starting resources -- STILL WIP
|
||||
resource_rand_pos_settings =
|
||||
{
|
||||
-- Autoplace resources (randomly in circle)
|
||||
-- This will ignore the fixed x_offset/y_offset values in resource_tiles.
|
||||
-- Only works for resource_tiles at the moment, not oil patches/water.
|
||||
enabled = false,
|
||||
-- Distance from center of spawn that resources are placed.
|
||||
radius = 48
|
||||
},
|
||||
-- Resource tiles
|
||||
resource_tiles =
|
||||
{
|
||||
["iron-ore"] =
|
||||
{
|
||||
amount = 1500,
|
||||
size = 16,
|
||||
x_offset = -29,
|
||||
y_offset = 16
|
||||
},
|
||||
["copper-ore"] =
|
||||
{
|
||||
amount = 1500,
|
||||
size = 14,
|
||||
x_offset = -28,
|
||||
y_offset = -3
|
||||
},
|
||||
["stone"] =
|
||||
{
|
||||
amount = 1000,
|
||||
size = 12,
|
||||
x_offset = -27,
|
||||
y_offset = -34
|
||||
},
|
||||
["coal"] =
|
||||
{
|
||||
amount = 1500,
|
||||
size = 12,
|
||||
x_offset = -27,
|
||||
y_offset = -20
|
||||
}--,
|
||||
-- ["uranium-ore"] =
|
||||
-- {
|
||||
-- amount = 0,
|
||||
-- size = 0,
|
||||
-- x_offset = 17,
|
||||
-- y_offset = -34
|
||||
-- }
|
||||
|
||||
-- Start resource shape
|
||||
-- If this is true, it will be a circle
|
||||
-- If false, it will be a square
|
||||
ENABLE_RESOURCE_SHAPE_CIRCLE = true
|
||||
|
||||
-- Start resource position and size
|
||||
-- Position is relative to player starting location
|
||||
START_RESOURCE_STONE_POS_X = -27
|
||||
START_RESOURCE_STONE_POS_Y = -34
|
||||
START_RESOURCE_STONE_SIZE = 12
|
||||
|
||||
START_RESOURCE_COAL_POS_X = -27
|
||||
START_RESOURCE_COAL_POS_Y = -20
|
||||
START_RESOURCE_COAL_SIZE = 12
|
||||
|
||||
START_RESOURCE_COPPER_POS_X = -28
|
||||
START_RESOURCE_COPPER_POS_Y = -3
|
||||
START_RESOURCE_COPPER_SIZE = 14
|
||||
|
||||
START_RESOURCE_IRON_POS_X = -29
|
||||
START_RESOURCE_IRON_POS_Y = 16
|
||||
START_RESOURCE_IRON_SIZE = 16
|
||||
|
||||
START_RESOURCE_URANIUM_POS_X = 17
|
||||
START_RESOURCE_URANIUM_POS_Y = -34
|
||||
START_RESOURCE_URANIUM_SIZE = 0 -- Disabled by default.
|
||||
|
||||
-- Specify 2 oil spot locations for starting oil.
|
||||
START_RESOURCE_OIL_NUM_PATCHES = 2
|
||||
-- The first patch
|
||||
START_RESOURCE_OIL_POS_X = -39
|
||||
START_RESOURCE_OIL_POS_Y = -2
|
||||
-- How far each patch is offset from the others and in which direction
|
||||
-- Default (x=0, y=-4) means that patches spawn in a vertical row downwards.
|
||||
START_RESOURCE_OIL_X_OFFSET = 0
|
||||
START_RESOURCE_OIL_Y_OFFSET = -4
|
||||
-- ANGELS example
|
||||
-- ["angels-ore1"] =
|
||||
-- {
|
||||
-- amount = 1500,
|
||||
-- size = 16,
|
||||
-- x_offset = -29,
|
||||
-- y_offset = 16
|
||||
-- },
|
||||
-- ["angels-ore3"] =
|
||||
-- {
|
||||
-- amount = 1500,
|
||||
-- size = 14,
|
||||
-- x_offset = -28,
|
||||
-- y_offset = -3
|
||||
-- },
|
||||
-- ["angels-ore5"] =
|
||||
-- {
|
||||
-- amount = 1000,
|
||||
-- size = 12,
|
||||
-- x_offset = -27,
|
||||
-- y_offset = -34
|
||||
-- },
|
||||
-- ["angels-ore6"] =
|
||||
-- {
|
||||
-- amount = 1500,
|
||||
-- size = 12,
|
||||
-- x_offset = -27,
|
||||
-- y_offset = -20
|
||||
-- },
|
||||
-- ["coal"] =
|
||||
-- {
|
||||
-- amount = 0,
|
||||
-- size = 0,
|
||||
-- x_offset = 17,
|
||||
-- y_offset = -34
|
||||
-- }
|
||||
},
|
||||
-- Special resources like oil
|
||||
resource_patches =
|
||||
{
|
||||
["crude-oil"] =
|
||||
{
|
||||
num_patches = 2,
|
||||
amount = 300000,
|
||||
x_offset_start = 0,
|
||||
y_offset_start = 48,
|
||||
x_offset_next = 4,
|
||||
y_offset_next = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-- Force the land area circle at the spawn to be fully grass
|
||||
ENABLE_SPAWN_FORCE_GRASS = true
|
||||
|
||||
-- Set this to true for the spawn area to be surrounded by a circle of trees
|
||||
SPAWN_TREE_CIRCLE_ENABLED = false
|
||||
|
||||
-- Set this to true for the spawn area to be surrounded by an octagon of trees
|
||||
-- I don't recommend using this with moatsm
|
||||
SPAWN_TREE_OCTAGON_ENABLED = true
|
||||
|
||||
---------------------------------------
|
||||
-- Safe Spawn Area Options
|
||||
@ -323,56 +398,22 @@ RESOURCE_DIST_BONUS = 2
|
||||
AUTOFILL_TURRET_AMMO_QUANTITY = 10
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- MAP CONFIGURATION OPTIONS
|
||||
-- In past versions I had a way to config map settings here to be used for cmd
|
||||
-- line launching, but now you should just be using --map-gen-settings option
|
||||
-- since it works with --start-server-load-scenario
|
||||
-- Read the README.md file for instructions.
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Alien Options
|
||||
-- I WANTED to use --map-settings but it doesn't seem to work with
|
||||
-- cmd line --start-server-load-scenario. So we're back to this. Le sigh.
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
-- You must disable this if you want to configure the enemy settings from
|
||||
-- the game GUI.
|
||||
CMD_LINE_GEN = true
|
||||
|
||||
-- Enable/Disable enemy expansion
|
||||
ENEMY_EXPANSION = true
|
||||
|
||||
-- Divide the alien evolution factors by this number to reduce it (or multiply if < 1)
|
||||
ENEMY_TIME_FACTOR_DISABLE = true -- Set this to true to disable time based evolution completely.
|
||||
ENEMY_TIME_FACTOR_DIVISOR = 10
|
||||
ENEMY_POLLUTION_FACTOR_DISABLE = false -- Set this to true to disable pollution based evolution completely.
|
||||
ENEMY_POLLUTION_FACTOR_DIVISOR = 10
|
||||
ENEMY_DESTROY_FACTOR_DISABLE = false -- Set this to true to disable spawner destruction based evolution completely.
|
||||
ENEMY_DESTROY_FACTOR_DIVISOR = 2
|
||||
|
||||
-- Adjust biter type spawning based on distance to spawns.
|
||||
OARC_MODIFIED_ENEMY_SPAWNING = true
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- ANTI-Griefing stuff ( I don't personally maintain this as I don't care for it.)
|
||||
-- These things were added from other people's requests/changes and are disabled by default.
|
||||
--------------------------------------------------------------------------------
|
||||
-- Enable this to disable some basic things like friendly fire, deconstructing from map view, etc.
|
||||
-- ENABLE_ANTI_GRIEFING = false
|
||||
ENABLE_ANTI_GRIEFING = true
|
||||
|
||||
-- Makes blueprint ghosts dissapear if they have been placed longer than this
|
||||
-- GHOST_TIME_TO_LIVE = 0 * TICKS_PER_MINUTE -- set to 0 for infinite ghost life
|
||||
GHOST_TIME_TO_LIVE = 0 * TICKS_PER_MINUTE -- set to 0 for infinite ghost life
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- DEBUG / Custom stuff
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
OARC_DIFFICULTY_CUSTOM = false
|
||||
|
||||
-- DEBUG prints for me
|
||||
global.oarcDebugEnabled = false
|
||||
-- DEBUG prints for me in game.
|
||||
global.oarcDebugEnabled = true
|
||||
|
||||
-- These are my specific welcome messages that get used only if I am the user
|
||||
-- that creates the game.
|
||||
|
@ -57,11 +57,6 @@ GAME_SURFACE_NAME="nauvis"
|
||||
----------------------------------------
|
||||
script.on_init(function(event)
|
||||
|
||||
-- Configures the map settings for enemies
|
||||
-- This controls evolution growth factors and enemy expansion settings.
|
||||
-- The only reason this is here is because --map-settings doesn't seem to work
|
||||
-- with --start-server-load-scenario
|
||||
ConfigureAlienStartingParams()
|
||||
|
||||
if ENABLE_SEPARATE_SPAWNS then
|
||||
InitSpawnGlobalsAndForces()
|
||||
|
@ -507,53 +507,6 @@ function RemoveWormsInArea(surface, area, small, medium, big, behemoth)
|
||||
end
|
||||
end
|
||||
|
||||
-- Adjust alien params
|
||||
-- I'll probably remove this if --map-settings works with command line launches.
|
||||
function ConfigureAlienStartingParams()
|
||||
if ENEMY_TIME_FACTOR_DISABLE then
|
||||
game.map_settings.enemy_evolution.time_factor = 0
|
||||
else
|
||||
game.map_settings.enemy_evolution.time_factor=game.map_settings.enemy_evolution.time_factor / ENEMY_TIME_FACTOR_DIVISOR
|
||||
end
|
||||
|
||||
if ENEMY_POLLUTION_FACTOR_DISABLE then
|
||||
game.map_settings.enemy_evolution.pollution_factor = 0
|
||||
else
|
||||
game.map_settings.enemy_evolution.pollution_factor = game.map_settings.enemy_evolution.pollution_factor / ENEMY_POLLUTION_FACTOR_DIVISOR
|
||||
end
|
||||
|
||||
if ENEMY_DESTROY_FACTOR_DISABLE then
|
||||
game.map_settings.enemy_evolution.destroy_factor = 0
|
||||
else
|
||||
game.map_settings.enemy_evolution.destroy_factor = game.map_settings.enemy_evolution.destroy_factor / ENEMY_DESTROY_FACTOR_DIVISOR
|
||||
end
|
||||
|
||||
game.map_settings.enemy_expansion.enabled = ENEMY_EXPANSION
|
||||
|
||||
-- This is my own extra tweaks, still pretty experimental.
|
||||
if (OARC_DIFFICULTY_CUSTOM) then
|
||||
-- More diffusion / larger area.
|
||||
game.map_settings.pollution.diffusion_ratio = 0.06
|
||||
|
||||
-- Biters expand further.
|
||||
game.map_settings.enemy_expansion.max_expansion_distance = 20
|
||||
|
||||
-- Small biter groups.
|
||||
game.map_settings.enemy_expansion.settler_group_min_size = 2
|
||||
game.map_settings.enemy_expansion.settler_group_max_size = 10
|
||||
|
||||
-- Longer cooldown / slower expansion.
|
||||
game.map_settings.enemy_expansion.min_expansion_cooldown = TICKS_PER_MINUTE*15
|
||||
game.map_settings.enemy_expansion.max_expansion_cooldown = TICKS_PER_MINUTE*60
|
||||
|
||||
-- Smaller groups, more frequent?
|
||||
game.map_settings.unit_group.min_group_gathering_time = TICKS_PER_MINUTE
|
||||
game.map_settings.unit_group.max_group_gathering_time = 4 * TICKS_PER_MINUTE
|
||||
game.map_settings.unit_group.max_wait_time_for_late_members = 1 * TICKS_PER_MINUTE
|
||||
game.map_settings.unit_group.max_unit_group_size = 15
|
||||
end
|
||||
end
|
||||
|
||||
-- Add Long Reach to Character
|
||||
function GivePlayerLongReach(player)
|
||||
player.character.character_build_distance_bonus = BUILD_DIST_BONUS
|
||||
@ -753,7 +706,7 @@ function CreateCropCircle(surface, centerPos, chunkArea, tileRadius)
|
||||
|
||||
-- Fill in all unexpected water in a circle
|
||||
if (distVar < tileRadSqr) then
|
||||
if (surface.get_tile(i,j).collides_with("water-tile") or ENABLE_SPAWN_FORCE_GRASS) then
|
||||
if (surface.get_tile(i,j).collides_with("water-tile") or OARC_CFG.gen_settings.force_grass) then
|
||||
table.insert(dirtTiles, {name = "grass-1", position ={i,j}})
|
||||
end
|
||||
end
|
||||
@ -784,7 +737,7 @@ function CreateCropOctagon(surface, centerPos, chunkArea, tileRadius)
|
||||
|
||||
-- Fill in all unexpected water in a circle
|
||||
if (distVar < tileRadius+2) then
|
||||
if (surface.get_tile(i,j).collides_with("water-tile") or ENABLE_SPAWN_FORCE_GRASS) then
|
||||
if (surface.get_tile(i,j).collides_with("water-tile") or OARC_CFG.gen_settings.force_grass) then
|
||||
table.insert(dirtTiles, {name = "grass-1", position ={i,j}})
|
||||
end
|
||||
end
|
||||
@ -845,9 +798,9 @@ function GenerateResourcePatch(surface, resourceName, diameter, pos, amount)
|
||||
if (diameter == 0) then
|
||||
return
|
||||
end
|
||||
for y=0, diameter do
|
||||
for x=0, diameter do
|
||||
if (not ENABLE_RESOURCE_SHAPE_CIRCLE or ((x-midPoint)^2 + (y-midPoint)^2 < midPoint^2)) then
|
||||
for y=-midPoint, midPoint do
|
||||
for x=-midPoint, midPoint do
|
||||
if (not OARC_CFG.gen_settings.resources_circle_shape or ((x)^2 + (y)^2 < midPoint^2)) then
|
||||
surface.create_entity({name=resourceName, amount=amount,
|
||||
position={pos.x+x, pos.y+y}})
|
||||
end
|
||||
|
@ -179,10 +179,10 @@ function SetupAndClearSpawnAreas(surface, chunkArea, spawnPointTable)
|
||||
RemoveInCircle(surface, chunkArea, "cliff", spawn.pos, ENFORCE_LAND_AREA_TILE_DIST+5)
|
||||
-- RemoveDecorationsArea(surface, chunkArea)
|
||||
|
||||
if (SPAWN_TREE_CIRCLE_ENABLED) then
|
||||
if (OARC_CFG.gen_settings.tree_circle) then
|
||||
CreateCropCircle(surface, spawn.pos, chunkArea, ENFORCE_LAND_AREA_TILE_DIST)
|
||||
end
|
||||
if (SPAWN_TREE_OCTAGON_ENABLED) then
|
||||
if (OARC_CFG.gen_settings.tree_octagon) then
|
||||
CreateCropOctagon(surface, spawn.pos, chunkArea, ENFORCE_LAND_AREA_TILE_DIST)
|
||||
end
|
||||
if (SPAWN_MOAT_CHOICE_ENABLED) then
|
||||
@ -239,43 +239,47 @@ end
|
||||
|
||||
-- Generate the basic starter resource around a given location.
|
||||
function GenerateStartingResources(surface, pos)
|
||||
local stonePos = {x=pos.x+START_RESOURCE_STONE_POS_X,
|
||||
y=pos.y+START_RESOURCE_STONE_POS_Y}
|
||||
local coalPos = {x=pos.x+START_RESOURCE_COAL_POS_X,
|
||||
y=pos.y+START_RESOURCE_COAL_POS_Y}
|
||||
local copperOrePos = {x=pos.x+START_RESOURCE_COPPER_POS_X,
|
||||
y=pos.y+START_RESOURCE_COPPER_POS_Y}
|
||||
local ironOrePos = {x=pos.x+START_RESOURCE_IRON_POS_X,
|
||||
y=pos.y+START_RESOURCE_IRON_POS_Y}
|
||||
local uraniumOrePos = {x=pos.x+START_RESOURCE_URANIUM_POS_X,
|
||||
y=pos.y+START_RESOURCE_URANIUM_POS_Y}
|
||||
|
||||
-- Tree generation is taken care of in chunk generation
|
||||
local rand_settings = OARC_CFG.resource_rand_pos_settings
|
||||
|
||||
-- Generate oil patches
|
||||
oil_patch_x=pos.x+START_RESOURCE_OIL_POS_X
|
||||
oil_patch_y=pos.y+START_RESOURCE_OIL_POS_Y
|
||||
for i=1,START_RESOURCE_OIL_NUM_PATCHES do
|
||||
surface.create_entity({name="crude-oil", amount=START_OIL_AMOUNT,
|
||||
position={oil_patch_x, oil_patch_y}})
|
||||
oil_patch_x=oil_patch_x+START_RESOURCE_OIL_X_OFFSET
|
||||
oil_patch_y=oil_patch_y+START_RESOURCE_OIL_Y_OFFSET
|
||||
-- Generate all resource tile patches
|
||||
if (not rand_settings.enabled) then
|
||||
for t_name,t_data in pairs (OARC_CFG.resource_tiles) do
|
||||
local pos = {x=pos.x+t_data.x_offset, y=pos.y+t_data.y_offset}
|
||||
GenerateResourcePatch(surface, t_name, t_data.size, pos, t_data.amount)
|
||||
end
|
||||
else
|
||||
-- This places resources in a semi-circle, with a random rotation.
|
||||
-- They will be in the sequence as defined in config.lua
|
||||
local random_angle_offset = math.random()
|
||||
local num_resources = TableLength(OARC_CFG.resource_tiles)
|
||||
local theta = ((math.pi) / num_resources);
|
||||
local count = 0
|
||||
for t_name,t_data in pairs (OARC_CFG.resource_tiles) do
|
||||
local angle = (theta * count) + random_angle_offset;
|
||||
|
||||
if (angle > math.pi-0.2) then angle = angle - math.pi end
|
||||
|
||||
local tx = (rand_settings.radius * math.cos(angle+(math.pi/2))) + pos.x
|
||||
local ty = (rand_settings.radius * math.sin(angle+(math.pi/2))) + pos.y
|
||||
|
||||
local pos = {x=math.floor(tx), y=math.floor(ty)}
|
||||
GenerateResourcePatch(surface, t_name, t_data.size, pos, t_data.amount)
|
||||
count = count+1
|
||||
end
|
||||
end
|
||||
|
||||
-- Generate Stone
|
||||
GenerateResourcePatch(surface, "stone", START_RESOURCE_STONE_SIZE, stonePos, START_STONE_AMOUNT)
|
||||
|
||||
-- Generate Coal
|
||||
GenerateResourcePatch(surface, "coal", START_RESOURCE_COAL_SIZE, coalPos, START_COAL_AMOUNT)
|
||||
|
||||
-- Generate Copper
|
||||
GenerateResourcePatch(surface, "copper-ore", START_RESOURCE_COPPER_SIZE, copperOrePos, START_COPPER_AMOUNT)
|
||||
|
||||
-- Generate Iron
|
||||
GenerateResourcePatch(surface, "iron-ore", START_RESOURCE_IRON_SIZE, ironOrePos, START_IRON_AMOUNT)
|
||||
|
||||
-- Generate Uranium
|
||||
GenerateResourcePatch(surface, "uranium-ore", START_RESOURCE_URANIUM_SIZE, uraniumOrePos, START_URANIUM_AMOUNT)
|
||||
-- Generate special resource patches (oil)
|
||||
for p_name,p_data in pairs (OARC_CFG.resource_patches) do
|
||||
local oil_patch_x=pos.x+p_data.x_offset_start
|
||||
local oil_patch_y=pos.y+p_data.y_offset_start
|
||||
for i=1,p_data.num_patches do
|
||||
surface.create_entity({name=p_name, amount=p_data.amount,
|
||||
position={oil_patch_x, oil_patch_y}})
|
||||
oil_patch_x=oil_patch_x+p_data.x_offset_next
|
||||
oil_patch_y=oil_patch_y+p_data.y_offset_next
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Add a spawn to the shared spawn global
|
||||
@ -486,12 +490,13 @@ function SendPlayerToNewSpawnAndCreateIt(playerName, spawn, moatEnabled)
|
||||
ClearNearbyEnemies(spawn, SAFE_AREA_TILE_DIST, game.surfaces[GAME_SURFACE_NAME])
|
||||
|
||||
-- Create the spawn resources here
|
||||
local water_data = OARC_CFG.water
|
||||
CreateWaterStrip(game.surfaces[GAME_SURFACE_NAME],
|
||||
{x=spawn.x+WATER_SPAWN_OFFSET_X, y=spawn.y+WATER_SPAWN_OFFSET_Y},
|
||||
WATER_SPAWN_LENGTH)
|
||||
{x=spawn.x+water_data.x_offset, y=spawn.y+water_data.y_offset},
|
||||
water_data.length)
|
||||
CreateWaterStrip(game.surfaces[GAME_SURFACE_NAME],
|
||||
{x=spawn.x+WATER_SPAWN_OFFSET_X, y=spawn.y+WATER_SPAWN_OFFSET_Y+1},
|
||||
WATER_SPAWN_LENGTH)
|
||||
{x=spawn.x+water_data.x_offset, y=spawn.y+water_data.y_offset+1},
|
||||
water_data.length)
|
||||
GenerateStartingResources(game.surfaces[GAME_SURFACE_NAME], spawn)
|
||||
|
||||
-- Send the player to that position
|
||||
|
Loading…
x
Reference in New Issue
Block a user