Scrap Mechanic Wiki
(3 intermediate revisions by the same user not shown)
Line 31: Line 31:
   
 
To enable commands, open <code>Survival/Scripts/game/SurvivalGame.lua</code> in a text editor and go to line 106. It should read <code>if sm.isHost and g_survivalDev then</code>. Change this to <code>if true then</code>. After saving the file, all players should have use of commands in all Survival worlds loaded.
 
To enable commands, open <code>Survival/Scripts/game/SurvivalGame.lua</code> in a text editor and go to line 106. It should read <code>if sm.isHost and g_survivalDev then</code>. Change this to <code>if true then</code>. After saving the file, all players should have use of commands in all Survival worlds loaded.
 
If you wish to restrict commands to the host player, change the aforementioned line to <code>if sm.isHost then</code>.
 
   
 
==Features==
 
==Features==
 
*[[Commands]]
 
*[[Commands]]
 
**Allows enabling of the unlimited inventory, god mode, spawning in [[Robots]] and [[Animals]], and more
 
**Allows enabling of the unlimited inventory, god mode, spawning in [[Robots]] and [[Animals]], and more
  +
*God mode is enabled by default
*When first joining a world, the player spawns with a [[Spud Gun]], 50 [[Potato]]es, a [[Connect Tool]], a [[Paint Tool]], and a [[Weld Tool]] in addition to the [[Sledgehammer]] and [[Lift]]
+
*When first joining a world, the [[Mechanic]] spawns with a [[Spud Gun]], 50 [[Potato]]es, a [[Connect Tool]], a [[Paint Tool]], and a [[Weld Tool]] in addition to the [[Sledgehammer]] and [[Lift]]
  +
*The Mechanic starts with the [[Logbook]], even if they have not obtained it from the terminal
 
*A different type of spawn point is used when joining a new world
 
*A different type of spawn point is used when joining a new world
 
*The Sledgehammer can damage and knock down large [[Trees]]
 
*The Sledgehammer can damage and knock down large [[Trees]]

Revision as of 19:12, 24 January 2022

Disambig This article is about the Survival developer mode. For developer functionality enabled by the -dev parameter, see Launch options.

Dev Mode is a cheat mode in Scrap Mechanic Survival Mode.

Overview

Dev Mode was created by the developers for testing purposes. It enables the use of Commands in Survival Mode.

Note that like any other Lua file modifications, enabling Dev Mode will make you unable to connect to other players (nor will other players be able to connect to you) unless they also have Dev Mode enabled.

Enabling

It is strongly recommended that you create a backup of your world before loading it in Dev Mode. This is because once a world is loaded in Dev Mode, it can be disabled only via world file editing.

To enable Dev Mode, open Survival/Scripts/game/SurvivalGame.lua in a text editor. Insert the following line at the top of the file:

g_survivalDev = true

After saving the file, Dev Mode will be enabled for all Survival worlds loaded.

Note that enabling Dev Mode in this way will allow only the host player to run commands.

To enable Dev Mode for a specific world, do the following:

  • Edit the Lua file as described above
  • Open the game and load the world you wish to use Dev Mode in
  • Exit the game without loading any other Survival worlds
  • Revert the Lua file change

When you relaunch the game, Dev Mode will still be enabled for the world you previously loaded, and only that world.

Commands Only

Alternatively, you can enable Commands without truly enabling Dev Mode, thus avoiding its side effects. Creating a backup is still recommended, due to the nature of certain commands.

To enable commands, open Survival/Scripts/game/SurvivalGame.lua in a text editor and go to line 106. It should read if sm.isHost and g_survivalDev then. Change this to if true then. After saving the file, all players should have use of commands in all Survival worlds loaded.

Features