Atdm:campaign info

From The DarkMod Wiki
Jump to navigationJump to search

The campaign info entity can be placed once in a mission to control the amount of inventory items and weapons that are carried over to the next mission in a campaign. It's possible to define more than one rule on such an entity, see below for a description of the spawnarg and their syntax.

Syntax

While weapons and "regular" items such as the lantern, keys or health potions are all located in the player's inventory, there are two different sets of spawnargs for defining the carry-over rules after Mission Complete.

For both types of spawnargs it's possible to define a "general" rule (which is applied to all difficulty levels) and optionally a difficulty-specific rule. If provided, the difficulty-specific rule will always override the general one. The difficulty-specific spawnargs have the same syntax as the general ones except for the diff_N prefix (with N being the difficulty level ranging from 0 to 2 - "Easy" is 0).

Note: when adding an atdm:campaign_info entity to your map, it will inherit a set of default spawnargs from the entityDef. These default values don't apply any limits to the player's inventory they're just there for easy reference when ticking the "Show inherited" checkbox in DarkRadiant's Entity Inspector, to save you some typing.

Weapon Limits

The general syntax is lie this:

"weapon_limit_WEAPONNAME" "X"

with WEAPONNAME being a placeholder for the actual weapon names. The weapon name is a unique identifier found on the weapon items and their ammo. The value "X" is an integer number defining the maximum amount of ammo that is allowed to be carried over to the next mission (for ammo-based weapons like the Water Arrow). For melee weapons without ammo (Shortsword, Blackjack) values greater than "1" won't make any difference and will be treated like a "1" (which is equivalent to "will be kept").

The "weapon_limit_X" spawnarg affects all difficulty levels, but it's possible to override that one by adding spawnargs with a "diff_N_" prefix, e.g. "diff_0_weapon_limit_waterarrow" which will trump the "weapon_limit_waterarrow" without prefix. (The "diff_0" prefix applies to Easy difficulty.)

A limit value of "-1" always means "no limit", e.g. there is no carry-over limit applied to this weapon.

Working examples for a few weapon limits are:

"weapon_limit_gasarrow"                        "1"	// Max. 1 gas arrow on all difficulties
"diff_0_weapon_limit_blackjack"                "0"	// "0" means: no blackjack on easy
"diff_0_weapon_limit_sword"                    "1"	// "1" means: the sword will be kept ("-1" works as well) on easy
"diff_0_weapon_limit_waterarrow"               "20"	// keep no more than 20 water arrows on easy
"diff_0_weapon_limit_firearrow"                "-1"	// "-1" means: no limit on easy

For quick reference, possible weapon IDs for vanilla TDM are (you can look them up in the tdm_weapon_....def files in the tdm_defs01.pk4):

shortsword
blackjack
broadhead
waterarrow
firearrow
ropearrow
gasarrow
mossarrow
noisemaker
unarmed (for completeness' sake)

Note: while "unarmed" is a valid weaponname it's not necessary or recommended to apply a limit to that one. I doubt that any desired effect could be achieved by applying any rules to this type.

Inventory Item Limits

TODO