Compare commits

..

1 commit

Author SHA1 Message Date
f782707c90 Update ru locale 2025-06-01 12:14:33 +02:00
24 changed files with 72 additions and 307 deletions

View file

@ -1,37 +1,16 @@
[![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.
The duration of the stay on Lignumis will be rather short. The impact of the later game will still be substantial (once implemented).
**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) [![S1-E01 - Lumber Support - Laurence Plays Factorio: Planetary Pioneers](https://i.ytimg.com/vi/TNR1-Z5XFxI/hqdefault.jpg?sqp=-oaymwEcCPYBEIoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLAvatJCSqylrWAZQyTkcBW_lB82rA)](https://www.youtube.com/watch?v=TNR1-Z5XFxI)
[![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=2) [![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) [![Factorio Multiplayer: Planetary Pioneers - Space Age - E02 - 09/06/25 - Laurence Streams](https://i.ytimg.com/vi/guWhjqPrVN0/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLAP1kKquScBtrf5w41Eaarp-y5UPA)](https://www.youtube.com/live/guWhjqPrVN0?list=PLALTzJaRcgW97ItZgtZvkqFBcdVjKNVHz&index=4&t=362)
_________________
## 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)
@ -53,7 +32,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) with [Crushing Industry - Productivity Research](https://mods.factorio.com/mod/crushing-industry-productivity-research)
#### [Crushing Industry](https://mods.factorio.com/mod/crushing-industry)
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.
@ -70,8 +49,6 @@ 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:
@ -88,18 +65,12 @@ 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.
@ -150,19 +121,17 @@ 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,44 +1,4 @@
---------------------------------------------------------------------------------------------------
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,7 +1,2 @@
require("prototypes/content/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
require("prototypes/compatibility/final")

View file

@ -1,6 +1,6 @@
{
"name": "lignumis",
"version": "1.0.53",
"version": "1.0.47",
"title": "Lignumis",
"description": "Dive into the world of Lignumis, a moon of Nauvis offering only the most basic technologies.",
"author": "cackling fiend",
@ -9,11 +9,12 @@
"space_travel_required": true,
"dependencies": [
"base",
"space-age >= 2.0.53",
"space-age >= 2.0.33",
"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",
@ -33,12 +34,13 @@
"?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

@ -138,7 +138,6 @@ active-noise-cancelling=Active noise cancelling
quality-assembler=Quality assembler
aai-wood-loader=Wood loader
basic-ore-crushing=Basic ore crushing
astroponics-productivity=Astroponics productivity
[technology-description]
wood-science-pack=Allows research of basic technologies based on wood products.

View file

@ -7,8 +7,7 @@ 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
local planet_discovery = data.raw.technology["planet-discovery-" .. target_planet] or data.raw.technology["moon-discovery-" .. target_planet]
Technology:new(planet_discovery)
Technology:new("planet-discovery-" .. target_planet)
:assign({
enabled = true,
hidden = false

View file

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

View file

@ -1,10 +0,0 @@
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 = 1 } },
ingredients = { { type = "item", name = "crushed-gold-ore", amount = 2 } },
results = { { type = "item", name = "gold-plate", amount = 1 } },
main_product = "gold-plate",
},
@ -84,6 +84,14 @@ 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,5 +5,4 @@ require("alien-biomes")
require("aai-loaders")
require("nuclear-science")
require("lane-splitters")
require("wood-industry")
require("crushing-industry")
require("wood-industry")

View file

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

View file

@ -51,9 +51,9 @@ local turret_recipe = {
enabled = false,
energy_required = 8,
ingredients = {
{ type = "item", name = "wooden-gear-wheel", amount = 5 },
{ type = "item", name = "wooden-gear-wheel", amount = 10 },
{ type = "item", name = "lumber", amount = 10 },
{ type = "item", name = "gold-plate", amount = 10 }
{ type = "item", name = "gold-plate", amount = 20 }
},
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 = 15 },
{ type = "item", name = "lumber", amount = 15 },
{ type = "item", name = "wooden-gear-wheel", amount = 20 },
{ type = "item", name = "lumber", amount = 20 },
{ 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 = 15 },
{ type = "item", name = "lumber", amount = 15 },
{ type = "item", name = "wooden-gear-wheel", amount = 20 },
{ type = "item", name = "lumber", amount = 20 },
{ 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 = 1 } },
ingredients = { { type = "item", name = "gold-ore", amount = 2 } },
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 = 20 },
{ type = "item", name = "gold-bacteria", amount = 30 },
{ type = "item", name = "gold-stromatolite-seed", amount_min = 1, amount_max = 3 }
}
}

View file

@ -13,8 +13,6 @@ data:extend({
table.insert(data.raw["character"]["character"].crafting_categories, "wood-processing-or-assembling")
local has_oxygen = data.raw["surface-property"]["oxygen"] ~= nil
LumberMill.EntityBuilder:new()
:burnerEnergySource({ emissions_per_minute = { noise = 100 } })
:baseProductivity(0.5)
@ -22,16 +20,6 @@ LumberMill.EntityBuilder:new()
crafting_categories = { "wood-processing-or-assembling" },
crafting_speed = 2,
energy_usage = "1000kW",
surface_conditions = {
{
property = has_oxygen and "oxygen" or "pressure",
min = 10
},
{
property = "gravity",
min = 1
}
}
})
local lumber_mill_item = LumberMill.ItemBuilder:new()
@ -43,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 = 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 }
{ 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 }
}))
:apply({
category = "wood-processing-or-assembling"
@ -65,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 20 or 40 },
{ type = "item", name = basic_circuit_board and "basic-circuit-board" or "electronic-circuit", amount = 20 },
{ 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 = "assembling-machine-1", amount = 2 }
})
:apply({

View file

@ -3,6 +3,7 @@ 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",
@ -116,6 +117,7 @@ data:extend({
name = "iron-processing",
icon = "__base__/graphics/icons/iron-plate.png",
icon_size = 64,
essential = true,
effects = {
{
type = "unlock-recipe",
@ -141,6 +143,7 @@ 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 = 6 },
{ type = "item", name = "wooden-gear-wheel", amount = 4 },
{ type = "item", name = "lumber", amount = 10 },
{ type = "item", name = "wooden-gear-wheel", amount = 10 },
{ 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 = 400 },
{ type = "item", name = "wooden-gear-wheel", amount = 150 },
{ type = "item", name = "stone-brick", amount = 400 },
{ type = "item", name = "gold-plate", amount = 400 },
{ 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 },
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 / (8 * 60)
rocket.flying_speed = 1 / (3000 * 60)
rocket.flying_acceleration = 0.007
rocket.engine_starting_speed = 1 / (11 * 60)
rocket.flying_speed = 1 / (4000 * 60)
rocket.flying_acceleration = 0.005
rocket.rocket_sprite.layers[1].filename = Lignumis.graphics .. "entity/wooden-rocket-silo/rocket-static-pod.png"
local rocket_part_recipe = {

View file

@ -1,43 +0,0 @@
data:extend({
{
type = "technology",
name = "astroponics-productivity",
icons = {
{ icon = "__base__/graphics/icons/wood.png", icon_size = 64 },
{ icon = "__astroponics__/graphics/icons/fluid/liquid-fertilizer.png", shift = { -32, -32 }, scale = 1.2 },
{
icon = "__core__/graphics/icons/technology/constants/constant-recipe-productivity.png",
icon_size = 128,
scale = 0.5,
shift = { 50, 50 },
floating = true
}
},
essential = false,
level = 1,
max_level = 5,
show_levels_info = true,
effects = {
{
type = "change-recipe-productivity",
recipe = "tree-astroponics",
change = 0.1
},
{
type = "change-recipe-productivity",
recipe = "bioslurry-recycling",
change = 0.1
}
},
prerequisites = { "astroponics", "production-science-pack" },
unit = {
count_formula = "L*250",
ingredients = {
{ "wood-science-pack", 1 },
{ "production-science-pack", 1 },
{ "space-science-pack", 1 },
},
time = 60
}
}
})

View file

@ -1,3 +1,2 @@
require("vanilla")
require("Wood-Walls")
require("astroponics")
require("vanilla")
require("Wood-Walls")

View file

@ -71,10 +71,6 @@ 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", { 2, 2 }, 100, 1) or { 0, 0 }
local position = nauvis.find_non_colliding_position("character", { 0, 0 }, 100, 1) or { 0, 0 }
player.teleport(position, storage.target_planet)
chart_starting_area(nauvis, player)
end
@ -57,131 +57,35 @@ local function init_freeplay()
end
local function transit_player(player_index)
local player = game.get_player(player_index)
local transition = storage.transitions[player_index]
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
transition.rocket_entry.cargo_pod.set_passenger(nil)
transition.rocket_entry.cargo_pod.destroy()
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
init_nauvis()
teleport_player(player)
init_freeplay()
-- Give the player the content of the rocket
if transition.rocket_entry.rocket_content then
if rocket_entry.rocket_content then
local inventory = player.get_main_inventory()
for _, item in pairs(transition.rocket_entry.rocket_content) do
for _, item in pairs(rocket_entry.rocket_content) do
inventory.insert(item)
end
inventory.sort_and_merge()
end
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()
table.remove(storage.rocket_silos, rocket_entry_index)
end
return ToNauvis

View file

@ -92,10 +92,8 @@ 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