PlanetsLib


Code, graphics and conventions to help modders creating planets, moons and other systems. This is a community project.

Internal
11 hours ago
2.0
25.9K
Factorio: Space Age Icon Space Age Mod

Changelog

Version: 1.3.7
Date: 2025-05-04
  Changes:
    - Fixed a crash caused presumably by another mod shadowing the 'util' namespace.
Version: 1.3.6
Date: 2025-05-02
  Changes:
    - Fixed a crash in excise_tech_from_tech_tree.
Version: 1.3.5
Date: 2025-05-02
  Changes:
    - Fixed a crash in remove_surface_condition.
Version: 1.3.4
Date: 2025-04-26
  Changes:
    - Fixed API export.
Version: 1.3.3
Date: 2025-04-26
  Changes:
    - New API: remove_surface_condition
Version: 1.3.2
Date: 2025-04-25
  Changes:
    - New API: excise_effect_from_tech_tree
Version: 1.3.1
Date: 2025-04-21
  Changes:
    - Renamed all the 'magic' fields supported on prototypes to start with 'planetslib_' to make them less cryptic. (The previous names are still supported.)
    - Removed unique planet surface conditions from the documentation for now as their error message is suboptimal.
Version: 1.3.0
Date: 2025-04-21
  Changes:
    - Added two new APIs: excise_tech_from_tech_tree and excise_recipe_from_tech_tree.
Version: 1.2.20
Date: 2025-04-15
  Changes:
    - The Cargo drop technology effect icon now matches the icon of the planet.
Version: 1.2.19
Date: 2025-04-14
  Changes:
    - Updated Ukrainian localization.
Version: 1.2.18
Date: 2025-04-10
  Changes:
    - Modified PlanetsLib.borrow_music() to allow the copying of music to/from "space-platform."
Version: 1.2.17
Date: 2025-04-03
  Info:
    - Added Space Age tag.
Version: 1.2.16
Date: 2025-03-18
  Changes:
    - Incompatility mark added for MT-lib.
Version: 1.2.15
Date: 2025-03-16
  Changes:
    - Performance improvement to the cargo pod restriction technology feature.
Version: 1.2.14
Date: 2025-03-16
  Changes:
    - If the 'type = "nothing"' effect is removed from a given cargo drops technology, PlanetsLib will no longer enforce that this technology must be researched to perform cargo drops.
Version: 1.2.13
Date: 2025-03-12
  Changes:
    - Compatibility fix to handle the case where the vanilla lab has duplicate science packs listed in its inputs.
Version: 1.2.12
Date: 2025-03-03
  Graphics:
    - Fixed positioning of corner icons in discovery technologies.
  Locale:
    - Russian locale update.
Version: 1.2.11
Date: 2025-02-26
  Changes:
    - Fixed a crash on missing 'deepcopy' field.
Version: 1.2.9
Date: 2025-02-24
  Changes:
    - Added an icon intended to represent item and recipes used only in ResearchProgressProducts.
Version: 1.2.8
Date: 2025-02-18
  Locale:
    - French localization added.
Version: 1.2.7
Date: 2025-02-18
  Changes:
    - Hidden optional dependency added for Cosmic Social Distancing.
Version: 1.2.6
Date: 2025-02-07
  Changes:
    - No longer write 'Space Locations' in the remote view planet GUI. Space locations isn't technically correct here.
Version: 1.2.5
Date: 2025-02-05
  Changes:
    - Fixed the API technology_icon_constant_planet.
Version: 1.2.4
Date: 2025-02-05
  Changes:
    - New thumbnail.
    - Image size compression.
Version: 1.2.3
Date: 2025-02-04
  Changes:
    - Fixed bug in which promethium science tech required promethium to research it.
Version: 1.2.2
Date: 2025-02-03
  Changes:
    - New API: technology_icon_planet
Version: 1.2.1
Date: 2025-02-03
  Changes:
    - Readme update.
Version: 1.2.0
Date: 2025-02-02
  Changes:
    - Mods are now able to move child locations simply by updating the position of the parent location. In data-final-fixes PlanetsLib now detects whether a location prototype's orbit object no longer matches the prototype's position and orientation fields, and if so, it applies the same positional shift to all that location's orbit children.
