Professional Documents
Culture Documents
To Enable The Command Console You First Need To Do Some Tweaking in Your Settings
To Enable The Command Console You First Need To Do Some Tweaking in Your Settings
ini of your
save. This can be found in the [donotstarve] folder, If you don't know where it is by default the
location is in your documents folder, Locate the settings.ini and open it with notepad or 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 ~, ^, ø or ö, Ctrl+Ñ, depending on which
keyboard layout you have. Also you can hide the console menu again by pressing Ctrl + L.
Contents
[hide]
1. Simple commands
2. Player commands
3. World commands
4. Profile Commands
5. Miscellaneous Commands
Simple commands
require "consolecommands"
Debug spawn
c_spawn("prefab", amount)
c_doscenario(scenario)
Health
c_sethealth(percent)
Sets your health to selected percentage. Note: Use fractional numbers 0.90 = 90%.
Sanity
c_setsanity(percent)
Sets your sanity to selected percentage. Note: Use fractional numbers 0.90 = 90%.
Hunger
c_sethunger(percent)
Sets your hunger to selected percentage. Note: Use fractional numbers 0.90 = 90%.
Spawn item
c_give("prefab", amount)
God Mode
c_godmode()
c_speed(6)
Standard runspeed is 6. 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
Runspeed
GetPlayer().components.locomotor.runspeed = 6
Standard runspeed is 6. 10 makes you a bit faster and with 40 you can walk through walls and "over"
water.
Creative mode
GetPlayer().components.builder:GiveAllRecipes()
Maximum health
GetPlayer().components.health:SetMaxHealth(value)
Maximum sanity
GetPlayer().components.sanity:SetMax(value)
Change the Maximum Sanity of your Characters
Maximum hunger
GetPlayer().components.hunger:SetMax(value)
Pause hunger
GetPlayer().components.hunger:Pause(true)
Werebeaver
GetPlayer().components.beaverness:SetPercent(1)
World commands
Debug Spawn
DebugSpawn("prefab")
After pressing enter, it spawns the object at the position of your cursor.
Replace "y" with the amount you want. After pressing enter, it spawns the quantity of the entity you
wanted at the position of your cursor.
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.
TheInput:GetWorldEntityUnderMouse():Remove()
Reveal Map
GetWorld().minimap.MiniMap:ShowArea(0,0,0,10000)
Skip day
GetClock():MakeNextDay()
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)
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)
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()
Start Summer
GetSeasonManager():StartSummer()
Start summer
Start Winter
GetSeasonManager():StartWinter()
Start winter
For the DLC the additional commands
are GetSeasonManager():StartSpring() andGetSeasonManager():StartAutumn()
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
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.
Unlock Willow
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.
Unlock Wolfgang
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.
Unlock Wendy
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.
Unlock WX-78
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.
Unlock Wickerbottom
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.
Unlock Woodie
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.
Unlock Wes
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.
Unlock Maxwell (character)
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.
Unlock Wigfrid (Reign of Giants DLC)
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.
Unlock Webber (Reign of Giants DLC)
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:UnlockEverything()
Miscellaneous Commands
ErasePersistentString("morgue")
Clears the morgue. Requires closing and reopening the game for changes to be seen.