Portal Home > Databáze řešení > Ascend Servers > Game Servers > Specific Game Servers > Dont Starve Together > Dont Starve Together Console Commands list

Dont Starve Together Console Commands list


This Article shows the avaliable console commands for Don't Starve Together.

Don't Starve Together Console Commands

You can run these commands in the web console in your game panel.

  • Spawn prefab
c_spawn("prefab", #)

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 withBackpacksandItemsthat 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%.

  • Spawn item
c_give("prefab", am​ount)

Creates selected item at given amount directly into your inventory.

  • God Mode
c_godmode()

It won't drain SanityHunger or Health when attacked anymore. You cannot change your stats with commands while in godmode.To deactivate God Mode use the command again.

  • Set bonus running speed
c_speed(value)

Standard bonus runspeed is 0. 6 makes you twice as fast and with 20 or more you can easily walk through walls and "over" water.

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

Note: Most of these will not work if you are a client and not an admin sending a remote command (switch to remote mode with ctrl).

  • Action Prediction
ThePlayer:EnableMovementPrediction(enable)

Enabled by default, setting it to "false" will exchange rubberbanding for choppiness, but is often helpful for combat. This only does anything if executed by a client, hosts do not have prediction.

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

You can craft everything.

  • Maximum health
​ThePlayer.components.health:SetMaxHealth(value)

Change the Maximum Healthof yourcharacter

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

Change the MaximumSanityof yourcharacter

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

Change the MaximumHungerof yourcharacter

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

Yourcharacterwon't starve anymore.

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

Turn Woodie into the Werebeaver.

Note: Many of the commands that are normally applied to your player, such as c_godmode() or c_sethealth(1), can be applied to other players by using c_select(AllPlayers[number]) first

  • Get another player
AllPlayers[number]

AllPlayers[1] will get ThePlayer if you are the host. Other players should have numbers as shown on the scoreboard (In certain situations, the number may be wrong. You can be more precise by using c_listallplayers() first to see the username and character for each player number.). Most of ThePlayer commands can be used with AllPlayers[number] instead of ThePlayer.

  • Apply a command to all players
for k,v in pairs(AllPlayers) do command end

Replace command with another command, using "v" instead of AllPlayers[number]. For example, "for k,v in pairs(AllPlayers) do c_move(v) end" will move all players to the mouse position.

  • Move another player
c_move(AllPlayers[number])

Moves the player to the cursor position.

  • Kill a player
AllPlayers[number]:PushEvent('death')

Kills the player.

  • Resurrect a player
AllPlayers[number]:PushEvent('respawnfromghost')

Resurrects the player.

  • Return a player to character select
c_despawn(AllPlayers[number])

Note that this will delete their items, so it is recommended that you kill them first to drop their items.

  • 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()
c_select() c_sel():Remove()

After pressing enter, it deletes the item under your mouse. Use the second command on dedicated servers, the first command will not work.

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

Note that this is a local command and will work if you are a client.

  • Skip day
​TheWorld:PushEvent("ms_nextcycle")

Skips the current day. Change the value to skip more days or parts of days (e.g. 16*30*4.5 to skip 4.5 days)WARNING:Too big values may freeze the game. (Depending on computer speed)

  • Skip time
TheWorld.net.components.clock:OnUpdate(16*30*x)

Skips the current day. Change x to skip more days or parts of days (e.g. 16*30*4.5 to skip 4.5 days)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.

  • Skip phase
TheWorld:PushEvent("ms_nextphase")

Skips the current phase.

  • Set segments
TheWorld:PushEvent("ms_setclocksegs", {day=x,dusk=y,night=z})

Sets amount of segments. Errors if x + y + z adds up to over 16. Note that this will get reset the next day.
Example:

TheWorld:PushEvent("ms_setclocksegs", {day=14,dusk=1,night=1})

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

  • Set season segments
​TheWorld:PushEvent("ms_setseasonclocksegs", {summer={day=sx,dusk=sy,night=sz}, winter={day=wx,dusk=wy,night=wz}})

Sets amount of segments. Errors if x + y + z adds up to over 16. Unlike setclocksegs, this is permanent.
Example:

TheWorld:PushEvent("ms_setseasonclocksegs", {summer={day=14,dusk=1,night=1}, winter={day=13,dusk=1,night=2}})

Very long day, very short dusk and night (one segment for dusk and one for night), with a slightly longer night in winter.

  • Set season lengths
TheWorld:PushEvent("ms_setseasonlengths", {summer=20, winter=15})

Sets the lengths of the seasons.{summer=20, winter=15}is the default, while{summer=50, winter=10}would be long summer.

  • Start Summer
TheWorld:PushEvent("ms_setseason", "summer")

Start summer

  • Start Winter
TheWorld:PushEvent("ms_setseason", "winter")

Start winter

When the RoG DLC is added, the additional commands will likely beTheWorld:PushEvent("ms_setseason", "spring")​andTheWorld:PushEvent("ms_setseason", "autumn")​

  • Start Rain
TheWorld:PushEvent("ms_forceprecipitation")

Start rain.

  • Stop Rain
TheWorld:PushEvent("ms_forceprecipitation", false)

Stop rain.

  • Do Lightning Strike
TheWorld:PushEvent("ms_sendlightningstrike", TheInput:GetWorldPosition())

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

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

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

  • Kick/Ban a player
TheNet:Kick(userid)
TheNet:Ban(userid)

Note that this can be accomplished more easily through the scoreboard. The userid can be obtained from the AllPlayers table. Once you've found the number of the player you want to kick (as shown above in theOther Player Commands section), you can use AllPlayers[#].userid. So, for example, with player 2, TheNet:Kick(AllPlayers[2].userid).

  • Connect to a server
c_connect("IP address", port, "password")

If connecting conventionally doesn't work, it is possible to connect directly to an IP address. By default, the port is 10999. If there is no password, you can leave that part out: c_connect("10.0.0.8", 10999)

  • Reload the world
c_reset( true / false )

true will save the world before reloading it, false will reload without saving. This command may crash your game if you are a client (unless you send it as a remote command).

  • Regenerate the world
c_regenerateworld()

Regenerates specified items in a world.

  • Save the server
c_save()

Forces the server to save immediately (servers normally autosave whenever night finishes).

  • Shut down the server
c_shutdown( true / false)

true will save the game, false will exit without saving. c_shutdown() is the same as c_shutdown(true).

  • Roll back the server
c_rollback(count)

Rolls back a server by the given number of saves. c_rollback() will roll it back by one, while c_rollback(3) will roll it back three.

  • Enable/Disable new player joining
TheNet:SetAllowIncomingConnections( true / false )

Setting it to true is the default behavior (people can join). Setting it to false prevents anyone from joining.

  • Clear the morgue
ErasePersistentString("morgue")
Clears the morgue. Requires closing and reopening the game for changes to be seen.


Did the above information not work for you? Please contact support via a ticket.

Byla tato odpověď nápomocná?
0 Uživatelům pomohlo 0 Hlasů

Také čtěte