How to get planet magnitude in Control stage

Place to get help with not working mods / modding interface.
TheEckelmonster
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri Mar 21, 2025 10:33 am
Contact:

How to get planet magnitude in Control stage

Post by TheEckelmonster »

Hello!

While working on my mod "All Seeing Satellite" I found that there is a property, magnitude, associated with each planet. With this, I wanted to use this value in my calculation for how many satellites need to be launched for a particular planet.

However, it seems that the "magnitude" property for I believe, type="planet" prototypes, appears to only be accessible during the Data stage. Unfortunately, I want/need that value at the Control stage.

Long story short, I found what feels like a hacky way of doing it, but was wondering if there was a proper way of getting a planet's magnitude during the Control stage.

Effectively, during the data stage, I am looping through data.raw.planet; for each planet I am creating a clone of the constant combinator prototype, and renaming it; in renaming it, I am converting to string and packing the magnitude; the magnitude is then extracted from its name in the Control stage.
Post Reply

Return to “Modding help”