Search found 58 matches: undo

Searched query: +undo

by PennyJim
Tue Oct 14, 2025 10:57 pm
Forum: Modding interface requests
Topic: [Suggestion] Changes to auto recycle
Replies: 5
Views: 494

Re: [Suggestion] Changes to auto recycle

... using specific recipe category) is done in lua.


While it is in Lua, it's not as if you can just change the code from another mod.
You can undo said changes, but we want to change how it does it in the first place so we don't have to

Also, I'm not sure there's anything specific about that ...
by sparr
Tue Jun 10, 2025 5:39 am
Forum: Modding interface requests
Topic: Alternative to build_from_cursor with same non-cursor-related features
Replies: 8
Views: 1243

Alternative to build_from_cursor with same non-cursor-related features

... features and behaviors as build_from_cursor, such as build modes, fast replacing, placing necessary foundation and tile ghosts, adding to the undo stack, setting the last user, etc. I don't want to use build_from_cursor due to https://forums.factorio.com/viewtopic.php?t=129192 as well as the ...
by aaron311
Wed Apr 02, 2025 12:06 am
Forum: Modding interface requests
Topic: Mod-associated permanent-state "garbage collection" via some means (not sure what would make sense, though)
Replies: 9
Views: 1334

Mod-associated permanent-state "garbage collection" via some means (not sure what would make sense, though)

... of course had a bunch of force creation/merging logic in its code. The code had various paths to support "resetting" or "uninstalling" which would undo any duplicated forces and merge them back to how things originally were, but of course, this code had to actually be loaded to run. In such a case ...
by protocol_1903
Tue Feb 18, 2025 5:35 pm
Forum: Modding interface requests
Topic: Update UndoRedoStack before calling events
Replies: 0
Views: 230

Update UndoRedoStack before calling events

I've been working with the UndoRedoStack for a few weeks now and it has a couple of glaring issues that are stopping me from doing much with it.

First is that it updates the stack after calling events (at least the ones I have tried, I don't know if it's true for every event). This prevents me from ...
by hgschmie
Sun Feb 02, 2025 1:15 am
Forum: Implemented mod requests
Topic: Some UndoRedoAction types lack surface_index
Replies: 2
Views: 414

Some UndoRedoAction types lack surface_index

[Not sure if this is a modding request or a bug report]

There are ten different UndoRedoAction types. Only three (removed-entity, built-tile and removed-tile) pass in the surface_index.

Trying to implement undo/redo for custom entities that retain state brings me to "keep a set of tombstones for ...
by binaryDiv
Mon Jan 27, 2025 1:29 pm
Forum: Modding interface requests
Topic: Event on_entity_logistic_slot_changed not always triggered
Replies: 3
Views: 654

Event on_entity_logistic_slot_changed not always triggered

... apart from the position the player clicked at (which might not even correspond to the chest if the blueprint contains more entities).

3. Undo/redo of a "copy-entity-settings" action. The event data here is a bit more helpful, it contains the entity prototype and the entity position ...
by curiosity
Fri Jan 10, 2025 4:07 pm
Forum: Modding interface requests
Topic: Allow setting friction_modifier on rolling stock on control stage, not just cars.
Replies: 8
Views: 1561

Re: Allow setting friction_modifier on rolling stock on control stage, not just cars.


