Construction Approvals

by azaghal

Ghosts require player's approval before construction bots are dispatched. This gives the player improved control over what parts of the factory get built, and when.

Utilities
10 months ago
1.1 - 2.0
3.94K
Logistic network Blueprints

b [FIXED/IMPLEMENTED] Ghosts created by mods like P.U.M.P. skip the approval process

3 years ago

I used P.U.M.P. to create oil pumps and the ghosts were created, but they were immediately built without any approval process.

3 years ago
(updated 3 years ago)

As of today, version 1.1.5 of P.U.M.P. raises an event when it places ghosts. It seems construction planner is not listening to that event.
https://lua-api.factorio.com/latest/events.html#script_raised_built

3 years ago

Hm... I will try to look into this issue, but the solution could end-up being a bit more complicated than just processing the listed event, since most of the mod logic was written with the assumption that it is the player who places the ghost - and Construction Planner certainly abuses the modding API in some rather unconventional ways :)

1 year, 7 months ago

I have started looking into this once again, and maybe it will not be much of an issue after all. I am in fact not sure why I thought it would be previously - maybe I simply didn't look closely enough into it. I think it was related to handling of undo logic, but then again there is normally no undo possibility for script-created entities anyway, so who knows...

As a quick hack, just pulling out the existing event handler to be applied against script_raised_built seems to work fine, with small caveat that I need to figure out what player invoked the action (since auto-approval setting is per-player). With P.U.M.P. it looks to be a non-issue - I seem to be able to rely on the last_user property of an entity.

But I'll need to figure out what kind of logic to use for picking the player for ghost entities where last_user is not set. Maybe the safest bet there would be to simply auto-approve.

10 months ago

Two years later, but... I finally got around to cover this particular scenario. So, P.U.M.P.-built ghosts will now finally get properly marked as approved/unapproved when the player uses the tool.

I have some concerns on some warning spam happening with mods that do not set the last_user on the built entities, but I'll try to tackle it when and if people start to complain about it.

Thank you once again for raising the issue - just in case you are still playing and keeping track of these pages. :)

Best regards,
Branko

10 months ago
(updated 10 months ago)

Edit: Nevermind, I wasnt paying attention, and I thought this notification was on a P.U.M.P. thread.

Original message:

Does that warning apply to P.U.M.P., too?
The way you phrased it .. I guess .. not? But I'm not entirely sure xD

Looking to the code that places ghost, I seem to already supply the player as a parameter to create_entity(). Which according to the docs should set last_user. So P.U.M.P. is good in this regard, I hope?

10 months ago

Ah, yeah, probably should have made it clear - that was more of a just-in-case addition to the code from my side - your mod is setting that one up so no issues there :)

Best regards,
Branko

New response