Skip to main content

Creating Custom AI - entities

See Creating Custom AI - decls before proceeding

idAI2 - Reference

Reference the original idAI2 file for the vanilla AI and copy it into a separate text file. Like the the entitydef decl file, this links all the decls together in a usable format. You will need to copy all of the decl references in this entity, just like for the entitydef file.

Make sure to inherit from the added entitydef decl.

materialRemap is used to apply the custom textures to the new demon. Under renderModelInfo, a materialRemap parameter can be added (if it does not already exist). The following is an example.

renderModelInfo = {
	model = "md6def/characters/monsters/gargoyle/base/gargoyle.md6"; // base gargoyle model to use
	materialRemap = {
		num = 2;
		item[0] = {
			from = "models/monsters/gargoyle/gargoyle"; // replace existing texture
			to = "models/customization/monsters/mancubus/set12/mancubus_guns_set12"; // to this
		item[1] = {
			from = "models/monsters/gargoyle/gargoyle_body";
			to = "models/customization/monsters/mancubus/set12/mancubus_body_set12";

materialRemaps should also be done in the entityDef decl.

Notice that the set12 skin for the the Mancubus is used. See Creating Custom AI - textures for more information.

idTarget_Spawn - Reference

The idTarget_Spawn entity is used to spawn the custom AI. You will need more per custom AI that you want to spawn. Make sure to change the spawn positions for each. Always reference the idAI2 entity when spawning the custom AI, so you would not accidentally spawn the vanilla AI.


The process of getting custom AI working is a rather challenging task. You are bound to encounter some issues. Double check all of your modified decls and reference them with their vanilla counterparts. Same applies to entities. Ask yourself the following:

  • Are you spawning your AI correctly?

If not, check the idAI2 and idTarget_Spawn for typos. The encounter manager can also have syntax errors.

  • Are the textures loading consistently?

If not, check the materialRemaps or TGA files for typos. Also, check if the textures are added correctly in the assetsinfo JSON file.

  • Does your AI function as intended?

If not, check the decls for typos or mislinks. The entitydef file might be the root of your problems if there is a mislink.

Double check BOTH assetsinfo JSON files for typos. Most crashes occur from syntax errors.

See Also