API for flexible planets and surfaces manipulation

Place to post guides, observations, things related to modding that are not mods themselves.
iassasin
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Dec 29, 2023 1:54 pm
Contact:

API for flexible planets and surfaces manipulation

Post by iassasin »

Hi! Asked for a questions about new 2.0 engine in discord channel and have a hint to go forums.
For space age was added ability to customize music for different planets. Looks like the right way is create planet prototype, music prototypes with refs to planet and then game.planets.myplanet.create_surface() to get custom music working.

But there is several cons:
1. Planets is not planet types. It's exactly planets. 1 proto = 1 surface, associated with it.
2. Surfaces created old way (game.create_surface) does not have ambient music at all! (see warp drive machine mod)
3. There is no way you can dynamically add planet prototypes. At least I can't find it in the docs.

The questions:
1. How to setup different music sets for custom sufraces, not associated with planets?
2. Is it possible to dynamically create planet prototypes for customizing it's environment properties in runtime, not at startup stage?
3. Is it possible to have multiple surfaces for one planet prototype somehow (to share props and music)? For example, it will be usable in space exploration where we can have multiple planets of same type.

Looks like there is no technical possibility in engine to solve this tasks right now. Does engine have some restrictions? Which API will be realistic to implement in engine to solve this tasks?
Post Reply

Return to “Modding discussion”