Version: 1.1.42
Date: 2025-02-02
  Changes:
    - Moved the nonfunctional orbit-setting code from data-final-fixes to data-updates.
Version: 1.1.41
Date: 2025-01-31
  Changes:
    - Rename give_all_packs_in_vanilla_lab to ensure_all_packs_from_vanilla_lab.
Version: 1.1.40
Date: 2025-01-31
  Changes:
    - New API: give_all_packs_in_vanilla_lab.
Version: 1.1.39
Date: 2025-01-31
  Changes:
    - Improve error message for specifying an orbit with a parent that doesn't exist.
Version: 1.1.38
Date: 2025-01-31
  Changes:
    - New helper: PlanetsLib.technology_icon_constant_planet.
Version: 1.1.37
Date: 2025-01-30
  Changes:
    - Updated the orbit image Python script to better center satellites on their orbit line.
Version: 1.1.36
Date: 2025-01-29
  Changes:
    - New APIs for management of science inputs in labs.
Version: 1.1.35
Date: 2025-01-27
  Changes:
    - borrow_music no longer copies hero tracks unless the `planet` field matches the source planet, matching the same behavior as other tracks.
Version: 1.1.34
Date: 2025-01-25
  Changes:
    - Fixed the size of the sun being slightly increased whilst PlanetsLib is installed.
  Locale:
    - Chinese update.
Version: 1.1.33
Date: 2025-01-24
  Locale:
    - Japanese added.
Version: 1.1.32
Date: 2025-01-23
  Changes:
    - New APIs: restrict_surface_conditions, relax_surface_conditions and restrict_to_planet.
Version: 1.1.31
Date: 2025-01-22
  Changes:
    - (Missing.)
Version: 1.1.30
Date: 2025-01-22
  Bugfixes:
    - Bugfix new API.
Version: 1.1.29
Date: 2025-01-22
  Changes:
    - Properly export new API.
Version: 1.1.28
Date: 2025-01-22
  Modding:
    - Simpler API for cargo drops technologies.
Version: 1.1.27
Date: 2025-01-19
  Changes:
    - Updated the orbit image generation script.
  Locale:
    - Description update.
Version: 1.1.26
Date: 2025-01-15
  Changes:
    - Readded PlanetsLib.borrow_music.
Version: 1.1.25
Date: 2025-01-15
  Changes:
    - Removed PlanetsLib.borrow_music for now until issues can be resolved.
Version: 1.1.24
Date: 2025-01-14
  Locale:
    - Fixed locale key.
Version: 1.1.23
Date: 2025-01-14
  Bugfixes:
    - Fixed crash when a planet has no surface properties.
Version: 1.1.22
Date: 2025-01-14
  Features:
    - PlanetsLib.exact_value(property,value):  Returns a surface condition locking the acceptable range of values to one.
    - PlanetsLib.restrict_to_surface(planet):  Returns a surface condition restricting a prototype to the provided planet.
    - Added hidden surface conditions "planet-str" and "parent-body". Each planet-str is by default based on the planet's internal name, and is expected to be unique. Moons have their parent body value set to their parent body's planet-str.
    - Added functions to set and get planet-str values.
  Info:
    - Added documentation for enabling optional surface conditions, in addition to everything else in this update.
    - Fixed incorrect API documentation for borrow_music and set_default_import_location.
  Locale:
    - Added set of description templates to standardize how the relationships between planets are moons are described.
Version: 1.1.21
Date: 2025-01-13
  Bugfixes:
    - Support for mods that delete all space locations.
Version: 1.1.20
Date: 2025-01-13
  Features:
    - The drawn starmap is now layered by a topological sort on the orbit structure.
    - Support for missing 'orientation' fields when the 'distance' is 0.
Version: 1.1.19
Date: 2025-01-12
  Changes:
    - Update Python script examples
Version: 1.1.18
Date: 2025-01-12
  Features:
    - Python script added to generate orbit images. This is a variation of MeteorSwarm's script.
Version: 1.1.17
Date: 2025-01-12
  Changes:
    - Better error handling for `PlanetsLib:update`.
