Scrap Mechanic

Scrap Mechanic

Not enough ratings
Altering game files complete guide
By Arcat
Everything I've learned throughout my time altering the game files
Everything in this guide starts from this folder

C:\Program Files (x86)\Steam\steamapps\common\Scrap Mechanic\Survival

Backup your game files.
if you make a mistake you can reset everything in you files you edited by "Verifying integrity of game files"
   
Award
Favorite
Favorited
Unfavorite
Crafting Recipies
The following edits will be based on this folder

C:\Program Files (x86)\Steam\steamapps\common\Scrap Mechanic\Survival\CraftingRecipes

The crafting recipe folder is straightforward to understand as each file follows the same structure

What each crafting bot is in each file in the folder

cookbot = Cook bot
craftbot = Craft bot
dispenser = Mechanic station crafter
dressbot = Dress bot
hideout = Farmer hideout shop
refinery = Refinery bot and manual refinery
workbench = mini craftbot

{ "itemId": "54d84731-d9ec-435d-bc9d-d48e0763b1bf", "quantity": 1, "craftTime": 10, "ingredientList": [ { "quantity": 1, "itemId": "fb0f128c-e607-4c52-9c25-f44dfd2dd95e" }, { "quantity": 2, "itemId": "( 2c4a2633-153a-4800-ba3d-2ac0d993b9c8" }, { "quantity": 2, "itemId": "bfcfac34-db0f-42d6-bd0c-74a7a5c95e82" }, { "quantity": 1, "itemId": "6d92d8e7-25e9-4698-b83d-a64dc97978c8" } ] },

itemId

itemId can be found in the following folder, select the file named "survivial_items"

C:\Program Files (x86)\Steam\steamapps\common\Scrap Mechanic\Survival\Scripts\game

At the beginning of the code, the “itemId” is used to select which item you want to craft, when you found an item you want to craft copy the itemId and paste it.

Quantity

Quantity refers to how many items you will receive when you craft something.
Using the example above you will receive 1 of the item you craft, changing this number makes it for you can get more while using the same resources.

Craft Time

