Make Map Editor “Interaction” Behaviors Scriptable in the Lua API (for creative play, QoL, servers, and mods)

Things that we aren't going to implement
User avatar
louanbastos
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Dec 24, 2024 9:31 pm
Contact:

Make Map Editor “Interaction” Behaviors Scriptable in the Lua API (for creative play, QoL, servers, and mods)

Post by louanbastos »

TL;DR
Expose the Map Editor > Interaction behaviors as scriptable, per-player/force/surface flags in the public Lua API. This isn’t only for testing—it enables creative/sandbox play, accessibility/QoL features, server tools and new mod ideas.
Give the map editor abilities without being in it.

What?
Add a small, stable API that mirrors the Editor’s Interaction checkboxes and lets scripts toggle them with clear scope and lifetime:
• Per player / per force / per surface, with optional time-limited activation.
• Read/write access (e.g., player.editor_flags or player:set_editor_flags{...}).
• Optional events for auditing and compatibility (e.g., on_editor_flag_changed).
• Persistence options (session-only vs. saved), plus admin/cheat permissions for safety.

Flags to expose (matching the Editor):
• Instant blueprint building — place entities from blueprints immediately (no ghosts, no cost).
• Instant deconstruction — marked entities are removed instantly (no logistics).
• Instant upgrading — upgrade planner actions apply instantly.
• Instant rail planner — rail paths materialize immediately when planned.
• Fill electric buffers when building entities — new electric entities spawn fully charged.
• Placed corpses never expire — corpses created while active do not age out.
• Ignore tile conditions — bypass ground/tile restrictions when placing entities/tiles.
• Move player to editor location on exit — return player to editor “exit” position when leaving a temporary edit phase.

Image

Why?
• Creative & personal play: frictionless sandboxing, megabase sketching and quick rebuilds.
• Quality of life & accessibility: reduce repetitive actions, enable gentler rules for newcomers or assistive play.
• Server administration: controlled “creative bursts” for admins or events, with auditable toggles and clear scopes.
• Mod interoperability: a common, documented way to do what many “creative” mods simulate today—fewer hacks, fewer conflicts.
• Education & content creation: faster tutorials, classrooms, streams, and reproducible demonstrations.
• Scenario/map variety: new rule sets (puzzle maps, limited-time build phases, event minigames) without forcing Editor mode.
• Determinism & stability: standard events and scopes preserve multiplayer determinism while expanding possibilities.
Last edited by louanbastos on Wed Aug 27, 2025 11:54 am, edited 1 time in total.
Bilka
Factorio Staff
Factorio Staff
Posts: 3582
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Make Map Editor “Interaction” Behaviors Scriptable in the Lua API (for creative play, QoL, servers, and mods)

Post by Bilka »

[Moved to Modding interface requests]

I'm a bit confused what you're requesting here. Do you want to be able to change the interaction settings of a player who is in the map editor? Or do you want to give players "map editor abilities" while they're not in the map editor?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
User avatar
louanbastos
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Dec 24, 2024 9:31 pm
Contact:

Re: Make Map Editor “Interaction” Behaviors Scriptable in the Lua API (for creative play, QoL, servers, and mods)

Post by louanbastos »

My sincere apologies, I wish that, as per the image,
Image
So that we could have some editor mode abilities without being in it.

I'll use an example because I think it'll be easier to explain.

If I wanted to create a simple mod to instantly build any blueprint, instantly deconstruct it, or instantly upgrade a blueprint,
Bilka
Factorio Staff
Factorio Staff
Posts: 3582
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Make Map Editor “Interaction” Behaviors Scriptable in the Lua API (for creative play, QoL, servers, and mods)

Post by Bilka »

It's already possible to replicate most of these editor functions by listening to the building/deconstruction/etc events and reviving/destroying/etc the entities, so I think we're unlikely to add extra API functions that do the same thing.

For example, I made a simple mod for instant blueprinting and deconstruction a while ago: https://mods.factorio.com/mod/Simple_creative_mode
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
User avatar
louanbastos
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Dec 24, 2024 9:31 pm
Contact:

Re: Make Map Editor “Interaction” Behaviors Scriptable in the Lua API (for creative play, QoL, servers, and mods)

Post by louanbastos »

Bilka wrote: Wed Aug 27, 2025 12:10 pm It's already possible to replicate most of these editor functions by listening to the building/deconstruction/etc events and reviving/destroying/etc the entities, so I think we're unlikely to add extra API functions that do the same thing.

