Any Planet Start


Start on any of the first three planets: Vulcanus, Gleba, or Fulgora. Choose your planet in the startup mod settings before starting a new game. Compatible with many modded planets!

Content
5 days ago
2.0
29.1K
Planets Environment

b ✅ Other mods can't disable the crash site

16 days ago

I'm trying to add Any Planet Start compatibility to my mod (https://mods.factorio.com/mod/SimpleSeablock) and I've found that even though I use remote.call("freeplay", "set_disable_crashsite", true) in my mod's on_init script, the crash site is still added when Any Planet Start is installed. Same with the intro cutscene not being skipped.

Taking a look at control.lua, I can see APS does try to honor any other mod that has disabled the crash site by reading get_disable_crashsite, but I think what happens is because APS copies the result of get_disable_crashsite into its storage object during on_init, then reads from storage during the player created event when it creates the custom crash site, this means that any mod that gets initialized after APS will never have a chance to disable the crash site and intro as it will be too late. APS has already read the global value and is now using its own copy. And any mod that takes a dependency on APS (optional or otherwise) will always be initialized after. Without a dependency, it's up to whatever order Factorio decides to load them.

Ultimately it's not the end of the world if there's a crashed ship out in the middle of the water, but it would be nice to be able to disable it. And I might be able to hook into the aps-post-init event, remove the crash site debris and explosions, and cancel the cutscene, but I thought I'd first reach out and see if you had thoughts on a more "natural" way to accomplish this.

13 days ago

Update: trying to hook into aps-post-init but it doesn't seem to be firing.

Again looking at control.lua, it looks as though if the crash site is enabled (which it always will be unless another mod manages to run on_init before APS) then the on_player_created will return before raising the aps-post-init event, and that looks to be the only place the event is raised.

9 days ago

Hey, sorry it took me a bit to get to this.

Looking back at this code, I think it may be unnecessary for me to disable the crash site from the freeplay scenario, considering the surface gets cleared immediately afterward anyway, and then I can just read from the remote interface when it needs to be used rather than in on_init. I'm going to mess with it and see if it makes a difference, and if not then I think that's a good solution all around.

I was also thinking of making a duplicate remote interface for the things like disabling the crash site in APS itself, that way mods could control it after I've read them from freeplay, but that puts more work on the modders to accommodate two interfaces rather than one. It would still be a usable solution, but I wanted to avoid it if I could.

9 days ago

Thanks for the response. I agree that option #1 sounds like a good one if it works. If it doesn't, I'm open to making a call to a new APS-specific remote interface to disable it.

Currently, I'm cleaning up the crash site and cancelling the cinematic in on_player_created if APS is installed, which works well enough. But let me know if you get either of your options working and I can remove all that cleanup code.

5 days ago

After fiddling around with it, I couldn't get option #1 to work, so I had to settle for the remote interface functions instead.
Oh well, but at least you can remove all of the cleanup code as of APS version 1.1.28.

5 days ago

Gave it a try, seems straightforward enough and works. Thanks.

5 days ago

No problem, sorry for the delays.

New response