Skip to content

For developers

Nikita S edited this page Mar 3, 2023 · 5 revisions

For developers

This page describes how to create compatibilities for certain mods.


Compat creation most of the time involves editing and reading the game config. To make the job easier it is recommended to use the Advanced Developer Tools mod (you can get it on Steam Workshop)

GreenMag

Magazines compat

To make magazines compatible all you have to do is to add those variables to the magazines config:

  • greenmag_ammo (STRING) - the classname of the ammo or a belt; used in complex simulation mode
  • greenmag_basicammo (STRING) - same as greenmag_ammo but for basic simulation mode
  • greenmag_canSpeedLoad (0, 1) - does the user get the speedlaoder bonuses when loading this magazine
  • greenmag_needBelt (0, 1) - does the magazine use belts (1) or bullets (0) for loading/unloading

The greenmag_ammo and greenmag_basicammo can have the same value.

Example 1:

class rhs_30Rnd_545x39_7N6_AK : rhs_30Rnd_545x39_AK {
	greenmag_ammo = "CVO_greenmag_ammo_545x39_FMJ_1Rnd";
	greenmag_basicammo = "greenmag_ammo_545x39_basic_1Rnd";

	greenmag_canSpeedload = 1;
	greenmag_needBelt = 0;
};

This will make the magazine use the CVO_greenmag_ammo_545x39_FMJ_1Rnd ammo in complex simulation mode, greenmag_ammo_545x39_basic_1Rnd ammo in basic simulation mode, able to use the speed loader and use regular ammo instead of belts.

Example 2:

class rhs_100Rnd_762x54mmR : rhs_30Rnd_545x39_7N6_AK {
	greenmag_ammo = "CVO_greenmag_beltlinked_762x54_FMJ";
	greenmag_basicammo = "greenmag_beltlinked_762x54_basic";

	greenmag_canSpeedload = 0;
	greenmag_needBelt = 1;
};

This will make the magazine require a belt to be loaded. Be aware that you don't need to include the number post-fix in the belt classname, e.g. you don't need to write greenmag_beltlinked_762x54_basic_1 or greenmag_beltlinked_762x54_basic_N but just greenmag_beltlinked_762x54_basic instead.

Clone this wiki locally