Skip to content

Adding Custom Aliases In Your Mod

Skye edited this page Sep 23, 2022 · 16 revisions

ESE Contains a class of aliases for easy references to resource names, constants, etc. You can add your own aliases to ESE in your own mod using the following steps.

Checking ESE Is Installed

To make sure your mod will work with or without ESE being installed and doesn't cause any errors, it's important to put everything to do with it in an '#ifdef' statement like the following:

#ifdef ESE_INSTALLED
// Your ESE additions here...
#endif

With this, you can ensure that none of your ESE code will get compiled if it isn't installed, and no errors should occur. (Except one potential scenario, see the known issues here.

Adding The Aliases

To add your own aliases straight into ESE, you need to modify the ESE_Aliases class and ensure the alias is added under the right category. The different categories and standard (suggested) naming schemes are:

Define⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ Naming Scheme
ESE_ALIASES_MATERIALS MAT_MATERIALNAME
ESE_ALIASES_WEAPONS WEP_WEAPONNAME_VARIANT
ESE_ALIASES_ATTACHMENTS Use OPTIC_, UGL_, HGUARD_ or what makes the most sense and is short, not set in stone
ESE_ALIASES_MAGAZINES MAG_MAGAZINENAME_TYPE
ESE_ALIASES_VEHICLES MAG_VEHICLENAME_VARIANT
ESE_ALIASES_MATH MATH_CONSTANTNAME

As an example I'm going to add an alias for a custom M16A3 weapon resource from my wasteland mod, using ESE_ALIASES_WEAPONS.

#ifdef ESE_INSTALLED
modded class ESE_Aliases
{
    #ifdef ESE_ALIASES_WEAPONS
    static const ResourceName WEP_M16A3 = "{9C38B35C2CC96D4B}Prefabs/Weapons/Rifles/M16/Rifle_M16A3.et";
    #endif
}
#endif

If your aliases aren't showing up when you try to access them, make sure that you have duplicated ESE_Config.c as !ESE_Config.c and enabled #define ESE_ALIASES_ALL or whatever specific category your entry comes under.

Clone this wiki locally