Wikia

Don't Starve game Wiki

Console/Commands

< Console

949pages on
this wiki
Comments698

The Command Console is enabled by default. If for whatever reason it is not, you first need to do some tweaking in your settings.ini of your save. This can be found in the "donotstarve" folder, located in the following paths :

Windows, Mac: <Documents>\Klei\DoNotstarve\settings.ini

Linux:         ~/.klei/DoNotStarve/settings.ini

Locate the settings.ini and open it with Notepad and where it says [MISC]ENABLECONSOLE = false and rewrite it as [MISC]ENABLECONSOLE = true then save the document.

Then to open the console while in game by pressing "~" by default on English keyboards. This can be changed at any time in the controls menu. Also you can hide the console menu again by pressing Ctrl + L.

You will need to run this command once to enable console commands:

RunS​cript("consolecommands")

Note: Like many other command-line interfaced programs, the user can press the upper arrow key to get access to previously entered commands, with no need to re-type them manually again. However, the player still have to re-enter every command after re-entering a world.

Simple commands

  • Spawn prefab
c_spawn("prefab", amount)

Improved DebugSpawn("prefab"), spawns amount of selected "prefab" under the mouse cursor.

  • Give Item
c_give("prefab", amount)

Spawns amount of selected "prefab" in your inventory. Only works with Backpacks and Items that can be stored in the inventory.

  • Scenario (Not tested)
c_doscenario(scenario)

Apply a scenario script to the selection and run it.

  • Health
c_sethea​lth(percent)

Sets your health to selected percentage. Note: Use fractional numbers 0.90 = 90%.

  • Sanity
c_setsanit​y(percent)

Sets your sanity to selected percentage. Note: Use fractional numbers 0.90 = 90%.

  • Hunger
c_sethunger(pe​rcent)

Sets your hunger to selected percentage. Note: Use fractional numbers 0.90 = 90%.

  • God Mode
c_godmode()

It won't drain SanityHunger or Health when attacked anymore. Note that you will need to turn it off and on again after passing through a Worm Hole, sleeping, Telepoofing, entering or exiting a cave system, eating mandrakes, or using complicated commands too many times.

  • Set running speed
c_speed(value)

Standard runspeed is 1. 10 makes you a bit faster and with 40 you can walk through walls and "over" water.

There's some other commands, but they're hard to use and not very useful.

Player commands

  • Hide and show HUD
GetPlayer().HUD:Hide()
GetPlayer().HUD:Show()

Hide or show (after hiding) the full HUD of the game.


  • Creative mode
GetPlayer().components.builder:GiveAllRecipes()

You can craft everything. This includes items you never crafted before.


  • Maximum health
GetPlayer().components.health:SetMaxHealth(value)

Change the Maximum Health of your Characters


  • Maximum sanity
GetPlayer().components.sanity:SetMax(value)

Change the Maximum Sanity of your Characters


  • Maximum hunger
GetPlayer().components.hunger:SetMax(value)

Change the Maximum Hunger of your Characters


  • Pause hunger
GetPlayer().components.hunger:Pause(true)

Your Characters won't starve anymore.


  • Werebeaver
GetPlayer().components.beaverness:SetPercent(1)

Turn Woodie into the Werebeaver.

World commands

  • Teleport to Prefab
c_gonext("prefab")

After pressing enter, it teleports you to the first numerical instance of the named prefab. If multiple iterations of the prefab exist, a list of the entity numbers will be displayed in the console log, and each subsequent execution of the same command will transport the player from entity to entity in the order they were generated in the world.

  • Delete Item Under Mouse
TheInput:GetWorldEntityUnderMouse():Remove()

After pressing enter, it deletes the item under your mouse

  • Reveal Map
GetWorld().​minimap.MiniMap:ShowArea(0,0,0,10000)

Note: the map will return to normal after exiting the game or changing maps, but any new areas will remain explored.

  • Skip day
​GetClock():MakeNextDay()

Skips the current day.

  • Skip more days
for x = 1, 50 do GetClock():MakeNextDay() end

Skips 50 days in this example. Replace 50 with the amount of days you want to skip.

WARNING: Too big values may freeze the game. (Depending on computer speed)

  • Skip time units and update
LongUpdate(X)

Skips X time units and performs the "LongUpdate" function on world objects

Note: There are 30 time units per segment. To skip a whole day one can either use LongUpdate(480) or use multiplicative values such as LongUpdate(X*16*30) or LongUpdate(X*TUNING.TOTAL_DAY_TIME), with X=days to skip.


  • Set segments

Usage:

​GetClock():SetSegs(day,dusk,night)

Sets amount of segments. Errors if adds up to over 16. Example:

