Spawnarg: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
(add link to TDM online doc)
(→‎See also:: - bloodgate is a dead link and has been for ages)
 
Line 18: Line 18:
== See also: ==
== See also: ==


* [http://bloodgate.com/mirrors/tdm/pub/doc/ The TDM online documentation]
* [http://bloodgate.com/mirrors/tdm/pub/doc/ The TDM online documentation] (dead link)
* [[:Category:Spawnargs|List of all spawnargs]] (incomplete!)
* [[:Category:Spawnargs|List of all spawnargs]] (incomplete!)


{{editing}}
{{editing}}

Latest revision as of 07:56, 27 September 2023

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: