Skip to content

Weapon Config (and MasterConfig.cs)

Wizard Lizard edited this page Jul 18, 2020 · 3 revisions

Main Weapon Configuration

Your weapon configuration is where everything comes together.

It starts with the stuff you shouldn't really touch:

using static WeaponThread.WeaponStructure;
using static WeaponThread.WeaponStructure.WeaponDefinition;
using static WeaponThread.WeaponStructure.WeaponDefinition.HardPointDef;
using static WeaponThread.WeaponStructure.WeaponDefinition.ModelAssignmentsDef;
using static WeaponThread.WeaponStructure.WeaponDefinition.HardPointDef.HardwareDef.ArmorState;
using static WeaponThread.WeaponStructure.WeaponDefinition.HardPointDef.Prediction;
using static WeaponThread.WeaponStructure.WeaponDefinition.TargetingDef.BlockTypes;
using static WeaponThread.WeaponStructure.WeaponDefinition.TargetingDef.Threat;

namespace WeaponThread {   
    partial class Weapons {

This simply initiates the file and tells the code where stuff is supposed to be. Don't worry too much about it.

After that is the first part of the file that you will edit, to make it unique:

        WeaponDefinition YourUniqueWeaponName => new WeaponDefinition {

YourUniqueWeaponName is, simply, a unique name for YOUR weapon. Some typical naming conventions:

  • WL_AutoCannonSmall

  • KR_SuperLaserBlaster

  • HS_MissileLauncher

Tip: name your weapon file the same as YourUniqueWeaponName, to keep things clean

Masterconfig.cs File

namespace WeaponThread
{
    partial class Weapons
    {
        internal Weapons()
        {
            // file convention: Name.cs - See Example.cs file for weapon property details.
            //
            // Enable your config files using the follow syntax, don't include the ".cs" extension:
            // ConfigFiles(Your1stConfigFile, Your2ndConfigFile, Your3rdConfigFile);

            ConfigFiles(YourUniqueWeaponName);
        }
    }
}

Very straightforward, and if you followed that tip above, you should simply haveConfigFiles(YourUniqueWeaponName) - since YourUniqueWeaponName is the definition and the file name, causing no issues.


Getting Started

With all that out of the way, you can look to the sidebar for more specific help, or pick one of the links below

Clone this wiki locally