Version: 1.1.16
Date: 2025-01-12
  Changes:
    - New API PlanetsLib:update to update existing planets or space location prototypes. Passing an `orbit` field will also update the `distance` and `orientation` fields of the prototype.
Version: 1.1.15
Date: 2025-01-12
  Info:
    - Changelog fix.
Version: 1.1.14
Date: 2025-01-12
  Features:
    - Support for all combinations of `starmap_icon`, `starmap_icons` and `sprite_only`. Previously, if `sprite_only` was true, `starmap_icons` was never read and it was impossible to hide the sprite by setting both to nil.
Version: 1.1.13
Date: 2025-01-10
  Graphics:
    - Reinstated orbit images files in case people find them helpful.
    - Compressed the image files.
Version: 1.1.12
Date: 2025-01-03
  Locale:
    - Czech localization added.
Version: 1.1.11
Date: 2025-01-03
  Changes:
    - Switched API from PlanetsLib:planet_extend to PlanetsLib:extend.
Version: 1.1.10
Date: 2025-01-02
  Locale:
    - Adds translation into Russian.
Version: 1.1.9
Date: 2025-01-02
  Changes:
    - Compatibility with mods that update the positions of planets of other mods.
Version: 1.1.8
Date: 2025-01-02
  Locale:
    - Added Chinese localization.
  Bugfixes:
    - Fixed solar system edge not having an orbit sprite.
Version: 1.1.7
Date: 2025-01-02
  Bugfixes:
    - Fixed crash for planets without surface properties.
Version: 1.1.6
Date: 2025-01-02
  Changes:
    - Surface conditions for gas composition.
    - New surface conditions are now off by default, unless requested by a mod.
Version: 1.1.5
Date: 2025-01-02
  Bugfixes:
    - Bail when updating the starmap for a planet without an 'orbit' field.
Version: 1.1.4
Date: 2025-01-02
  Bugfixes:
    - Fixed crash when space locations are added later than data.lua.
Version: 1.1.3
Date: 2025-01-02
  Changes:
    - Compatibility with mods that set the 'orbit' field of planets and space locations to other objects.
Version: 1.1.2
Date: 2025-01-01
  Changes:
    - is_space_location check enforced in planet_extend.
    - Readme note added about breaking changes will bump the major version. Special thanks added to MidnightTigger.
Version: 1.1.1
Date: 2025-01-01
  Info:
    - Readme fixes.
Version: 1.1.0
Date: 2025-01-01
  Changes:
    - API for planets switched from 'planet_type' to 'sprite_only'. This is now simply a boolean that determines whether the prototype should be removed in data-final-fixes and replaced by a sprite on the starmap. With this change, PlanetsLib now supports extra solar systems, binary systems, etc.
    - Form of 'parent' within 'orbit' changed to an object with 'type' and 'name' fields, rather than just a name.
    - Core locale overrides changes to use 'space location' terminology instead of planets and moons.
Version: 1.0.8
Date: 2025-01-01
  Bugfixes:
    - Fixed items in cargo pod drops being allowed if they were not associated to an entity in Factorio.
Version: 1.0.7
Date: 2024-12-31
  Info:
    - README.md update
Version: 1.0.6
Date: 2024-12-31
  Info:
    - README.md update
Version: 1.0.5
Date: 2024-12-31
  Changes:
    - Extract the unified API into 'api.lua' for clarity.
  Info:
    - Syncing of README.md to the mod portal.
Version: 1.0.4
Date: 2024-12-30
  Changes:
    - Organized exports into a single API file for readability.
Version: 1.0.3
Date: 2024-12-30
  Modding:
    - Compatibility with Organized Solar System.
Version: 1.0.2
Date: 2024-12-30
  Bugfixes:
    - Fixed a crash.
Version: 1.0.1
Date: 2024-12-30
  Modding:
    - Dependencies updated.
Version: 1.0.0
Date: 2024-12-30
  Modding:
    - APIs: PlanetsLib:planet_extend, PlanetsLib.technology_icons_moon, PlanetsLib.cargo_drops_tech_effect, PlanetsLib.technology_icons_planet_cargo_drops
    - When a technology with name '[planet_name]-cargo-drops' is created, cargo drops to that planet (excepting those with only players or construction robots) will be prevented until that technology is researched.