Skip to content

Creating Gametypes with the Variant Builder

Matt Saville edited this page Dec 17, 2013 · 10 revisions

Although optional, the Variant Builder is an useful tool to assist you in the creation of game variants in C# using the Nitrogen API until a suitable GUI is available.

  1. Open the Nitrogen.VariantBuilder project in Visual Studio.
  2. Create a new class for your gametype.
  3. Add the following references:
using Nitrogen.Enums;
using Nitrogen.GameVariants;
using Nitrogen.GameVariants.Base;
using Nitrogen.GameVariants.Megalo;
using Nitrogen.Metadata;
using Nitrogen.Shared;
  1. Implement the IMegaloVariant interface if you're making a Megalo-based gametype (PvP and Forge); otherwise, implement the IGameVariant interface.
  2. Add the OutputPath attribute to the class. You can remove this if you don't want the gametype to be generated.

You should get something that looks like this:

using Nitrogen.Data;
using Nitrogen.GameVariants;
using Nitrogen.GameVariants.Base;
using Nitrogen.GameVariants.Megalo;
using Nitrogen.Metadata;
using Nitrogen.Shared;
using System;

namespace Nitrogen.VariantBuilder
{
	[OutputPath("C:/Users/Matt/Desktop/my_gametype.game")]
	public sealed class MyGameType : IMegaloVariant
	{
		void IMegaloVariant.Create (GameVariant gt, MegaloData megalo)
		{
			// Do your thang here
		}
	}
}

When you execute the Variant Builder, it will go through each gametype with the OutputPath attribute creating a BLF file at the specified path.

Clone this wiki locally