item_index doesn't seem to fully work for surface.create_entity
item_index doesn't seem to fully work for surface.create_entity
I'm the author of Auto Lamp and I'm trying to get Factorio to place lamps into the same undo action across multiple ticks. Specifically, my mod creates 0~1 lamps every tick in a selected area and I want to be able to undo an entire selection at once. The issue is that while setting "item_index = 1" works for undo actions within a single tick, it doesn't seem to work at all for undo actions from previous ticks. I've made a demo branch on my repo to show this. Just use the tool to select multiple power poles and each power pole will gain 2 lamps which will undo together, but each pole's will undo in sequence. (Poles must not have existing lamp coverage.) I mostly want an answer about whether this is actually a bug, I imagine this code isn't used often so it could slip through, or that I'm just using it wrong. Thanks
Re: item_index doesn't seem to fully work for surface.create_entity
It looks like the lua docs were done incorrectly. It's actually "undo_index". I've fixed them for the next release.
If you want to get ahold of me I'm almost always on Discord.
Re: item_index doesn't seem to fully work for surface.create_entity
Just adding that I didn't notice because it IS item_index with entity.order_deconstruction
Re: item_index doesn't seem to fully work for surface.create_entity
That's also wrong lua-doc wise, and is also undo_index. I've also fixed that one for the next release.
If you want to get ahold of me I'm almost always on Discord.
Re: item_index doesn't seem to fully work for surface.create_entity
Weird, that one did work.