WASTED Guide

Making a brand new weapon using built-in Modding Support for WASTED

Making a brand new weapon using built-in Modding Support

Overview

Fill in the gaps in a text file to build a weapon (or a hundred weapons) to your liking.

Introduction

This guide will walk you through (what I would consider) the easiest kind of mod to make: A new weapon. Mods in wasted work via LUA scripts (contained in .wmd files, which are just .txt files) in the Mods folder, though no LUA knowledge is actually required to make a simple mod.

The only work required for this is essentially for you to visit 4 or 5 different parts in a lengty text file, change some numbers, and then you have a brand new weapon. Not too bad at all, in my opinion.

Locating your Mods folder and Enabling the Console

First step is to Locate the Mods folder. It’s located inside at steamappscommonWastedMods. If you don’t know where your steamapps folder is located, the default is usually within
C:Program Files (x86)SteamsteamappscommonWastedmods


First thing we should do here is to open up the config.sav file using your preferred notepad. At the very beginning off the text file, create some new lines and add:

[debug] active=1

This will enable the developers console (press ~ in game) which will be handy later. Save the file and close it.

After opening up the mods folder, you should see a couple extra folders. Inside the Ignored folder are some default mods that have been provided by the developer to demonstrate how mods generally work. This, however, is not neccesary for what we’ll doing. Instead we’ll be:

Downloading the Template

The Easy weapon template is something I made that contains more information that the default examples. It’s been gradually developed over a period of time for my own use, and have used it to make several dozen weapon mods at this point. It’s available within the steam forums Mod Released subforum.

[link]

Contained within the folder are two .wmd files, one being a repository of useful information and the second is the template itself. Place both of them within a folder contained in the Wasted/Mods folder.

Next step is dealing with the template itself.

The Easy Weapon Template

Open the Easy Weapon Template.wmd file with your favorte text file reader, and behold the gigantic mess that I’ve made. If you’re using Notepad++ or an equivalent, I would highly recommend enabling LUA plugin, it makes everything much more readable.

Upon opening it, it’s entirely possible that you will be discouraged. Probably because my notes make it look far more complicated than it actually is.
But don’t worry! I promise it’s not nearly as bad as it looks, and once we understand the basics behind how it works, it’ll be easier to make a weapon that does whatever you want. Although for the sake of this guide, we’ll only be looking at the most basic parts.

Practically every line in the template has a description that says what it does, and an example that shows how you can change it. At this point if you’re comfortable with just going through the template yourself and reading the descriptions behind each command, you’ll fully welcome and completely capable of doing so, although the rest of the guide will show you the most important parts to change.

The first line we want to look at is:

local weaponmodel = “DUZI”

What this does it looks at whatever is in the “parentheses” and finds the original weapon of the same name. Capitalization is important, so never forget that!
Now fill it in with the name of the weapon you want (or keep it as “DUZI”). For my weapon, I’ll change it to be:

local weaponmodel = “El Seis”

Be wary when filling in a weapon name though. Some weapons have different “real” names than what appears in game.

If the weaponmodel provided isn’t a “real” weapon, it will display a warning that reads
“____ Is not a real weapon! Change it!” in the console (~) we enabled earlier, so be sure to keep that in mind. You can find a list of “real” weapon names (weapon object names) in “More Info.txt”.

Next step is to look at the line:

local weapon_gameobject = CreateGameObject(“my weapon object name”);

This will be the “real” name of your weapon, so change “my weapon object name” into what you want to call your weapon. Example:

local weapon_gameobject = CreateGameObject(“Super Shooter”);

At this point we can skip ahead to the 3 lines:

weapon.itemName weapon.itemFlavorText weapon.itemDescription

where we will change the in-game name and descriptions. I’ll change these three lines into:

weapon.itemName = “Super Shooter”; weapon.itemFlavorText = “Fastest gun in the west!”; weapon.itemDescription = “Ignores 1 ARMOR”;

Next we’ll go to lines:

weapon.defaultItemLevel weapon.defaultItemWeight

which effect where we’ll find the weapon in game. I feel like the weapon would suit being found around cooler level 6 and with a weight of 0.05 (slightly uncommon), so I won’t change them.

Now onto the section starting at the line:

weapon.attributeEffects

This section contains different parts that all effect how the gun works, so it is important. The ones I want to change for this gun are:

BuffAttribute.Create(“FIRE_RATE”, “0.25”), — The delay (in seconds) between shots BuffAttribute.Create(“WEAPON_SPREAD”, “5”), — The shot spread cone in degrees.

So now we have a gun that fires 4 times a second, and has a spread of 5 degrees.

Next we’ll head down to the line:

firebase.damageExpression = “[2]+1”;

This is the weapon’s actual damage. I want it to do a wide range of damage, so i’ll change it into:

firebase.damageExpression = “[4]+1”;

so now it’ll do 2-5 base damage.

Just below that is firebase.attributeEffects. I put in the weapon’s description that it ignores 1 ARMOR and this is where we can make it happen. I’ll change:

BuffAttribute.Create(“ARMOR_REDUCTION”, “1”),

Now at this point, we’re almost done! We can head off to weapon.ammo and make it consume pistol ammo if we want

weapon.ammo = GetItem(“DUZI”).ammo;

and also lower the magazine size

weapon.magazineSize = 8;

And we have our weapon! Let’s save the file, and now we can test it out in game.

Obtaining and Testing your Weapon.

The quickest way to get the weapon and test it in game is through the Developer’s Console we enabled at the beginning. Now, it’s time to boot up the game.

Once you’re in game, press the ~ button (located in the top left of your keyboard) and this will pop up


From here, type in the words SIC and hit enter. This’ll take you directly into an infinite cooler, where we can experiment without affecting your actual save data. Next, type in the console GIVE and then your weapon name. For me, it’ll be

give super shooter

And there it is!

Now we’re in game with our new weapon, and we’re free to experiment. To obtain ammo, open up the console and type give pistol ammo (or whatever kind of ammo you need)

Outro

That’s gonna be it for this guide. There’s a lot more to modding than just this guide, but this is enough to get anybody through making a weapon. If you want, you could make an entirely new kind of ammo. Or maybe a gun that makes the player run extremely quickly and reflects damage taken. Lots of things are possible, and I’m personally having a great time making mods. Look for my stupidly huge modpack, coming soon to the Mod Releases subforum. It’d be cool to see your weapon there too.

SteamSolo.com