Skip to main content

Attaching Static Models to Animated Models

Hiding Animated Models:

Find material2 decls for what parts of a model to hide. Replace everything in the decl with the following.

{
	inherit = "template/editor/worldeditor";
	edit = {
		Parms = {
			texturemap = {
				filePath = "art/tile/common/nodraw.tga";
				options = {
					type = "TT_2D";
					filter = "TF_DEFAULT";
					repeat = "TR_REPEAT";
					format = "FMT_RGBA8";
					atlasPadding = 0;
					fullScaleBias = false;
					noMips = false;
					fftBloom = false;
				}
			}
		}
		EditorData = {
			editorImagePath = "art/tile/common/nodraw.tga";
		}
	}
}

This decl can be found in various .resources files at art/tile/common/nodraw.decl. It makes the textures assigned to it unable to see in game.

Attaching Static Models:

It is important to make sure your custom model replaces an existing model that doesn't interfere with gameplay and hasn't been used in a different mod before. Using various mods together that replace the same model for different uses can cause several problems.

When publishing a mod that replaces a static model, you should indicate which static model you replaced. This can help diagnose or avoid compatibility issues with other mods.

Find the FX decl used for the certain model. An easy way to find most of them is to check the fxDecl parameter in most entitydef decls.

In the FX decl, add a new item that uses this example as a base:

			item[11] = { // Change the item number when needed
				name = "assault_rifle";
				group = "fire";
				type = "FX_MODEL";
				looping = true;
				originType = "FX_ORG_TRACK_POS";
				rotationType = "FX_ROT_TRACK_AXIS";
				modelParms = {
					staticModel = "art/kit/hub/prop/pizzabox.lwo"; // The model that will be replaced. When changing the filepath, make sure to add any extra parameters in the .lwo extension if necessary
				}
			}

After adding the new item to the FX decl go to the top of the decl and change "num = <number of items>;" by how many items you added.

Optional Parameters:

  • size - Changes the size of the model.

size = 0.165000007;

  • offset - Changes where the model is located.
offset = {
	x = 0;                
	y = 0;
	z = 0;
}
  • rotOffsetAngles - Rotates the model.
rotOffsetAngles = {
	yaw = 0;
	pitch = 0;
	roll = 0;
}
  • tagNames - Moves the model to a specific body part. Most tags can be found in the FX decl.
tagNames = {
	num = 1;
	item[0] = "muzzle";
}
  • startCondition and stopCondition - Changes the condition of when the model shows and stops. A full list of conditions can be found in the FX CONDITIONALS page.
startCondition = {
	num = 1;
	item[0] = "FX_WEAPON_BEGIN_RAISE";
}
stopCondition = {
	num = 2;
	item[0] = "FX_WEAPON_BEGIN_LOWER";
	item[1] = "FX_WEAPON_BEGIN_RAISE";
}