For example, I made a simple mod for instant blueprinting and deconstruction a while ago: https://mods.factorio.com/mod/Simple_creative_mode
In this case, I would really like to just make this work, that is, to bring all these functionalities, as shown in the image, so using your mod is it possible to do this?

Because I would really like to have this functionality outside of editor mode.

Instant blueprint building
Instant deconstruction
Instant upgrading
Instant rail planner
Fill electric buffers when building entities
Ignore tile conditions


I wish it was in the API or where to find it in the API 😅
User avatar
louanbastos
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Dec 24, 2024 9:31 pm
Contact:

Re: Make Map Editor “Interaction” Behaviors Scriptable in the Lua API (for creative play, QoL, servers, and mods)

Post by louanbastos »

Bilka wrote: Wed Aug 27, 2025 12:10 pm It's already possible to replicate most of these editor functions by listening to the building/deconstruction/etc events and reviving/destroying/etc the entities, so I think we're unlikely to add extra API functions that do the same thing.

For example, I made a simple mod for instant blueprinting and deconstruction a while ago: https://mods.factorio.com/mod/Simple_creative_mode

If it's not too much trouble, could you send me the code for these features:

Instant blueprint building
Instant upgrading
Instant rail planner

I managed to do the "Instant deconstruction" feature, but I can't seem to get the others working.
curiosity
Filter Inserter
Filter Inserter
Posts: 685
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Make Map Editor “Interaction” Behaviors Scriptable in the Lua API (for creative play, QoL, servers, and mods)

Post by curiosity »

I thought that editor stuff was already done via script. Seems more robust design than hardcoding.
User avatar
louanbastos
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Dec 24, 2024 9:31 pm
Contact:

Re: Make Map Editor “Interaction” Behaviors Scriptable in the Lua API (for creative play, QoL, servers, and mods)

Post by louanbastos »

curiosity wrote: Wed Aug 27, 2025 4:42 pm I thought that editor stuff was already done via script. Seems more robust design than hardcoding.
Can you show me?
Bilka
Factorio Staff
Factorio Staff
Posts: 3582
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Make Map Editor “Interaction” Behaviors Scriptable in the Lua API (for creative play, QoL, servers, and mods)

Post by Bilka »

louanbastos wrote: Wed Aug 27, 2025 2:57 pm If it's not too much trouble, could you send me the code for these features:

Instant blueprint building
Instant upgrading
Instant rail planner

I managed to do the "Instant deconstruction" feature, but I can't seem to get the others working.
Mod is attached, have fun.
Attachments
Foo_1.0.0.zip
(724 Bytes) Downloaded 15 times
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
User avatar
louanbastos
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Dec 24, 2024 9:31 pm
Contact:

Re: Make Map Editor “Interaction” Behaviors Scriptable in the Lua API (for creative play, QoL, servers, and mods)

Post by louanbastos »

Bilka wrote: Wed Aug 27, 2025 4:58 pm
louanbastos wrote: Wed Aug 27, 2025 2:57 pm If it's not too much trouble, could you send me the code for these features:

Instant blueprint building
Instant upgrading
Instant rail planner

I managed to do the "Instant deconstruction" feature, but I can't seem to get the others working.
Mod is attached, have fun.

It was perfect, but I found a small error, when upgrading, the following error occurs:

Code: Select all

The mod Foo (1.0.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event Foo::on_marked_for_upgrade (ID 133)
LuaEntity doesn't contain key apply_upgrade.
stack traceback:
	[C]: in function '__index'
	__Foo__/control.lua:10: in function <__Foo__/control.lua:9>
Bilka
Factorio Staff
Factorio Staff
Posts: 3582
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Make Map Editor “Interaction” Behaviors Scriptable in the Lua API (for creative play, QoL, servers, and mods)

Post by Bilka »

Update your game to the latest experimental version.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
User avatar
louanbastos
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Dec 24, 2024 9:31 pm
Contact:

Re: Make Map Editor “Interaction” Behaviors Scriptable in the Lua API (for creative play, QoL, servers, and mods)

Post by louanbastos »

Bilka wrote: Wed Aug 27, 2025 5:30 pm Update your game to the latest experimental version.
Oh, ok, thank you. Ill wait the stable version then, but thank you dear.
Post Reply

Return to “Won't implement”