Debug mode

From PZwiki
CommunityModdingDebug mode
Hammer.png
This article is currently under construction.
It is in the process of an expansion or major restructuring. You are welcome to assist in its construction by editing it as well.
If this page has not been updated in a while, please replace this notice with {{Improve}}. Last edit was 20/03/2022.
General debuggers option in debug mode.

Debug mode is a modified game state in Project Zomboid. In this mode, the player has access to multiple developer tools which can spawn items, enable various cheats, teleport the player to any destination, and more.


Enabling

To enable the debug mode, hold LShift while the game is booting, or for a more permanent option, add -debug to the game launch parameters prior to booting the game.


Debug scenario

A list of debug scenarios at main menu.

A list of debug scenarios can be found on the main menu, double-clicking will start the game in a predefined scenario. Custom scenarios can be made by editing "DebugScenario.lua" at "ProjectZomboid\media\lua\client\DebugUIs\Scenarios", or creating a new scenario.


Debug menu

The debug menu.

The debug menu is a user interface allowing the player to view/manipulate the game state.


When in a game, a grey bug icon on the left of the HUD will appear when in debug mode. Clicking this, will make it red and display the debug menu.

Debug Icon Off.png Debug menu icon.
Debug Icon On.png Debug menu open icon.

General debuggers

Game

This option shows all general game options. Currently, the only option is "GameSpeed".

General Game Options
Option Description Variables
GameSpeed Adjust the game speed by moving the slider. Clicking the left and right arrows will increase/decrease the game speed by 0.1 increment at a time, or 1.0 if holding the sprint key (LShift by default). This value can range from 1 to 1000, with 0.1 increments. default=1
fast-forward=5
fast-fast-forward=20
wait=40

Moodles and Body

Player Stats and Body
Option Description Variables
Hunger Slider that affects the hunger moodle, increases to 1 naturally. min=0
max=1
Thirst Slider that affects the thirst moodle, increases to 1 naturally. min=0
max=1
Fatigue Slider that affects the tired moodle, increases to 1 naturally. min=0
max=1
Endurance Slider that affects the endurance moodle, increases to 1 naturally. min=0
max=1
Fitness Slider that affects the fitness skill. This is a dynamic skill that will increase and decrease depending on the player's actions in 0.2 increments (per level). min=-1
max=1
Drunkenness Slider that affects the drunk moodle, decreases to 0 naturally. A full bottle of alcohol adds 0.41. A higher value will increase the fatigue moodle at a much higher rate. min=0
max=100
Anger Slider that affects the angry moodle, decreases to 0 naturally. min=0
max=1
Fear Slider that affects an unknown naturally static value. min=0
max=1
Pain Slider that affects the pain moodle, decreases to 0 naturally. Cannot be adjusted manually min=0
max=100
Panic Slider that affects the panic moodle, decreases to 0 naturally. min=0
max=100
Morale Slider that decreases to 0 naturally when stress is above 0.5. When stress is below 0.5, morale will instantly become 1.0. min=0
max=1
Stress Slider that affects the stress moodle, decreases to 0 naturally. min=0
max=1
BoredomLevel Slider that affects the bored moodle, decreases to 0 naturally. min=0
max=100
Sanity Slider that can be adjusted when the BoredomLevel is above 50. min=0
max=1
Wetness Slider that affects the wet moodle, decreases to 0 naturally. min=0
max=100
Temperature Slider that affects the player's body temperature, affecting the hyperthermia and hypothermia moodles, decreases to 0 naturally. min=20
max=40
ColdDamageStage (hypo 4) Slider that determines how much damage the player will take when the hypoermia moodle is at level 4. min=0
max=1
OverallBodyHealth Slider that affects the player's overall health. min=0
max=100
CatchAColdStrength Slider that affects the cold moodles, increaes to 100 naturally when above 1.0. min=0
max=100
Sickness Slider that determines the sick moodle. Adjusts with InfectionLevel and FakeInfectionLevel Cannot be adjusted manually min=0
max=1
InfectionLevel Slider that affects the player's progress towards zombification, increasing rate of damage taken. min=0
max=100
FakeInfectionLevel Slider that affects the player's sickness, naturally occurs with the hypochondriac trait. min=0
max=100
FoodSicknessLevel Slider that affects the player's sickness, naturally occurs after eating bad food. min=0
max=100
IsInfected Checkbox that determines whether the player has the zombie infection. boolean
IsFakeInfected Checkbox that determines whether the player is should have zombie infection symptoms without being infected. boolean
IsOnFire Checkbox that determines whether the player is on fire. boolean
Ghost Checkbox that determines whether the zombies can see the player, and zombies can be seen regardless of visibility. boolean
God Mode Checkbox that determines whether the player is in god mode. Gives the player invincibility, i.e. takes no damage, max hunger, thirst, etc. boolean

