Creating a Script in God Mode that enables faster map scrolling/moving

Place to get help with not working mods / modding interface.
Grim82
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Apr 30, 2025 12:30 pm
Contact:

Creating a Script in God Mode that enables faster map scrolling/moving

Post by Grim82 »

Hello Factorio community,

i have a slight problem with writing a script, well actually ChatGPT does.

The scenario:

I usually prefer to play Factorio in God Mode.

The command is as we know:

/c game.player.character.destroy()


Which means player avatar is deactivated but only hidden with no collision and so on, so i want to have more the Anno 1800 feeling.
So far so good.
This mode however lacks speed in my opinion. Using input keys: "A, W, S, D“ could move the screen faster (or in that case move the invisible character faster)

First working version (FastCamScroll_workingversion) is in the attachment. You trigger it by using Shift + any directional key (A,W,S,D).
However you can see what happens if you release the keys, it does not stop. It keeps moving in its initial direction.
ChatGPT tried to solve it (FastCamScroll_nonworkingversion) but all later versions only threw an error message:

First argument must be a table or LuaEventType.
stack traceback:
[C]: in function 'on_event'
__FastCamScroll__/control.lua:28: in main chunk

So basically, my aim is to have it like the „workingversion“ but Factorio should stop the movement of the hidden character when releasing any pressed key.
And additionally to have a hotkey assigned to increase/decrease the multiplicator value of the scroll factor.

Thanks for your help in advance.
Attachments
FastCamScroll_nonworkingversion.zip
(3.98 KiB) Downloaded 9 times
FastCamScroll_workingversion.zip
(2.7 KiB) Downloaded 8 times
eugenekay
Filter Inserter
Filter Inserter
Posts: 433
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: Creating a Script in God Mode that enables faster map scrolling/moving

Post by eugenekay »

What would make you think that ChatGPT, of all the tools available, would have a clue how to write Lua in a custom dialect? :lol:

The Map scrolling in editor mode scales with the Zoom factor.
Grim82
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Apr 30, 2025 12:30 pm
Contact:

Re: Creating a Script in God Mode that enables faster map scrolling/moving

Post by Grim82 »

I don´t want to use any zoom factor. You have a fixed zoom level and can move faster than before.
Post Reply

Return to “Modding help”