Scrap Mechanic

Scrap Mechanic

TheTool May 9, 2020 @ 12:11am
How to access the dev console
How to access the dev console commands in survival.

Open \Program Files (x86)\Steam\steamapps\common\Scrap Mechanic\Survival\Scripts\game\SurvivalGame.lua

Go to line 37 and add the line

g_survivalDev = true

Save and play.

Now you can access any of these commands from the chat window.

/ammo "Give ammo (default 40)"
/spudgun "Give the spudgun"
/gatling "Give the potato gatling gun"
/shotgun "Give the fries shotgun"
/sunshake "Give 1 sunshake"
/baguette "Give 1 revival baguette"
/keycard "Give 1 keycard"
/powercore "Give 1 powercore"
/components "Give <quantity> components (default 10)"
/glowsticks "Give <quantity> components (default 10)"
/tumble "Set tumble state"
/god "Mechanic characters will take no damage"
/respawn "Respawn at last bed (or at the crash site)"
/encrypt "Restrict interactions in all warehouses"
/decrypt "Unrestrict interactions in all warehouses"
/limited "Use the limited inventory"
/unlimited "Use the unlimited inventory"
/ambush "Starts a 'random' encounter"
/recreate "Recreate world"
/timeofday "Sets the time of the day as a fraction (0.5=mid day)"
/timeprogress "Enables or disables time progress"
/day "Disable time progression and set time to daytime"
/spawn "Spawn a unit: 'woc', 'tapebot', 'totebot', 'haybot'"
/harvestable "Create a harvestable: 'tree', 'stone'"
/cleardebug "Clear debug draw objects"
/export "Exports blueprint $SURVIVAL_DATA/LocalBlueprints/<name>.blueprint"
/import "Imports blueprint $SURVIVAL_DATA/LocalBlueprints/<name>.blueprint"
/starterkit "Spawn a starter kit"
/mechanicstartkit"Spawn a starter kit for starting at mechanic station"
/pipekit "Spawn a pipe kit"
/foodkit "Spawn a food kit"
/seedkit "Spawn a seed kit"
/die "Kill the player"
/sethp "Set player hp value"
/setwater "Set player water value"
/setfood "Set player food value"
/aggroall "All hostile units will be made aware of the player's position"
/goto "Teleport to predefined position"
/raid "Start a level <level> raid at player position at wave <wave> in <delay> hours."
/stopraid "Cancel all incoming raids"
/disableraids "Disable raids if true"
/camera "Spawn a SplineCamera tool"
/printglobals "Print all global lua variables"
/clearpathnodes "Clear all path nodes in overworld"
/enablepathpotatoes "Creates path nodes at potato hits in overworld and links to previous node"

Always make a back up of the file before edit.
This line will need to be added every update.

EDIT: Be careful with /recreate.
It will regenerate the entire world.
All builds will be removed, all enemies respawned, all items respawned, all batteries removed where player installed.
Last edited by TheTool; May 9, 2020 @ 12:45pm
< >
Showing 1-13 of 13 comments
What is life? May 9, 2020 @ 12:50am 
Interesting
TheTool May 9, 2020 @ 9:56am 
Alternatively you can add the line

g_survivalDev = true

at the end of the file SurvivalGame.lua instead of line 37.
Just scroll all the way to the bottom, add it, save.
What is life? May 9, 2020 @ 11:54am 
how do i open it upp on the world
TheTool May 9, 2020 @ 12:10pm 
Originally posted by What is life?:
how do i open it upp on the world

Enter key to open chat window, then command
ex: /spudgun
What is life? May 9, 2020 @ 12:15pm 
doesent work for me
TheTool May 9, 2020 @ 12:19pm 
Originally posted by What is life?:
doesent work for me

The line
g_survivalDev = true
needs to be added to the end of the file
SurvivalGame.lua
Oven May 9, 2020 @ 5:12pm 
Is there a way to do this in creative? Can I spawn bots in creative?
TheTool May 9, 2020 @ 6:40pm 
Originally posted by wolfprintracing:
Is there a way to do this in creative? Can I spawn bots in creative?
Not with this method.
Sinay51 May 11, 2020 @ 8:21am 
Originally posted by wolfprintracing:
Is there a way to do this in creative? Can I spawn bots in creative?

You can do /unlimited and /god in survival to play like in creative
Last edited by Sinay51; May 11, 2020 @ 8:21am
GeoGent May 17, 2020 @ 6:14pm 
i do /god but i still die and g_survivalDev is set to true too
But this is not a console, but only a fragment of the developer mode, isn't it?
oNixu Dec 7, 2024 @ 8:52pm 
Originally posted by #00ff00 AlexTool:
But this is not a console, but only a fragment of the developer mode, isn't it?
Yeah, I am on the quest to find out how to actually Access the console itself , since some of the commands print to console
Originally posted by oNixu:
Originally posted by #00ff00 AlexTool:
But this is not a console, but only a fragment of the developer mode, isn't it?
Yeah, I am on the quest to find out how to actually Access the console itself , since some of the commands print to console
I tried to open the developer functions in survival and found that the game checks the variable self.sv.saved.data.dev and tried to change it globally but I could only set it locally through the survivalgame.lua script and I also noticed that in my settings.json the parameter "Devsosnole": 0 appeared but after changing it to 1 I did not notice the change. as a result, I have the parameter devconsole: 1 in the settings and a world in survival with developer commands (this is exactly one mmir with developer mode, not a modification of the game code)
< >
Showing 1-13 of 13 comments
Per page: 1530 50

Date Posted: May 9, 2020 @ 12:11am
Posts: 13