Compare commits

...
Sign in to create a new pull request.

23 commits

Author SHA1 Message Date
Simon Brodtmann
d5ce5d42d5 Readme 2025-06-10 09:39:09 +02:00
Simon Brodtmann
7abcc07a0b 1.0.53 2025-06-08 18:15:32 +02:00
Simon Brodtmann
0b72861273 Reduce usage of resources for some buildings 2025-06-08 17:19:31 +02:00
Simon Brodtmann
4553e887a3 Any Planet Start: Works with moons now 2025-06-08 17:09:51 +02:00
Simon Brodtmann
c20f490d81 Gold plates require 1 gold ore again 2025-06-08 17:09:51 +02:00
Simon Brodtmann
1dc928acdd Readme 2025-06-08 00:03:36 +02:00
Simon Brodtmann
6eb8338779 1.0.52 2025-06-06 14:26:30 +02:00
Simon Brodtmann
e0df3f1335 Add flames and explosions to transition 2025-06-06 14:25:52 +02:00
Simon Brodtmann
d09b66deb5 Increase speed of rocket a bit 2025-06-06 14:25:17 +02:00
Simon Brodtmann
0ea9d1a170 1.0.51 2025-06-06 13:41:58 +02:00
Simon Brodtmann
8c88e8ac8a Crushing industry + Hot metals: Fix crushed gold not being smelted into hot gold 2025-06-05 16:52:02 +02:00
Simon Brodtmann
b889d0db26 Adjust essential flags on technologies 2025-06-04 23:02:14 +02:00
Simon Brodtmann
05b7278b80 Readme 2025-06-04 23:02:14 +02:00
Simon Brodtmann
2ccc07fd74 1.0.50 2025-06-04 16:35:57 +02:00
Simon Brodtmann
23f5286d22 Reapply "Improve transition to Nauvis"
This reverts commit 4e415782f2.
2025-06-04 16:34:02 +02:00
Simon Brodtmann
9c18aba1da 1.0.49 2025-06-04 16:32:26 +02:00
Simon Brodtmann
4e415782f2 Revert "Improve transition to Nauvis"
This reverts commit 07df28273d.
2025-06-04 16:30:52 +02:00
Simon Brodtmann
3683a492c0 Burner-Leech-Fork is not incompatible anymore 2025-06-04 16:24:22 +02:00
Simon Brodtmann
57b3ee9ece Enable burner leech when no dedicated mod is installed 2025-06-03 22:51:33 +02:00
Simon Brodtmann
e56b5a7087 Correct indentation 2025-06-03 19:53:10 +02:00
Simon Brodtmann
822eb1fd7c 1.0.48 2025-06-03 19:51:28 +02:00
Simon Brodtmann
07df28273d Improve transition to Nauvis 2025-06-03 19:46:55 +02:00
Simon Brodtmann
6fc153f3bd Make InserterFuelLeech optional 2025-06-03 16:50:33 +02:00
21 changed files with 249 additions and 70 deletions

View file

