Skip to content

Editor & Script Setup

wootguy edited this page Jan 2, 2019 · 6 revisions

Add the FGD

Before you start working with these scripts, you will need to add the included FGD file to Hammer (or JackHammer, if you use that).

For either editor, go to Tools -> Options -> Game Configurations / Game Profiles and then click on the Add button.

Hammer JackHammer
hammer setup jackhammer setup

The file you need to add is "svencoop_addon/scripts/maps/weapon_custom/v5/weapon_custom.fgd"

After adding the FGD, Click OK and restart the editor. You should see 9 new entities with the prefix of "weapon_custom" in your list.

Initialize the map script

In order to use weapon_custom, you have to initialize the scripts in your own map script. To do that, create a file in the "svencoop_addon/scripts/maps/" folder named my_map_script.as and write the following into it:

#include "weapon_custom/v5/weapon_custom"

void MapInit()
{
	WeaponCustomMapInit();
}

void MapActivate()
{
	WeaponCustomMapActivate();
}

Then, in your map cfg, write in this line:

map_script my_map_script

If you already have a map script:

Say, for example, your map is already set up for another script (like func_vehicle_custom). All you need to do is merge the two files, without duplicating the MapInit() and MapActivate() functions.

This is what weapon_custom would look like merged with func_vehicle_custom:

#include "func_vehicle_custom"
#include "weapon_custom/v5/weapon_custom"

void MapInit()
{
	VehicleMapInit( true, true );
	WeaponCustomMapInit();
}

void MapActivate()
{
	WeaponCustomMapActivate();
}

When you're done with this, you're ready to make your first weapon.

Clone this wiki locally