Skip to content

Custom Weapons Walkthrough

cxong edited this page Nov 3, 2014 · 10 revisions

This page will walk through the process of creating a custom weapon.

Start with a campaign

Let's start with a blank campaign. This one is very basic and will simply let us try the weapon out. There are a few scattered map objects that we can blow up.

The campaign itself will be a folder, inside there are these three files:

Add guns.json and bullets.json

Custom weapons start with guns, defined in a guns.json file. Go ahead and add this, with the following contents:

{
  "Version": 1,
  "Guns": [
    {
      "Name": "My Gun",
      "Bullet": "my_bullet"
    }
  ]
}

And create a bullets.json file too, with the following contents:

{
  "Version": 1,
  "Bullets": [
    {
      "Name": "my_bullet"
    }
  ]
}

You can see what's going on here: the gun we've made will shoot the bullet we've made, by referring to it by the same name. The bullet name doesn't show up anywhere else so it doesn't really matter what we name it, as long as it's unique.

If you open the campaign up in the editor, you should see that this gun already shows up in the "Available weapons" section:

At this point we can actually load this campaign up in game, and try out our new weapon...

... and it does nothing except make a lot of noise. We need to fill out those gun and bullet attributes now.