@ -1,16 +1,38 @@
[![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/ufvFUJtVwk)[![Forgejo](https://img.shields.io/badge/source%20code-%23f4f4f5?style=for-the-badge&logo=forgejo&logoColor=%23c2410c)](https://git.cacklingfiend.info/cacklingfiend/lignumis)
_________________
![Lignumis poster](https://git.cacklingfiend.info/cacklingfiend/lignumis-assets/raw/commit/27e61170a897dc4a6afc7d518629899a3b05b6f0/sources/poster.jpg)
## Lignumis
This mod extends the early game of Space Age by putting you on the moon "Lignumis" before you escape to Nauvis. It concentrates on wood and steam technologies, giving you some early game production chains for those resources.
The duration of the stay on Lignumis will be rather short. The impact of the later game will still be substantial (once implemented).
The duration of the stay on Lignumis will be rather short. The impact of the later game will still be substantial.
**Warning when adding to existing games:** With the default settings, this mod will break a few things in your existing bases and space ships. Check out the settings to disable what you don't like.
#### Streamers featuring Lignumis
[![S1-E01 - Lumber Support - Laurence Plays Factorio: Planetary Pioneers](https://i.ytimg.com/vi/1eH4oJtlBpE/hqdefault.jpg?sqp=-oaymwEcCPYBEIoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLD6UdmD7HuhCdhQBCCSL38Ke_FpXg)](https://www.youtube.com/watch?v=1eH4oJtlBpE)
[![Factorio Multiplayer: Planetary Pioneers - Space Age - E01 - 02/06/25 - Laurence Streams](https://i.ytimg.com/vi/OMDpDhZdTmU/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLCVQhrlcmwsZbzRDNQo8vgMKtUHaA)](https://www.youtube.com/live/OMDpDhZdTmU?feature=shared&t=290&list=PLALTzJaRcgW97ItZgtZvkqFBcdVjKNVHz&index=1) [![Factorio Multiplayer: Planetary Pioneers - Space Age - E01.5 - 02/06/25 - Laurence Streams](https://i.ytimg.com/vi/d4n1H6Z4KPc/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLA5TNZBTs7GpUFdVB1CG1-hzYw0tw)](https://www.youtube.com/live/d4n1H6Z4KPc?list=PLALTzJaRcgW97ItZgtZvkqFBcdVjKNVHz&index=3)
_________________
## Mod recommendations
The following mods can be a great addition for this mod:
#### [Inserter Fuel Leech](https://mods.factorio.com/mod/InserterFuelLeech)
While optional, the intended way is to use this mod for the burner phase as it improves the fueling experience of burner entities.
For UPS optimizations, you can disable this mod once the burner phase is over.
Alternatives: [Burner Leech Fork](https://mods.factorio.com/mod/Burner-Leech-Fork), [Burner Leech](https://mods.factorio.com/mod/Burner-Leech)
#### [Any Planet Start](https://mods.factorio.com/mod/any-planet-start)
Allows you to choose the planet that Lignumis orbits. You can continue on Vulcanus, Fulgora or Gleba after leaving Lignumis.
Some modded planets add APS support as well (sometimes with a separate mod).
#### [Diversitree](https://mods.factorio.com/mod/Diversitree)
@ -32,7 +54,7 @@ If you like go more into the charcoal direction. It has no overlap with Lignumis
For wood on Aquilo.
#### [Crushing Industry](https://mods.factorio.com/mod/crushing-industry)
#### [Crushing Industry](https://mods.factorio.com/mod/crushing-industry) with [Crushing Industry - Productivity Research](https://mods.factorio.com/mod/crushing-industry-productivity-research)
Recommended with high science cost settings. It adds crushers and crushed ores to increase productivity.
Lignumis adds crushed gold ore and a technology to unlock the crusher with wood and steam science packs.
@ -49,6 +71,8 @@ Add this for increased complexity in the early Nauvis game. It has no effect on
For even more complexity after Lignumis. They currently don't change anything on Lignumis itself.
_________________
## Compatibility with other planet mods
The following planet mods are tested for (at least technical) compatibility:
@ -65,12 +89,18 @@ The following planet mods are tested for (at least technical) compatibility:
- [Terra Palus](https://mods.factorio.com/mod/terrapalus)
- [Secretas & Frozeta](https://mods.factorio.com/mod/secretas)
This list is probably not up-to-date. In doubt, just try it out.
_________________
## Problematic / incompatible mods
* The combination of AAI Industry and Any planet start is currently not supported.
* Alien Biomes: Lignumis won't have any trees. It's playable, but not as intended.
* The rest of the Wooden Universe: I marked the ones incompatible that don't make sense to combine or that wouldn't add more that is not already included.
_________________
## Add compatibility to your mod
Lignumis, by default, adds wood and steam science packs during `data-updates.lua` to all technologies that match certain criteria.
@ -121,17 +151,19 @@ data.raw["string-setting"]["lignumis-second-planet"].allowed_values = { "gleba"
data.raw["string-setting"]["lignumis-second-planet"].default_value = "gleba"
```
_________________
## Todo
- Fix pipe graphics on desiccation furnace and quality assembler
- Trees must not die when absorbing noise
- https://lua-api.factorio.com/latest/types/TreeVariation.html
- Improve transition to Nauvis a bit more
- Add information in Factoriopedia
- Compatibility with [On Wayward Seas](https://mods.factorio.com/mod/wayward-seas)
- Compatibility with [Exotic Space Industries](https://mods.factorio.com/mod/exotic-space-industries)
- Compatibility with [Noble Metals](https://mods.factorio.com/mod/bzgold) once it's updated
- "Hardcore Lignumis"
_________________
## Credits

View file

@ -1,4 +1,44 @@
---------------------------------------------------------------------------------------------------
Version: 1.0.53
Date: 08.06.2025
Changes:
- Gold plates require 1 gold ore again and buff gold by 33%
- Reduce usage of resources for some buildings
Bug Fixes:
- Any Planet Start: Works with moons now (required for Cerys)
---------------------------------------------------------------------------------------------------
Version: 1.0.52
Date: 06.06.2025
Changes:
- Increase speed of rocket a bit
- Add flames and explosions to transition
---------------------------------------------------------------------------------------------------
Version: 1.0.51
Date: 06.06.2025
Changes:
- Adjust essential flags on technologies
Bug Fixes:
- Crushing industry + Hot metals: Fix crushed gold not being smelted into hot gold
---------------------------------------------------------------------------------------------------
Version: 1.0.50
Date: 04.06.2025
Changes:
- Reapply "Improve transition to Nauvis"
---------------------------------------------------------------------------------------------------
Version: 1.0.49
Date: 04.06.2025
Changes:
- Enable burner leech when no dedicated mod is installed
- Burner-Leech-Fork is not incompatible anymore
Bug Fixes:
- Revert "Improve transition to Nauvis" since it requires currently unstable Factorio version 2.0.53
---------------------------------------------------------------------------------------------------
Version: 1.0.48
Date: 03.06.2025
Changes:
- Make InserterFuelLeech optional
- Improve transition to Nauvis
---------------------------------------------------------------------------------------------------
Version: 1.0.47
Date: 31.05.2025
Bug Fixes:

View file

@ -1,2 +1,7 @@
require("prototypes/content/final")
require("prototypes/compatibility/final")
require("prototypes/compatibility/final")
if not mods["Burner-Leech-Fork"] and not mods["Burner-Leech"] and not mods["InserterFuelLeech"] then
data.raw["inserter"]["burner-inserter"].allow_burner_leech = true
data.raw["inserter"]["burner-long-handed-inserter"].allow_burner_leech = true
end

View file

@ -1,6 +1,6 @@
{
"name": "lignumis",
"version": "1.0.47",
"version": "1.0.53",
"title": "Lignumis",
"description": "Dive into the world of Lignumis, a moon of Nauvis offering only the most basic technologies.",
"author": "cackling fiend",
@ -9,12 +9,11 @@
"space_travel_required": true,
"dependencies": [
"base",
"space-age >= 2.0.33",
"space-age >= 2.0.53",
"astroponics >= 1.2.0",
"bioprocessing-tab",
"cf-lib >= 0.0.13",
"flib",
"InserterFuelLeech",
"lignumis-assets >= 1.0.3",
"mf-buildings >= 1.0.7",
"mf-core >= 1.0.3",
@ -34,13 +33,12 @@
"?gleba-reborn",
"?hot-metals >= 1.1.0",
"?lane-splitters",
"(?)metal-and-stars",
"?metal-and-stars",
"(?)secretas",
"(?)Wood_Gasification_updated",
"?wood-industry",
"?wood-military >= 2.3.3",
"!apm_power_ldinc",
"!Burner-Leech-Fork",
"!early-agriculture",
"!planet-picker",
"!wood-logistics",

View file

@ -7,7 +7,8 @@ local target_planet = settings.startup["aps-planet"].value
if target_planet == "none" or target_planet == "nauvis" then return end
-- Switch planet discovery technology to the new planet
Technology:new("planet-discovery-" .. target_planet)
local planet_discovery = data.raw.technology["planet-discovery-" .. target_planet] or data.raw.technology["moon-discovery-" .. target_planet]
Technology:new(planet_discovery)
:assign({
enabled = true,
hidden = false

View file

@ -10,7 +10,8 @@ Technology:new("tree-seeding"):setPrerequisites({ "wood-science-pack" })
-- Switch planet discovery technology to the new planet
Technology:new("planet-discovery-" .. target_planet)
local planet_discovery = data.raw.technology["planet-discovery-" .. target_planet] or data.raw.technology["moon-discovery-" .. target_planet]
Technology:new(planet_discovery)
:assign({
enabled = true,
hidden = false,
@ -24,8 +25,8 @@ Technology:new("planet-discovery-" .. target_planet)
}
})
:setPrerequisites({ "provisional-rocketry" })
Technology:new("iron-processing"):replacePrerequisite("planet-discovery-nauvis", "planet-discovery-" .. target_planet)
Technology:new("copper-processing"):replacePrerequisite("planet-discovery-nauvis", "planet-discovery-" .. target_planet)
Technology:new("iron-processing"):replacePrerequisite("planet-discovery-nauvis", planet_discovery.name)
Technology:new("copper-processing"):replacePrerequisite("planet-discovery-nauvis", planet_discovery.name)
-- Vulcanus

View file

@ -0,0 +1,10 @@
local Technology = require("__cf-lib__/data/Technology")
if not mods["crushing-industry"] then return end
if not settings.startup["crushing-industry-ore"].value then return end
if mods["aai-industry"] then
Technology:new("burner-mechanics"):removeRecipe("burner-crusher")
else
Technology:new("steam-power"):removeRecipe("burner-crusher")
end

View file

@ -53,7 +53,7 @@ data:extend({
auto_recycle = false,
hide_from_player_crafting = settings.startup["crushing-industry-hide-player-crafting"].value,
energy_required = 3.2,
ingredients = { { type = "item", name = "crushed-gold-ore", amount = 2 } },
ingredients = { { type = "item", name = "crushed-gold-ore", amount = 1 } },
results = { { type = "item", name = "gold-plate", amount = 1 } },
main_product = "gold-plate",
},
@ -84,14 +84,6 @@ if settings.startup["crushing-industry-byproducts"].value then
table.insert(data.raw["recipe"]["crushed-gold-ore"].results, { type = "item", name = "sand", amount = 1, probability = 0.02 })
end
if mods["aai-industry"] then
Technology:new("burner-mechanics"):removeRecipe("burner-crusher")
else
Technology:new("steam-power"):removeRecipe("burner-crusher")
end
local gold_recipe = Recipe:new("burner-crusher")
:replaceIngredient("iron-gear-wheel", "wooden-gear-wheel")
:replaceIngredient("iron-plate", "gold-plate")

View file

@ -5,4 +5,5 @@ require("alien-biomes")
require("aai-loaders")
require("nuclear-science")
require("lane-splitters")
require("wood-industry")
require("wood-industry")
require("crushing-industry")

View file

@ -1,4 +1,4 @@
require("aai-industry")
require("gleba-reborn")
require("any-planet-start")
require("crushing-industry")
require("crushing-industry-updates")

View file

@ -51,9 +51,9 @@ local turret_recipe = {
enabled = false,
energy_required = 8,
ingredients = {
{ type = "item", name = "wooden-gear-wheel", amount = 10 },
{ type = "item", name = "wooden-gear-wheel", amount = 5 },
{ type = "item", name = "lumber", amount = 10 },
{ type = "item", name = "gold-plate", amount = 20 }
{ type = "item", name = "gold-plate", amount = 10 }
},
results = { { type = "item", name = "basic-gun-turret", amount = 1 } }
}

View file

@ -87,8 +87,8 @@ data:extend({
energy_required = 10,
ingredients = {
{ type = "item", name = "stone-brick", amount = 5 },
{ type = "item", name = "wooden-gear-wheel", amount = 20 },
{ type = "item", name = "lumber", amount = 20 },
{ type = "item", name = "wooden-gear-wheel", amount = 15 },
{ type = "item", name = "lumber", amount = 15 },
{ type = "item", name = "gold-plate", amount = basic_circuit_board and 10 or 20 },
basic_circuit_board and { type = "item", name = "basic-circuit-board", amount = 10 } or nil
},
@ -124,8 +124,8 @@ data:extend({
energy_required = 10,
ingredients = {
{ type = "item", name = "stone-brick", amount = 5 },
{ type = "item", name = "wooden-gear-wheel", amount = 20 },
{ type = "item", name = "lumber", amount = 20 },
{ type = "item", name = "wooden-gear-wheel", amount = 15 },
{ type = "item", name = "lumber", amount = 15 },
{ type = "item", name = "copper-plate", amount = 10 },
{ type = "item", name = basic_circuit_board and "basic-circuit-board" or "electronic-circuit", amount = 10 }
},

View file

@ -20,7 +20,7 @@ data:extend({
name = "gold-plate",
category = "smelting",
energy_required = 3.2,
ingredients = { { type = "item", name = "gold-ore", amount = 2 } },
ingredients = { { type = "item", name = "gold-ore", amount = 1 } },
results = { { type = "item", name = "gold-plate", amount = 1 } },
allow_productivity = true
},

View file

@ -147,7 +147,7 @@ plant.minable = {
mining_time = 2,
results = {
{ type = "item", name = "moist-stromatolite-remnant", amount = 25 },
{ type = "item", name = "gold-bacteria", amount = 30 },
{ type = "item", name = "gold-bacteria", amount = 20 },
{ type = "item", name = "gold-stromatolite-seed", amount_min = 1, amount_max = 3 }
}
}

View file

@ -31,11 +31,11 @@ local lumber_mill_item = LumberMill.ItemBuilder:new()
LumberMill.RecipeBuilder:new()
:ingredients(table.trim({
{ type = "item", name = "stone-brick", amount = 40 },
{ type = "item", name = "lumber", amount = 100 },
{ type = "item", name = "wooden-gear-wheel", amount = 100 },
{ type = "item", name = "gold-plate", amount = basic_circuit_board and 30 or 60 },
basic_circuit_board and { type = "item", name = "basic-circuit-board", amount = 30 } or nil,
{ type = "item", name = "burner-assembling-machine", amount = 5 }
{ type = "item", name = "lumber", amount = 50 },
{ type = "item", name = "wooden-gear-wheel", amount = 50 },
{ type = "item", name = "gold-plate", amount = basic_circuit_board and 20 or 40 },
basic_circuit_board and { type = "item", name = "basic-circuit-board", amount = 20 } or nil,
{ type = "item", name = "burner-assembling-machine", amount = 2 }
}))
:apply({
category = "wood-processing-or-assembling"
@ -53,8 +53,8 @@ LumberMill.RecipeBuilder:new()
{ type = "item", name = "stone-brick", amount = 40 },
{ type = "item", name = "lumber", amount = 50 },
{ type = "item", name = "wooden-gear-wheel", amount = 50 },
{ type = "item", name = "copper-plate", amount = basic_circuit_board and 30 or 60 },
{ type = "item", name = basic_circuit_board and "basic-circuit-board" or "electronic-circuit", amount = 30 },
{ type = "item", name = "copper-plate", amount = basic_circuit_board and 20 or 40 },
{ type = "item", name = basic_circuit_board and "basic-circuit-board" or "electronic-circuit", amount = 20 },
{ type = "item", name = "assembling-machine-1", amount = 2 }
})
:apply({

View file

@ -3,7 +3,6 @@ data:extend({
type = "technology",
name = "planet-discovery-lignumis",
icons = PlanetsLib.technology_icons_moon(Lignumis.graphics .. "technology/lignumis.png", 256),
essential = true,
effects = {
{
type = "unlock-space-location",
@ -117,7 +116,6 @@ data:extend({
name = "iron-processing",
icon = "__base__/graphics/icons/iron-plate.png",
icon_size = 64,
essential = true,
effects = {
{
type = "unlock-recipe",
@ -143,7 +141,6 @@ data:extend({
name = "copper-processing",
icon = "__base__/graphics/icons/copper-plate.png",
icon_size = 64,
essential = true,
effects = {
{
type = "unlock-recipe",

View file

@ -147,8 +147,8 @@ data:extend({
category = "wood-processing-or-assembling",
energy_required = 2,
ingredients = {
{ type = "item", name = "lumber", amount = 10 },
{ type = "item", name = "wooden-gear-wheel", amount = 10 },
{ type = "item", name = "lumber", amount = 6 },
{ type = "item", name = "wooden-gear-wheel", amount = 4 },
{ type = "item", name = "stone-brick", amount = 10 },
{ type = "item", name = "gold-plate", amount = basic_circuit_board and 10 or 20 },
basic_circuit_board and { type = "item", name = "basic-circuit-board", amount = 10 } or nil

View file

@ -67,10 +67,10 @@ local silo_recipe = table.deepcopy(data.raw["recipe"]["rocket-silo"])
silo_recipe.name = "provisional-rocket-silo"
silo_recipe.results[1].name = "provisional-rocket-silo"
silo_recipe.ingredients = {
{ type = "item", name = "lumber", amount = 500 },
{ type = "item", name = "wooden-gear-wheel", amount = 250 },
{ type = "item", name = "stone-brick", amount = 500 },
{ type = "item", name = "gold-plate", amount = 500 },
{ type = "item", name = "lumber", amount = 400 },
{ type = "item", name = "wooden-gear-wheel", amount = 150 },
{ type = "item", name = "stone-brick", amount = 400 },
{ type = "item", name = "gold-plate", amount = 400 },
basic_circuit_board and { type = "item", name = "basic-circuit-board", amount = 100 } or
{ type = "item", name = "gold-cable", amount = 100 }
}
@ -79,9 +79,9 @@ local rocket = table.deepcopy(data.raw["rocket-silo-rocket"]["rocket-silo-rocket
rocket.name = "provisional-rocket"
rocket.inventory_size = 40
rocket.rising_speed = 1 / (14 * 60)
rocket.engine_starting_speed = 1 / (11 * 60)
rocket.flying_speed = 1 / (4000 * 60)
rocket.flying_acceleration = 0.005
rocket.engine_starting_speed = 1 / (8 * 60)
rocket.flying_speed = 1 / (3000 * 60)
rocket.flying_acceleration = 0.007
rocket.rocket_sprite.layers[1].filename = Lignumis.graphics .. "entity/wooden-rocket-silo/rocket-static-pod.png"
local rocket_part_recipe = {

View file

@ -71,6 +71,10 @@ Init.events[defines.events.on_player_created] = function(event)
game.print("While Alien Biomes is playable with Lignumis, it is not recommended as it prevents trees from being generated on Lignumis.")
end
if not script.active_mods["Burner-Leech-Fork"] and not script.active_mods["Burner-Leech"] and not script.active_mods["InserterFuelLeech"] then
game.print("Lignumis: You are starting a new game without a burner leech mod. The intended experience is to use one of the available options. You can disable such a mod after the burner phase of the game. See the mod page for more details.")
end
if not script.active_mods["any-planet-start"] then
init_player(event)
init_freeplay(event)

View file

@ -29,7 +29,7 @@ end
local function teleport_player(player)
local nauvis = game.planets[storage.target_planet].surface
if player.surface.name == "lignumis" then
local position = nauvis.find_non_colliding_position("character", { 0, 0 }, 100, 1) or { 0, 0 }
local position = nauvis.find_non_colliding_position("character", { 2, 2 }, 100, 1) or { 0, 0 }
player.teleport(position, storage.target_planet)
chart_starting_area(nauvis, player)
end
@ -57,35 +57,131 @@ local function init_freeplay()
end
ToNauvis.events[defines.events.on_rocket_launched] = function(event)
if not event.rocket_silo or event.rocket_silo.name ~= "provisional-rocket-silo" then return end
local function transit_player(player_index)
local player = game.get_player(player_index)
local transition = storage.transitions[player_index]
local rocket_entry
local rocket_entry_index
local player
for i, entry in pairs(storage.rocket_silos) do
if entry.real_silo == event.rocket_silo then
rocket_entry = entry
rocket_entry_index = i
player = entry.player and game.get_player(entry.player) or game.players[1]
break
end
end
transition.rocket_entry.cargo_pod.set_passenger(nil)
transition.rocket_entry.cargo_pod.destroy()
init_nauvis()
teleport_player(player)
init_freeplay()
-- Give the player the content of the rocket
if rocket_entry.rocket_content then
if transition.rocket_entry.rocket_content then
local inventory = player.get_main_inventory()
for _, item in pairs(rocket_entry.rocket_content) do
for _, item in pairs(transition.rocket_entry.rocket_content) do
inventory.insert(item)
end
inventory.sort_and_merge()
end
table.remove(storage.rocket_silos, rocket_entry_index)
table.remove(storage.rocket_silos, transition.rocket_entry_index)
end
local function explode_silo(silo)
silo.die()
end
local get_random_position = function(box, x_scale, y_scale)
x_scale = x_scale or 1
y_scale = y_scale or 1
local x1 = box.left_top.x
local y1 = box.left_top.y
local x2 = box.right_bottom.x
local y2 = box.right_bottom.y
local x = ((x2 - x1) * x_scale * (math.random() - 0.5)) + ((x1 + x2) / 2)
local y = ((y2 - y1) * y_scale * (math.random() - 0.5)) + ((y1 + y2) / 2)
return { x, y }
end
local function burn_silo(silo)
local surface = silo.surface
local box = silo.bounding_box
for k = 1, 6 do
local position = get_random_position(box, 0.8, 0.5)
surface.create_entity
{
name = "crash-site-fire-flame",
position = position
}
local fire = surface.create_entity
{
name = "crash-site-fire-smoke",
position = position
}
fire.time_to_live = math.random(59 * 9, 59 * 14 - 1)
fire.time_to_next_effect = math.random(59 * 2)
end
end
local function pre_explode_silo(silo)
local surface = silo.surface
local box = silo.bounding_box
for k = 1, 3 do
local explosions = surface.create_entity
{
name = "crash-site-explosion-smoke",
position = get_random_position(box, 0.8, 0.5)
}
explosions.time_to_live = math.random(59 * 6, 59 * 11 - 1)
explosions.time_to_next_effect = math.random(59 * 3)
end
end
ToNauvis.events[defines.events.on_rocket_launch_ordered] = function(event)
if not event.rocket_silo or event.rocket_silo.name ~= "provisional-rocket-silo" then return end
local player
for i, entry in pairs(storage.rocket_silos) do
if entry.real_silo == event.rocket_silo then
if not storage.transitions then
storage.transitions = {}
end
player = entry.player and game.get_player(entry.player) or game.players[1]
storage.transitions[player.index] = {
rocket_entry = entry,
rocket_entry_index = i
}
break
end
end
local burn_tick = game.tick + (14 * 59)
local pre_explode_tick = game.tick + (17 * 59)
local transit_tick = game.tick + (23 * 59)
local explode_tick = game.tick + (28 * 59)
script.on_nth_tick(burn_tick, function()
burn_silo(event.rocket_silo)
script.on_nth_tick(burn_tick, nil)
end)
script.on_nth_tick(pre_explode_tick, function()
pre_explode_silo(event.rocket_silo)
script.on_nth_tick(pre_explode_tick, nil)
end)
script.on_nth_tick(transit_tick, function()
transit_player(player.index)
script.on_nth_tick(transit_tick, nil)
end)
script.on_nth_tick(explode_tick, function()
explode_silo(event.rocket_silo)
script.on_nth_tick(explode_tick, nil)
end)
end
ToNauvis.events[defines.events.on_post_entity_died] = function(event)
if not event.ghost or event.prototype.name ~= "provisional-rocket-silo" then return end
event.ghost.destroy()
end
return ToNauvis

View file

@ -92,8 +92,10 @@ local function launch(event)
if entry.fake_silo == fake_silo then
entry.player = event.player_index
entry.rocket_content = rocket_content
entry.cargo_pod = entry.real_silo.rocket.attached_cargo_pod
fake_silo.destroy()
entry.real_silo.launch_rocket()
entry.cargo_pod.set_passenger(player)
break
end
end