PlanetsLib: Additional Orbit Graphics

by Kryzeth

Adds several new orbit graphics to smooth out the gaps in between the graphics included by default within PlanetsLib.

Internal
3 days ago
2.1
12
Planets
Owner:
Kryzeth
Source:
N/A
Homepage:
N/A
License:
MIT
Created:
5 days ago
Latest Version:
1.0.1 (3 days ago)
Factorio version:
2.1
Downloaded by:
12 users


Proud member of the Foundry Discord, for (almost) all your planetary discussion needs


Features

Extension mod for PlanetsLib, defining 5 additional orbit graphics to smooth out the gaps between 1.8, 2.65, and 3.95, by adding 2.05, 2.35, 2.95, 3.25, and 3.55 orbit graphics. This allows for more precisely defined orbit graphics, and reduces the amount of image stretching required for values in between the default distance values.

How to Use

Most of this information can be found in the PlanetsLib documentation, but to re-iterate the important points; this functionality is intended for defining the orbits of moons around other planets.

  1. Add an optional or required dependency to PlanetsLib (hidden or otherwise), to ensure that its functionality is loaded before attempting to use.
  2. During data or data-updates (whenever the data for the moon is defined/updated), either use PlanetsLib:extend or PlanetsLib:update to define the orbit, with the parent, distance, and orientation values defined as usual.
  3. For the sprite, use PlanetsLib.get_orbit_sprite(radius) instead of manually defining the orbit graphics.

Example

The Secretas orbit patch is defined similarly to the below example. Frozeta is the name of the moon, while Secretas is the parent planet that it revolves around.

PlanetsLib:update({
    {
        type = "planet",
        name = "frozeta",
        subgroup = "satellites",    -- put it in the appropriate subgroup for the Factoriopedia
        draw_orbit = false, -- prevent the game from drawing vanilla orbit around the sun
        orbit = {
            parent = {  -- define the parent planet
                type = "planet",
                name ="secretas"
            },
            distance = 3.95,    -- how far away the moon is from the parent planet
            orientation = 0.45,
            sprite = PlanetsLib.get_orbit_sprite(3.95)  -- draw the moon orbit at the same distance
        }
    }
})

Final Notes

The full list of precisely defined distance values with matching orbit graphics becomes:

  • 1.39
  • 1.5
  • 1.8
  • 2.05
  • 2.35
  • 2.65
  • 2.95
  • 3.25
  • 3.55
  • 3.95