I'm working on a mod that automatically replaces a certain ghost (specifically, landfill) with another when the ghost is placed. However I've noticed that when positioning large blueprints, a large amount of lag is incurred as, apparently, the on_built_entity event is called each frame (???).
Even if I check is_valid as the first statement of my event (which does filter them out), it still creates a big slowdown from the sheer number of lua function calls.
So, I'd like to request a way to filter out these "false" ghosts on the C++ side. A filter such as "is-valid" or "attached-to-cursor" or some such.
Thanks for the consideration.
is_valid or is_blueprint filter for on_built_entity
-
foxoftheasterisk
- Inserter

- Posts: 20
- Joined: Sat Nov 04, 2023 12:48 am
- Contact:
Re: is_valid or is_blueprint filter for on_built_entity
I think there’s some kind of confusion here: events don’t fire with invalid contents so if you get an event the value given is valid.
Holding blueprints does not send any event in itself, only once it’s built does it send an event.
You say there’s some lag, but without an example showing the issue anyone trying to help would just be guessing.
Holding blueprints does not send any event in itself, only once it’s built does it send an event.
You say there’s some lag, but without an example showing the issue anyone trying to help would just be guessing.
If you want to get ahold of me I'm almost always on Discord.
-
foxoftheasterisk
- Inserter

- Posts: 20
- Joined: Sat Nov 04, 2023 12:48 am
- Contact:
Re: is_valid or is_blueprint filter for on_built_entity
...
I could swear it was live-replacing them before...
Well, it seems like the lag is unrelated to my mod, and I just didn't test sufficiently. So I guess there's no problem (with my mod, anyway). Sorry for the trouble.
I could swear it was live-replacing them before...
Well, it seems like the lag is unrelated to my mod, and I just didn't test sufficiently. So I guess there's no problem (with my mod, anyway). Sorry for the trouble.