That friction approach would allow me to set it when they change state (and checking every few ticks until they're at max speed to undo it), rather than requiring on_tick all the time to constantly look at all trains.

You assume it will reach maximum speed.

*And* it would mean everything about ...
by JamesFire
Fri Jan 10, 2025 11:37 am
Forum: Modding interface requests
Topic: Allow setting friction_modifier on rolling stock on control stage, not just cars.
Replies: 8
Views: 1561

Re: Allow setting friction_modifier on rolling stock on control stage, not just cars.

... look weird


That friction approach would allow me to set it when they change state (and checking every few ticks until they're at max speed to undo it), rather than requiring on_tick all the time to constantly look at all trains.

*And* it would mean everything about the train speed is handled ...
by Atria
Wed Jan 01, 2025 8:59 am
Forum: Modding interface requests
Topic: Lua undo/redo actions
Replies: 0
Views: 297

Lua undo/redo actions

Add support for new type of UndoRedoAction : "lua". New API function would have be created which would allow mods to register undoable actions which don't fit rest of undo/redo system.

So when mod wants to do something which currently isn't supported by undo/redo system the mod would call "player ...
by jagoly
Mon Dec 23, 2024 12:25 pm
Forum: Modding interface requests
Topic: Allow merging undo/redo actions within create/destroy event handlers
Replies: 0
Views: 311

Allow merging undo/redo actions within create/destroy event handlers

... LuaSurface.create_entity or LuaEntity.destroy, we are able to pass the arguments player and optionally item_index to have the actions added to the undo/redo stack. However, in the common case where these methods are being called within the various on_built or on_mined event handlers, these actions ...
by azaghal
Thu Oct 31, 2024 1:42 pm
Forum: Won't implement
Topic: Entity filter for player.disable_alert()?
Replies: 3
Views: 995

Re: Entity filter for player.disable_alert()?

... runtime to ignore specific ghosts for bot-based construction. This would quite probably also trivialise the construction approval type of mod - the only thing that would be "missing" at that point would be ability to undo/redo the approval action, but we could live with that.

Best regards,
Branko
by robot256
Fri Oct 18, 2024 8:59 pm
Forum: Modding interface requests
Topic: [2.0.6] Add argument to LuaControl::mine_entity for undo item_index
Replies: 0
Views: 226

[2.0.6] Add argument to LuaControl::mine_entity for undo item_index

... methods, such as LuaEntity::order_deconstruction(), take "player" and "item_index" as arguments so that the action can be added or merged onto the undo-redo stack of the player. LuaControl::mine_entity() know what player is doing the action (the owner object) but does not take item_index as a ...
by curiosity
Sun Aug 04, 2024 9:31 pm
Forum: Modding interface requests
Topic: Metadata on Entities
Replies: 7
Views: 1716

Re: Metadata on Entities

... previous post was closed as "Won't Implement" but it looks like that thread doesn't address the gaps mentioned here around blueprint pasting and undo.

https://forums.factorio.com/viewtopic.php?f=28&t=106026 https://forums.factorio.com/viewtopic.php?f=28&t=103934
You even +1'd to the second one ...
by y_e_a_r
Sun Aug 04, 2024 8:46 pm
Forum: Modding interface requests
Topic: Metadata on Entities
Replies: 7
Views: 1716

Re: Metadata on Entities

... previous post was closed as "Won't Implement" but it looks like that thread doesn't address the gaps mentioned here around blueprint pasting and undo.

I totally understand the concerns around memory sizes and separating "core" data from "lua" data but I can't help but think there are ways to ...
by y_e_a_r
Sun Aug 04, 2024 4:39 pm
Forum: Modding interface requests
Topic: Metadata on Entities
Replies: 7
Views: 1716

Metadata on Entities

... works for copy/paste, it:
- Requires a lot of boilerplate code
- Doesn't work when pasting blueprints over existing entities
- Doesn't work with undo

I've been blown away by the high quality of modding docs and the lua APIs so this current workaround feels uncharacteristically difficult to ...
by BlackOverlord
Thu Dec 28, 2023 8:23 pm
Forum: Modding interface requests
Topic: Allow mod to track entities across undo
Replies: 2
Views: 1220

Re: Allow mod to track entities across undo

+1

I think a pretty easy solution could be to set ghost_unit_number to the unit_number of the removed entity which is being undone by the ghost. The same way it works with ghosts placed after killing an entity.
by GlassBricks
Fri Apr 28, 2023 6:45 pm
Forum: Modding interface requests
Topic: Allow mod to track entities across undo
Replies: 2
Views: 1220

Re: Allow mod to track entities across undo

Another potential way to do this is to add a "old unit_number" field to events when undo is done. This means more work for the mod, but at least the mod can detect the undo and what entity it used to correspond to.
by GlassBricks
Wed Apr 26, 2023 5:36 pm
Forum: Modding interface requests
Topic: Allow mod to track entities across undo
Replies: 2
Views: 1220

Allow mod to track entities across undo

... ways that this could be done:
- Provide another "unit_number" thing, such as, "id_number", that stays the same for an entity when it is deleted/undo, died/revived, etc..
- Better, the dream would to let entities to have "custom_tags" that lives and dies with the entity, like the "tags" for ...
by Optera
Fri Nov 25, 2022 7:32 am
Forum: Modding interface requests
Topic: Allow mods BP orders to be undo-able!
Replies: 5
Views: 4713

Re: Allow mods BP orders to be undo-able!

+1 (yearly bump)

Would be nice to have undo work with script controlled entities and their circuit connections.
by guardog
Thu Nov 17, 2022 7:52 pm
Forum: Modding interface requests
Topic: order_deconstruction and order_upgrade do not create undo orders
Replies: 2
Views: 2094

Re: order_deconstruction and order_upgrade do not create undo orders

I would like to bump this request as I am encountering this limitation in my mod as well. Hope to spark more discussion on how to best integrate Undo function into our mods.

Similar threads
https://forums.factorio.com/viewtopic.php?f=28&t=70393
Allow mods BP orders to be undo-able!

https://forums ...

Go to advanced search