Craft time refers to the time it takes the item to be crafted ( Setting it to "0" was not tested but it's best if you don’t try. )

Ingredient list

Following this line of code are the items you will need to craft this item.
The items needed are also selected by "itemId", and how much you need of that item is the "Quantity"

Extra notes

This is one of the methods to bring any item from creative mode into survival, you just need to change the “itemId” and select how much it should cost.

If you need help with what each item in the "survival_loot" file is, go to the chapter where it’s explained
Objects
The following edits will be based on this folder

C:\Program Files (x86)\Steam\steamapps\common\Scrap Mechanic\Survival\Objects\Database\ShapeSets

This folder contains many files, every file refers to the properties of a block or part, they were separated into many files but are very similar to each other code-wise.

This is the average code template.

{ "partList": [ { "uuid": "5530e6a0-4748-4926-b134-50ca9ecb9dcf", "name": "obj_consumable_component", "renderable": "$SURVIVAL_DATA/Objects/Renderable/resource/obj_resource_component.rend", "color": "df7f01", "box": { "x": 2, "y": 1, "z": 2 }, "rotationSet": "PropYZ", "physicsMaterial": "Metal", "ratings": { "density": 4, "durability": 7, "friction": 3, "buoyancy": 8 }, "flammable": false, "stackSize": 50, "restrictions": { "erasable": true } } ] }

This code is taken from the "component" file

uuid

"uuid" codes can be found in the "survivial_items" file in the following folder.

C:\Program Files (x86)\Steam\steamapps\common\Scrap Mechanic\Survival\Scripts\game

It's not recommended to change this code as each block already has there own code.

name

Name can also be found in the "survival_items" file. This is also not recommended to edit

rendable

This is the block render and can be found in the following folder.

C:\Program Files (x86)\Steam\steamapps\common\Scrap Mechanic\Survival\Objects\Renderable\resource

color

refers to the base color of the block, you can change this if you want a block or part to have a color not available in default.

box

Refers to the dimensions of the block. Not recommended to be edited

physical material

this is how the physics engine sees this part or block, by changing it you can have metals behaving like wood or wood behaving like a metal

rating

Following the rating line are the values of the block, part. it goes from 1 to 10
an example could be 10 durability which means it's indestructible

flamable

if it can be destroyed by fire, not very prominent in the game but its there, it can change between "true" or "false"

stacksize

The max number of an item in a stack, some items do not have this option.
  • Parts like the craft bot which you carry do not have stacksize but a "carryitem" line that can be changed between "true" or "false"
"flammable": true, "stackSize": 512
if the object or part doesn't have the "carryitem" or "stacksize" line you can add it after the "flamable" line and input any stacksize you want, this includes blocks in the "blocks" file which do not have the line.
Game
The following edits will be based on this folder

C:\Program Files (x86)\Steam\steamapps\common\Scrap Mechanic\Survival\Scripts\game

this folder contains many more files which will be viewed later, this part will be about the files themselves

Survival_items

in this file you find all the items in the game, each item has an Id which is used on other files to call and verify the item.

survival_loot

in this file you change the loot tables, that is the frequency and quantity of a resource when it drops and what that item is.

local random_officeloot = { { uuid = obj_consumable_component, chance = 10, quantity = 1 }, { uuid = obj_resource_circuitboard, chance = 10, quantity = randomStackAmount2 }, { uuid = obj_consumable_battery, chance = 10, quantity = randomStackAmountAvg5 }, { uuid = obj_consumable_sunshake, chance = 30, quantity = randomStackAmount2 }, { uuid = obj_plantables_potato, chance = 30, quantity = randomStackAmountAvg5 }, { uuid = obj_consumable_glowstick, chance = 30, quantity = randomStackAmountAvg5 }, { uuid = obj_consumable_inkammo, chance = 65, quantity = randomStackAmount20 }, { uuid = obj_consumable_glue, chance = 65, quantity = 1 },

"uuid" is found in "survival_items", in this file the "itemId" is not used but the name which is connected to it.
you can swap the "uuid" to change the item you wish to drop or make a new one drop

"chance" is the likelihood of the item dropping, in the beginning of the file is explained as ' -- A chance of 100 makes the item 100 times more likely than with a chance of 1 ', using the code above as an example, the "component" and "circuitboard" have the same chance to drop but the "sunshake" as 3 times the chance to drop

"quantity" is how many items will one dropped stack contains, when referring to "randomStackAmount" refers to a random number of items in a stack with a max of the number you place, "randomStackAmountAvg" is the same as before but the number placed after the "Avg" is the average number of item it will contain in a stack

lootTables.loot_haybot = { slots = function() return 4 end, selectOne = { { uuid = blk_scrapmetal, chance = 1, quantity = 20 }, }, randomLoot = { { uuid = obj_consumable_component, chance = 1, quantity = 4 }, { uuid = obj_resource_circuitboard, chance = 2 }, } }

in this fragment of code, I have already edited it, this is an example of what you can do.
"selectOne" is used to make sure this item drops, so anytime it can it will
"randomLoot" is used to randomize the drops. making for it to be a mix of the items or sometime only drop one type of item.
"slots" is used to select how many individual stacks drop.

this example says it will drop 4 stacks of items, one of the dropped has to be scrapmetal, which the stack will contain 20 items, then there is a random chance of either a component or circuitboard to drop which the circuitboard is twice as likely to drop and the component will contain 4 items in its stack if it drops.

lootTables.loot_farmbot = { slots = function() return randomStackAmount( 4, 4, 6 ) end, selectOne = { { uuid = obj_survivalobject_keycard, chance = 1 }, }, randomLoot = { { uuid = obj_consumable_component, chance = 2, quantity = randomStackAmountAvg2 }, { uuid = obj_resource_circuitboard, chance = 1, quantity = randomStackAmountAvg2 }, } }

in this fragment of code, it uses "randomStackAmount" instead of a fixed value.

in this example, the number of stacks is a minimum of 4, an average of 4, and a maximum of 6.

changing the numbers changes the number of stacks it drops and where you put it determines the minimum, average, and maximum drop chance of the stack amount.
Harvestable
The following edits will be based on this folder

C:\Program Files (x86)\Steam\steamapps\common\Scrap Mechanic\Survival\Scripts\game\harvestable

this file is for altering the drops of the "harvestable", like beehives or oil geysers

BeeHive

lootList[ i ] = { uuid = obj_resource_beewax, quantity = 5 }

find this line in the file, changing the number after the quantity will change the items contained in one stack

local slots = math.random( 2, 4 )



wherever you find the "slots" line it refers to the number of stacks it will drop

The same can be repeated in the following files:
  • BurntTree
  • CornPlant
  • SlimyClam
  • OilGeyser (doesn't have "slots", goes directly into inventory)

CottonPlant

if SurvivalGame then local harvest = { lootUid = obj_resource_cotton, lootQuantity = 5 }


"lootquantity" is how many items are in the stack when you hit the plant with a hammer

local container = player:getInventory() if sm.container.beginTransaction() then sm.container.collect( container, obj_resource_cotton, 5 ) if sm.container.endTransaction() then

in this segment lower in the file, changing the number affects the number of items you receive if you pick up the plant (pressing "E")

this is the same in the "PigmentFlower" file

HarvestCore

local RefineStaminaCost = 10 local RefineTime = 2.5

Altering the stamina cost alters how much water and food is used
Altering refine time is how much time it takes to refine by hand in seconds
Tools
The following edits will be based on this folder

C:\Program Files (x86)\Steam\steamapps\common\Scrap Mechanic\Survival\Scripts\game\tools

PotatoGatling

local Damage = 30

found in the first line in the file this sets the damage dealt by spud

this is the same in the following files:
  • PotatoShotgun
  • PotatoRifle
  • Sledgehammer