Skip to main content

Creating Custom AI - decls

This is an ADVANCED GUIDE. You are expected to have a decent understanding of decls, textures, and entities.

See the Following Books Before Proceeding

Basics

For starters, do all of your editing on an existing AI, so you know what the results will look like before you spend a large sum of time managing an entirely new AI variant.

For your custom AI, you want to copy all the decl files that will be changed. The entityDef file is the most important and mandatory for almost all custom AI. Paste the vanilla decls into a resource patch with a very high priority. Patch priority changes between each update, so you will most likely need to change it after each update. As of Update 6.66 rev 1.1, it is recommended to use e6m1_cult_horde_patch1, e6m2_earth_horde_patch1, orĀ e6m3_mcity_horde_patch1.

Be sure to rename the decls too, so they do not replace properties of the vanilla AI.

After making changes to the decls, you will need to link them to the other modified decls if necessary. Make sure to do so for all of the modified decls. For example, to link the demon's FX, go to the entityDef file and change:
fxDecl = "character/gargoyle/gargoyle";
to
fxDecl = "character/stonegargoyle/stonegargoyle";

The stonegargoyle FX decl is a modification to the vanilla gargoyle decl.

For every added asset, you will need to add them to the EternalMod\assetsinfo JSON file. This must be done in BOTH the directory that contains all the added decls AND the level patch that holds your entities file(s). Here is an example:

e6m3_mcity_horde_patch1\EternalMod\assetsinfo\e6m3_mcity_horde.json

{
    "assets":
    [
        {
            "name":"ai/fodder/stonegargoyle",
            "mapResourceType":"entitydef"
        },
        {
            "name":"character/stonegargoyle/stonegargoyle",
            "mapResourceType":"fx"
        },
        {
            "name":"samplePath",
            "mapResourceType":"sampleResource"
        }
    ]
}

e5m2_earth_patch2\EternalMod\assetsinfo\e5m2_earth.json

{
    "resources":
    [
        {
            "name":"e6m3_mcity_horde_patch1.resources"
        }
    ],
    "assets":
    [
        {
            "name":"ai/fodder/stonegargoyle",
            "mapResourceType":"entitydef"
        },
        {
            "name":"character/stonegargoyle/stonegargoyle",
            "mapResourceType":"fx"
        },
        {
            "name":"samplePath",
            "mapResourceType":"sampleResource"
        }
    ]
}

samplePath & sampleResource are not actual assets.

In this example, the added assets are in e6m3_mcity_horde_patch1 because that resource patch has a very high priority and a low resource amount. The Stone Gargoyle custom AI will be loaded into the highest Reclaimed Earth patch (e5m2_earth_patch2).

When you are adding a new decl that is a variation of an existing file, if possible, always make it inherit from the vanilla demon counter part. This is especially important for the entityDef and md6def. A lot of The Ancient Gods Part 2 and Spectre demons do this, so use them as reference.

Some decls, such as FX, cannot be inherited.