Skip to content

Instantly share code, notes, and snippets.

@LXGaming
Last active November 15, 2024 00:08
Show Gist options
  • Save LXGaming/f5457fca7a7d10aed672d46b393de311 to your computer and use it in GitHub Desktop.
Save LXGaming/f5457fca7a7d10aed672d46b393de311 to your computer and use it in GitHub Desktop.
Frostpunk Cheat / Developer Mode

Developer Mode

  1. Start the game with -devconsole launch argument (Steam Guide / Epic Games Guide)
  2. Press the Backtick (Grave Accent) to toggle console

Commands

Command Description
SetGameTime(Day) Changes the day
SetResource("Id", Amount) Changes the resource amount. Quotes are required for the resource id
ShowDebugButtonsPanel Cheats / Debugging buttons

Resources

Id Name
Coal Coal
Wood Wood
Steel Steel
Steam Cores Steam Cores
Raw Food Raw Food
Food Rations Food Rations
Bodies Bodies
Wooden Materials Structural Profiles
Steam Tools Steam Exchangers
Steel Plates Steel Composites

Functions

Frostpunk v1.6.1 Dump or run the following (Source):

local a={}function dump(b,c)a[b]=true;local d={}local e=0;for f in pairs(b)do e=e+1;d[e]=f end;table.sort(d)for f,g in ipairs(d)do print(c,g)g=b[g]if type(g)=="table"and not a[g]then dump(g,c.."-")end end end;dump(_G,"-")

Open ConsoleOutput.html located in the root of the game directory to view them all.

@Moriac1
Copy link

Moriac1 commented Dec 4, 2023

@LXGaming how did you figure out how to use the commands ?

@LXGaming
Copy link
Author

LXGaming commented Dec 5, 2023

@Moriac1 Basically bruteforce and luck, I put the commands in the console, hit enter then looked at the output.

ShowDebugButtonsPanel was easy cause it worked instantly, a giant button panel popped up on the screen.

SetGameTime and SetResource check the input and provide feedback to the console, for example SetResource will respond with "The resource "INPUT" does not exist.", these messages helped with understanding which parameters the command required.

It gets significantly more difficult / impossible when commands provide no feedback, even worse is when the command crashes the game. Part of the issue is wondering if the command you're trying to run has actually been removed from the production build of the game. At that point you'd be better off deciphering the game files and reverse engineering the logic instead of attempting to do it through a limited console.

@Moriac1
Copy link

Moriac1 commented Dec 6, 2023

But what about the Lua commands ? Are you fluent in Lua to know what condition to type or how is structure the command you're trying to use ? If for example the feedback of the command does not give you what to enter.
I found the commands in the memory via cheat engine but i'm quite new at manipulating memory, if you got tips on how to progress on the matter of reverse engineering (especially for this technical wall that is frostpunk), i would be grateful.
Anyway thanks for your quick responses, it's really helpful :)

Udpdate : i tested some camera commands, but either it does nothing or it crashes the game. I don't know if the game is unstable or if my input is wrong, but yep.. i got better results through cheat engine so far. Is reverse engineering really worth it to deactivate an image and the border fog ?

@LXGaming
Copy link
Author

LXGaming commented Dec 6, 2023

I'm not fluent in Lua, most of what I've figured out is just guess work and Google. I don't know enough about reverse engineering games to be of any help.

@Mr-8k
Copy link

Mr-8k commented Dec 11, 2023

I think something changed between 1.6.1 and 1.6.2. Running the command to dump functions returns an error:
FP error
(there's nothing in the ConsoleOutput.html either)
Only noticed this as another command also seems to have broken, as per this thread InvokeEvent 'xxx' should provide a list but also returns an error. I'm tempted to find a 1.6.1 version and test this for myself.

@LXGaming
Copy link
Author

@Mr-8k Looking at the error the command doesn't look like it was entered correctly, I've been using Logitech G HUB to create a macro which types the command for me with a press of a button, If you don't have Logitech peripherals then something like AutoHotkey may work.

@Mr-8k
Copy link

Mr-8k commented Dec 12, 2023

Funny you should say that, I'm using an AHK script to type the contents of my clipboard. No way I'm entering that manually. Worth noting that frostpunk really loves screwing over all my inputs, logitech macros don't work and neither does something as simple as ctrl+esc to open the windows menu, only alt+tab works.

@LXGaming
Copy link
Author

Make sure you're using SendRaw in AHK so that the {} characters aren't interpreted as keys by AHK

@Mr-8k
Copy link

Mr-8k commented Dec 12, 2023

Much appreciated, my digging can resume.

@LXGaming
Copy link
Author

I've figured out how to load Lua scripts into Frostpunk.

Create the file %APPDATA%\11bitstudios\Frostpunk\script.lua with the following contents:

print("Hello, World!")

Then run gLua:ExecuteFile("script", "project") in the in-game console.

Technicals

When analyzing the ConsoleOutput.html there are several directories getting mounted to what appears to be a virtual filesystem.

  • %APPDATA%: user
  • %APPDATA%\11bitstudios\Frostpunk: project
  • %USERPROFILE%\Pictures\Frostpunk: screens

The ExecuteFile syntax appears to be ExecuteFile(<File Name>, [FileSystem Name]) (<> is required and [] is optional).

@Deanmartain
Copy link

I'm doing the developer mode in frostpunk but when I get the red command panel up and try a code it either says error while using chunks or end of stack level 1 or 2

@LXGaming
Copy link
Author

LXGaming commented Apr 8, 2024

@Deanmartain The commands are case sensitive, please make sure you are entering them correctly, if it's still not working please provide a screenshot of the error.

Example of the commands:
ShowDebugButtonsPanel
SetResource("Coal", 1000)
SetResource("Wooden Materials", 1000)

@mammuthus
Copy link

How to increase HOPE guys? Couldn't find it in the cheat menu

@mammuthus
Copy link

Accidently found the answer:

To make hope rise (without any other consequences), open "All dilemma list" and use the dilemma in "Faith - Consequences" named "Rightful denunciation, a lying child"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment