Creating a Script in God Mode that enables faster map scrolling/moving
Posted: Wed Apr 30, 2025 1:14 pm
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.
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.