General Cheats

Option Description Variables
Build Cheat Checkbox that determines whether all buildables in the metalwork and carpentry menus can be instantly built without the need of a skill or tool. boolean
Health Panel Cheat Checkbox that determines whether the debug options inside the health panel are available. boolean
Moveable Cheat Checkbox that determines whether all moveables can be instantly moved/rotated without the need of a skill or tool. boolean
Mechanics Cheat Checkbox that determines whether the debug options inside the mechanics menu are available. boolean


Climate debuggers

The climate control panel

FX panel

This is opened by selecting "Other debuggers", then "WeatherFX Panel". Here you can play around with various values such as fog intensity, precipitation levels and precipitation type. Please note that to play around with these you will need to disable the ‘Climate’ manager or the simulated daily climate will overrule your changes.

Please also note that fog enabled through this method is for testing fog masking around buildings, and won’t look as good/varied as the fog generated by the virtual climate system – as it won’t take into account colour or desaturation.

Climate view panels

The debug climate control and climate values panels can be accessed by selecting "Other debuggers", then "Weather plotter" and "Daily values" respectively. These panels provide a stockmarket-type graph of the current/recent weather over hours (H1), days (D1) and months (M1)

To see what values are running under the bonnet use the legend/panel on the right, and values turned on will be green. The climate values panel, meanwhile, displays additional info about seasons, cloud cover, etc.

These panels are overall for the provision of information, but that said when you toggle "airMass" on, when it crosses the 0 middle line you will see weather generated when airmass switches from hot/cold.

Thunder panel

This panel can be opened by selecting "Other debuggers", then "Thunderbug", but is only useful if there is a storm active. A geographical indication of where the storm is over the PZ map can be seen, as well as lightning locations.


IsoRegions

The IsoRegions panel

This will display all buildings (including player-made) and can be used to detect when buildings are fully closed off from the PZ map – and as such will allow fog/precipitation to surround structures, but not appear within them. PLEASE NOTE: this is a real performance hog, so may well slow down the game when turned on.


Zombie population

Zombie-population.png

Shows all zombies as red dots on a map.


Player's stats

Player-stats.png

Access to player traits and skills interface.


Items list

Items-list-viewer.png

Allows the spawning of any item in-game to the player's inventory.


Stash debuggers

Stash-debug-ui.png

Allows the debugging of "annotated map" house stashes.


Debug screen

Command console

Lua debugger

The Lua debugger can be accessed by pressing F11; breaking into debugger at the next available Lua entry point. A list of all loaded Lua files are displayed on the right, with the currently selected file above the list. The line highlighted green is the entry point to the debugger, allowing for quick in-game debugging.

Within the F11 menu there is an options menu with a long drop down, you can select from a variety of sources to help you find further information about your current session. Be careful with these options because some of them might cause your client to freeze and continuously crash upon launch. If this happens you can set the offending option to false in C:\Users\Username\Zomboid\debug-options.init.

Reload File in-game

You can use the in-game file browser to search for the lua file you're modifying and select it where it will be updated in the above window. If you make changes to the file, you can hit the "reload file" button and it will attempt to apply the changes you made in-game, though this is often an unreliable way to test recently updated code.

Map debugger

The map debugger is opened by clicking the "Map" button at the top. The player can teleport to the location of the cursor, by pressing T. There is no prompt to inform the user of the teleport; after closing the debugger, the player will have teleported.