Welcome to my guide on tweaking the spudgun!
Here you will learn to modify the spudgun to do all sorts of useful(and wacky) things!
Basic information to get out of the way
- This guide explains how to change scripts in the game files.
- This may or may not affect multiplayer. Crashes and/or items not functioning properly is not my responsibility.
- You can always revert back to the default game files using “verify integrity of game files”.
- It is helpful if you have basic code reading and formatting skills.
Acessing Spudgun Scripts
This section is for editing existing spudguns.
So you want to make your own spudgun?
The very first thing you need to do is go to:
- C:\Program Files (x86)\Steam\steamapps\common\Scrap Mechanic\Survival\Scripts\game\tools
In that folder, you will find three .lua files: PotatoGatling, PotatoRifle, and PotatoShotgun. You can just open these with notepad.
If you would like to make your spudgun a seperate item, simply make a copy.
Great! Now that we know how to access the scripts, lets move on to editing them.
Modifying Spudgun Scripts
Ok. Now that we can open the scripts, we can now get to editing them.
You can do a lot of things inside the .lua file, including the following:
- Changing what textures to use.
- Changing what animations to use.
- Changing which modules to use(currently only barrels).
- Changing what projectile to use.
- Changing stats such as fire rate, damage, projectile range/velocity and accuracy.
As for actually editing the file, it is pretty straightforward.
Textures and animations are mostly located at the top of the file(except for a few). Damage can be found on line 5 under the name “local damage”.
Stats can be found starting at line 97 with self.normalFireMode and self.aimFireMode
- fireCooldown= Fire rate
- spreadCooldown=I have no idea
- spreadIncrement=Accuracy/spread, measured by angle
- spreadMinAngle=Minimum spread angle for accuracy
- spreadMaxAngle=Maximum spread angle for accuracy
- fireVelocity=Speed at which projectile is fired, indirectly affects bullet drop and range
Projectile can be found on line 574, and the following can be used (remember to lowercase):
- loot (particle effect only)
- epicloot (particle effect only)
Each projectile automatically takes the appropriate item out of your inventory except tape, explosivetape, pesticide, and loot.
Adding Custom Textures
Now that we have our fancy new spudgun, now I will teach you how to apply your own textures to your new spudgun.
Making a texture
To create a custom texture, head over to:
- C:\Program Files (x86)\Steam\steamapps\common\Scrap Mechanic\Data\Character\Char_Tools\Char_spudgun
There you can access the textures of every module of the spudgun. I would recommend recoloring the barrel for starters. If you want to recolor a texture, make sure you are editing the “dif” texture, and not “asg” or “nor”.
For more advanced users, you can model your own module, however I cannot teach you how to do that because I have no idea.