Template:WeaponInfo

From Dirty Bomb Wiki
Jump to: navigation, search
Template-info.png Documentation

This template performs a number of functions:

  • It draws information about a weapon from a data page if it finds one for the weapon. It can also draw information directly from its parameters like a typical template.
  • It displays the top portion of a weapon page using that information by calling {{WeaponInfo/layout}}. Note that the visual and layout code is in that template with the exception of the multiple data page warning.
  • It sets properties and categories, which can be used to create automated lists.

Finding the data page[edit source]

The template finds a data page for an weapon in one of four ways:

{{WeaponInfo}}

When the nickname, datapage, and testdatapage parameters are not given values, the template looks for a data page in Category:Imported weapon data where Property:Has name is the same as the name of the page the template is being used on.

{{WeaponInfo
  |name=weapon name
}}

When the name parameter is given a value but datapage is not, the template looks for a data page in Category:Imported weapon data where Property:Has name has that value.

{{WeaponInfo
  |datapage=data subpage name
}}

When datapage is given a value, the template looks for that page, but will return it only if the page is in Category:Imported weapon data. When using this, specify only the subpage name of the data page. For example, for "Data:Weapons/EXAMPLE", just specify "EXAMPLE".

Note that an item data page should be set up with {{WeaponData}}, and the name parameter on that template sets the value of Property:Has name. If the nickname parameter doesn't get a value, Property:Has name is set to the subpage name.

{{WeaponInfo
  |testdatapage=full data page name
}}

testdatapage works the same as datapage except that it requires the full name of the data page, including the namespace. This is useful for testing data pages set up in a user namespace.

Other values[edit source]

Some information is not available from the imported data and must be supplied to the template separately, as shown below:

{{WeaponInfo
  |type=type of weapon
  |ingame=yes or no
  |available=yes or no
}}

Setting ingame to no flags that a unit is not available in the game, even though it is in the game data. Setting available to no indicates that the unit is not available to players even if it is in the game, such as something only available to gamemasters or other staff.

This can be used with any of the other parameters.

When there is no data page[edit source]

If an weapon doesn't have a data page for some reason, you can treat this as a normal template and supply the values yourself.

{{WeaponInfo
  |name=The name of the weapon
  |portrait=Filename of the portrait image, without the "File:" namespace prefix
  |equip_time=time to equip the item
  |putdown_time=time to put down the time
  |ability=weapon's ability
  |silent=yes or no
  |fire_interval=weapon's firing interval
  |fuse=fuse time
  |projectile_damage=damage of projectile
  |projectile_damage_radius=damage radius of projectile
  |projectile_lifetime=time projectile remains "alive"
  |projectile_can_pick_up=yes or no
  |hit_snare_mul=movement multiplier of snare effect
  |hit_snare_time=duration of snare effect
  |projectile_damage_inner_radius=inner damage radius of projectile
  |projectile_health=health of projectile
  |projectile_smoke_fadein_time=time for smoke effect to fade in
  |projectile_smoke_fadeout_time=time for smoke effect to fade out
  |equip_snare_mul=movement multiplier when equipped
  |deploy_time=time required to deploy
  |max_deployed=maximum amount deployed
  |projectile_healing=healing from projectile
  |projectile_healing_medic=healing from projectile by medics
  |projectile_healing_direct_hit=healing from projectile on direct hit
  |projectile_mine_arm_time=arming time of mine projectiles
  |projectile_mine_detection_radius=detection radius of mine projectiles
  |max_range=maximum range
  |min_range=minimum range
  |max_damage=maximum damage
  |min_damage=minimum damage
  |damage_type=damage type
  |muzzle_count=muzzle count
  |charge_time=time to charge
  |charge_rate=rate of charging
  |can_revive=yes or no
  |burst_count=shots per burst
  |burst_interval=time between burst shots
  |min_revive_health=minimum revive health
  |max_revive_health=maximum revive health
}}

Note that if a data page for the weapon is imported later, the values of these parameters will be ignored.

Overriding data page values[edit source]

If necessary, it is possible to override the values pulled from the data page. When data is simply outdated, it's probably better to just change it on the data page itself, as it would probably have been corrected in the next data import anyway. But if for some reason imports seem to be consistently bringing in incorrect data, you can override it by using the force parameters:

{{WeaponInfo
  |force_name=The nickname of the weapon
  |force_portrait=Filename of the portrait image, without the "File:" namespace prefix
  |force_equip_time=time to equip the item
  |force_putdown_time=time to put down the time
  |force_ability=weapon's ability
  |force_silent=yes or no
  |force_fire_interval=weapon's firing interval
  |force_fuse=fuse time
  |force_projectile_damage=damage of projectile
  |force_projectile_damage_radius=damage radius of projectile
  |force_projectile_lifetime=time projectile remains "alive"
  |force_projectile_can_pick_up=yes or no
  |force_hit_snare_mul=movement multiplier of snare effect
  |force_hit_snare_time=duration of snare effect
  |force_projectile_damage_inner_radius=inner damage radius of projectile
  |force_projectile_health=health of projectile
  |force_projectile_smoke_fadein_time=time for smoke effect to fade in
  |force_projectile_smoke_fadeout_time=time for smoke effect to fade out
  |force_equip_snare_mul=movement multiplier when equipped
  |force_deploy_time=time required to deploy
  |force_max_deployed=maximum amount deployed
  |force_projectile_healing=healing from projectile
  |force_projectile_healing_medic=healing from projectile by medics
  |force_projectile_healing_direct_hit=healing from projectile on direct hit
  |force_projectile_mine_arm_time=arming time of mine projectiles
  |force_projectile_mine_detection_radius=detection radius of mine projectiles
  |force_max_range=maximum range
  |force_min_range=minimum range
  |force_max_damage=maximum damage
  |force_min_damage=minimum damage
  |force_damage_type=damage type
  |force_muzzle_count=muzzle count
  |force_charge_time=time to charge
  |force_charge_rate=rate of charging
  |force_can_revive=yes or no
  |force_burst_count=shots per burst
  |force_burst_interval=time between burst shots
  |force_min_revive_health=minimum revive health
  |force_max_revive_health=maximum revive health
}}