​GetClock():SetSegs(14,1,1)

Very long day, very short dusk and night (one segment for dusk and one for night)


  • Skip phase
GetClock():NextPhase()

Skips the current phase.

  • Start Summer
GetSeasonManager():StartSummer()

Start summer

  • Start Winter
GetSeasonManager():StartWinter()

Start winter

  • Start Autumn Reign of Giants icon
GetSeasonManager():StartAutumn()

Start autumn

  • Start Spring Reign of Giants icon
GetSeasonManager():StartSpring()

Start spring

  • Start Mild Season Shipwrecked icon
GetSeasonManager():StartMild()

Start mild season

  • Start Hurricane Season Shipwrecked icon
GetSeasonManager():StartWet()

Start hurricane season

  • Start Monsoon Season Shipwrecked icon
GetSeasonManager():StartGreen()

Start monsoon season

  • Start Dry Season Shipwrecked icon
GetSeasonManager():StartDry()

Start dry season. Because of this season follows the monsoon season, the player will notice that the floor will be suddenly flooded (but it will be completely dry in a while).

  • Start Rain
GetSeasonManager():StartPrecip()

Start rain

  • Stop Rain
GetSeasonManager():StopPrecip()

Stop rain

  • Do Lightning Strike
GetSeasonManager():DoLightningStrike(Vector3(GetPlayer().Transform:GetWorldPosition()))

Lightning strike on player. Will hit lightning rod instead if there is one near

  • Do Volcano Eruption Shipwrecked icon
GetVolcanoManager():StartEruption(smokeduration,ashduration,firerainduration,firerockspersecond)

Do a volcano eruption. Notice that the fire rain duration is measured in seconds.

  • Measure Distance
print(math.sqrt(GetPlayer():GetDistanceSqToInst(TheInput:GetWorldEntityUnderMouse())))

Prints the distance between player and object under mouse to the console log (displayed with Ctrl + L by default).

Profile Commands

While profile commands are permanent and do not need to be done each time, they do need to be performed while in a game.  You can unlock multiple characters at a time without requiring the line including the save until the very last step.

GetPlayer().profile:UnlockCharacter("willow")
GetPlayer().profile:Save()

Unlocks Willow.  Does not need to be re-entered after the first time unless you lose your profile settings.

GetPlayer().profile:UnlockCharacter("wolfgang")
GetPlayer().profile:Save()

Unlocks Wolfgang.  Does not need to be re-entered after the first time unless you lose your profile settings.

GetPlayer().profile:UnlockCharacter("wendy")
GetPlayer().profile:Save()

Unlocks Wendy.  Does not need to be re-entered after the first time unless you lose your profile settings.

GetPlayer().profile:UnlockCharacter("wx78")
GetPlayer().profile:Save()

Unlocks WX-78.  Does not need to be re-entered after the first time unless you lose your profile settings.

GetPlayer().profile:UnlockCharacter("wickerbottom")
GetPlayer().profile:Save()

Unlocks Wickerbottom.  Does not need to be re-entered after the first time unless you lose your profile settings.

GetPlayer().profile:UnlockCharacter("woodie")
GetPlayer().profile:Save()

Unlocks Woodie.  Does not need to be re-entered after the first time unless you lose your profile settings.

GetPlayer().profile:UnlockCharacter("wes")
GetPlayer().profile:Save()

Unlocks Wes.  Does not need to be re-entered after the first time unless you lose your profile settings.

GetPlayer().profile:UnlockCharacter("waxwell")
GetPlayer().profile:Save()

Unlocks Maxwell.  Does not need to be re-entered after the first time unless you lose your profile settings.

GetPlayer().profile:UnlockCharacter("wigfrid")
GetPlayer().profile:Save()

Unlocks Wigfrid.  Does not need to be re-entered after the first time unless you lose your profile settings.

GetPlayer().profile:UnlockCharacter("webber")
GetPlayer().profile:Save()

Unlocks Webber.  Does not need to be re-entered after the first time unless you lose your profile settings.

GetPlayer().profile:UnlockCharacter("walani")
GetPlayer().profile:Save()

Unlocks Walani.  Does not need to be re-entered after the first time unless you lose your profile settings.

GetPlayer().profile:UnlockCharacter("warly")
GetPlayer().profile:Save()

Unlocks Warly.  Does not need to be re-entered after the first time unless you lose your profile settings.

  • Unlock Everything (Currently all characters)
​GetPlayer().profile:UnlockEverything()

Miscellaneous Commands

  • Clear the morgue
ErasePersistentString("morgue")

Clears the morgue. Requires closing and reopening the game for changes to be seen.

Start a Discussion Discussions about Console/Commands

Around Wikia's network

Random Wiki