From 74eb162d9a3da8f22b953bb823a5e7d2462dac7a Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Sun, 28 Sep 2025 11:36:00 +0200 Subject: [PATCH] Remove enemies from starting area when leaving Lignumis --- lignumis/scripts/to-nauvis.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lignumis/scripts/to-nauvis.lua b/lignumis/scripts/to-nauvis.lua index 0e8a553..a3694fa 100644 --- a/lignumis/scripts/to-nauvis.lua +++ b/lignumis/scripts/to-nauvis.lua @@ -25,6 +25,21 @@ local function init_nauvis() end +-- Removes enemies around the crash site to not mess with the player start +local function clear_enemies() + local nauvis = game.planets[storage.target_planet].surface + local enemies = nauvis.find_entities_filtered({ + position = { 0, 0 }, + radius = 200, + force = "enemy" + }) + for _, enemy in pairs(enemies) do + enemy.destroy() + end + +end + + -- Teleport player to Nauvis and show welcome message local function teleport_player(player) local nauvis = game.planets[storage.target_planet].surface @@ -67,6 +82,7 @@ local function transit_player(player_index) end init_nauvis() + clear_enemies() teleport_player(player) init_freeplay()