More event data for script_raised_set_tiles?

Things that we aren't going to implement
Post Reply
Pi-C
Smart Inserter
Smart Inserter
Posts: 1645
Joined: Sun Oct 14, 2018 8:13 am
Contact:

More event data for script_raised_set_tiles?

Post by Pi-C »

TL:DR
I want to request that script_raised_set_tiles will give some more information than just surface_index, tile.name, and tile.position. I'm specifically interested in for whom a tile has been placed. Getting force_index would be sufficient for my current use case, getting player_index (optionally) would be even better.
Why?
Bio Industries provides "Musk floor". It will allow you faster movement like any other flooring, but it will also provide electricity from solar panels. So, if a Musk floor tile is placed, I act on the event by placing hidden entities on top of it. This does work now, after I've become aware of the long-forgotten script-raised-set-tiles event. :oops:

However, we also have a startup setting to toggle the electric grid overlay for Musk floor in map view. If the grid overlay should be shown, the hidden poles will be set for the force of the player who placed the tile; if it should be hidden, the hidden poles will get a force of their own. This works for all tile-building events -- except for script-raised-set-tiles. As a result, if players use Klonan's "Construction Drones" (similar mods as well, but the bug report I received was about that mod) to place the tiles, the hidden poles will always be set to their very special default force, and the grid overlay for these Musk floor tiles won't ever be turned on.

I guess I could offer a remote interface that other mods could call if they've placed a tile. However, having the info directly in the event would be so much easier for everybody. It would be really great if this could be implemented! ;)
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2241
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: More event data for script_raised_set_tiles?

Post by boskid »

Bad thing:
It wont happen. Reason is simple: this event can be raised by the LuaSurface::set_tiles with raise_event=true and at this context there are no extra details like player or force which should be attributed for this operation. It is the script doing changes, not the player.

Good thing:
If you are raising the event using script.raise_script_set_tiles inside of the table next to the mandatory fields you may pass additional fields that will be delivered to the event receiver.

Pi-C
Smart Inserter
Smart Inserter
Posts: 1645
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: More event data for script_raised_set_tiles?

Post by Pi-C »

boskid wrote:
Fri Oct 16, 2020 10:45 am
Bad thing:
It wont happen. Reason is simple: this event can be raised by the LuaSurface::set_tiles with raise_event=true and at this context there are no extra details like player or force which should be attributed for this operation. It is the script doing changes, not the player.
Oh, that's too bad …
Good thing:
If you are raising the event using script.raise_script_set_tiles inside of the table next to the mandatory fields you may pass additional fields that will be delivered to the event receiver.
Bad thing: It's not I who's raising the event, so I don't have any influence on what info is passed on.

Good thing: I can use that info to ask Klonan if he'd pass on the data I need in his mod. :-)

Thanks for your help!
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Post Reply

Return to “Won't implement”