Skip to content

Instantly share code, notes, and snippets.

@LXGaming
Last active April 8, 2024 00:45
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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.

@LXGaming
Copy link
Author

LXGaming commented Apr 14, 2022

Awesome! I have updated the original post to make it clear which key is required to open the console.

@YAMILive
Copy link

YAMILive commented May 5, 2022

How to make Execution Platform have no cooldown? And I didn't find ConsoleOutput.html, the game root directory doesn't have it, how to enable more command functions

@LXGaming
Copy link
Author

LXGaming commented May 5, 2022

@YAMILive Not sure, I've dumped the global Lua functions for you https://gist.github.com/LXGaming/d3c66c1e6dec8a46d78b7248c6c57b88

@YAMILive
Copy link

YAMILive commented May 5, 2022

SetGameTime(Day) No effect, it prompts irreversible

@LXGaming
Copy link
Author

LXGaming commented May 5, 2022

If the current game day is 10 you'll have to run SetGameTime(11) for it to advance to the next day.
Just tested and can confirm that this command works.

@franabad
Copy link

How can I undo what I've done? When I unhide the sites, how can I hide them again? Thanks in advance!

@LXGaming
Copy link
Author

@franabad Unless Unhide sites is a toggle, I don't believe you can re-hide the sites. Creating a new game or loading a older save would be the only solution.

@franabad
Copy link

@LXGaming it is not a toggle. The thing is that I need some survivors to complete the quest in Refugees scenario. I get them all except the one that are hidden, that's why I want to unhide the sites, so I can get the survivors. Once I get them, I would like to hide again but it doesn't seem possible! Do you know other way to complete the quest? I need like 15 people to reach 250! Thanks!

@LXGaming
Copy link
Author

LXGaming commented May 25, 2022

You unlock the sites as the incoming refugee groups arrive, I reached 238 without touching the sites, After visiting the sites I reached 341,
It's possible that Unhide sites is breaking the scenario.

Survivor Sites:

  • Trail Bend: 19
  • Black Spire: 37
  • White Pass: 47

Frostpunk

@franabad
Copy link

Yeah, I know that. The problem is that I have 64 bodies... Thats why I want to unhide the site called Red Flag Camp, so I can get there and take them to my city. It's hidden until you finish the quest. As you can see, I have all the Survivors Sites.
image

@LXGaming
Copy link
Author

Yeah I'm not sure, It seems that it's added in dynamically as you progress through the scenario rather than being hidden, There are cheats in the panel which can make Citizens immortal which might be an alternative solution.

@franabad
Copy link

franabad commented May 25, 2022

@LXGaming Yeah, but those who are dead will remain dead. I really don't wanna start over again because I've tried it like 10 times. I'm playing survivor mode and it's pretty hard. In 10 times, I only had 1 Canning Workshop with food...

@xXGaboXx195
Copy link

Hi, i been trying to make this work but it seems impossible, got the game on Epic and i already added the "-devconsole" command but in the game it doesn't work i have changed my keyboard to US and nothing.
I downloaded the game from internet and i added the command line to the shortcut, but in the game i just got the build and date message and still no console window.

Can you help me?
07ebd64ea3d8dc4f61dfcf4b5b3c4c8b

@pankajbains5
Copy link

@YAMILive Not sure, I've dumped the global Lua functions for you https://gist.github.com/LXGaming/d3c66c1e6dec8a46d78b7248c6c57b88

where to put this function

@HELLOIAMCATBUG
Copy link

How can I make devconsol active but only on the pirated version of the game?

@Zewling
Copy link

Zewling commented Nov 28, 2023

For Epic Games you might be able to do the following:

  1. Click your profile icon in the top right corner
  2. Click Settings
  3. Scroll down to the Manage Games section, find and click on Frostpunk
  4. Check Additional Command Line Arguments

Hello @LXGaming, I would like to ask you for little help here with dev console activation on Epic game launcher. I did as you wrote and wrote -devconsole into empty field under "Additional Command Line Arguments" but without success with summon the comand line. Also I tried to -allowconsole, -console and its different variation.
Please when you have some time have a look onto this. I will very appreciate your help here.

Many thanks in advance.

@Moriac1
Copy link

Moriac1 commented Nov 29, 2023

Hello @LXGaming, thanks for you work and explanations. Do you know how FreeCam command works, or any that involves manipulating the game camera ? Do you know if there is a more complete documentation on how to use each Lua functions they are supposed to ? (i'm getting a ton of error messages, so i guess i'm doing something wrong).

Thanks in advance for your help. Take care !

@LXGaming
Copy link
Author

LXGaming commented Dec 1, 2023

@HELLOIAMCATBUG It's just a program argument, open a terminal in the game folder and run Frostpunk.exe -devconsole.

@Zewling I re-tested Epic Games and it worked fine, double check you're pressing the correct key, if you don't have a US Keyboard layout then I suggest pressing every key and if you have a laptop with a function key try holding it down while pressing the Backtick (Grave Accent) key.

@Moriac1 No sorry, I only ever figured out the Time and Resource commands.

@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)

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