Spawnarg

From The DarkMod Wiki
Jump to: navigation, search

A spawnarg, also known as a key/value pair or a keyval, is a property on an entity. Spawnargs determine the behaviour and characteristics of entities.

For example, here's one spawnarg:

"mass" "260"

Note: in the game editor the quote marks should not be used but they are present in the map file itself.

In this example, the name of the spawnarg (also called the "key") is "mass". The value of the spawnarg (also called simply "the value") is "260". This indicates that the mass of the entity is 260 units.

There are a couple of ways to set spawnargs.

  1. In .def files. The key/value pairs listed in a .def file indicate the default values for various spawnargs on a given class of entity. For example, the spawnarg "mass" "260" is present in the file tdm_ai_builder_forger.def within the block of spawnargs labelled entityDef atdm:ai_builder_forger, indicating that all atdm:ai_builder_forger entities (Builder forger AIs) have a mass of 260 by default.
  2. Using DarkRadiant or D3Ed. Select an entity and press E to view the Entity window. You'll be presented with a list of keys and values; these are that entity's spawnargs. If you change a spawnarg here, you change it only for that particular entity.

Mappers will usually only change spawnargs via DarkRadiant or D3Ed.

See also: