Template:DataProp/doc: Difference between revisions

From The Deadlock Wiki
Jump to navigation Jump to search
Vergir (talk | contribs)
Create documentation for Template:DataProp (with help from vergir-bot LLM)
 
Vergir (talk | contribs)
Restructure documentation: params above examples, contextual examples, add not-found case (with help from vergir-bot LLM)
Line 3: Line 3:


Powered by [[Module:GameData|Module:GameData]].
Powered by [[Module:GameData|Module:GameData]].
== Examples ==
<pre style="width:50%">
{{DataProp|Drifter|BaseHealthRegen}}
{{DataProp|Mo & Krill|BulletsPerShot}}
{{DataProp|Singularity|DPS}}
{{DataProp|Grit|BarrierDuration}}
</pre>
;Hero property (base health regen for Drifter)
: {{DataProp|Drifter|BaseHealthRegen}}
;Weapon property (bullets per shot for Mo & Krill)
: {{DataProp|Mo & Krill|BulletsPerShot}}
;Ability property (DPS for Singularity)
: {{DataProp|Singularity|DPS}}
;Item property (barrier duration for Grit)
: {{DataProp|Grit|BarrierDuration}}


Dot notation is supported for nested properties (e.g. <code>Scale.Value</code>). Tables with a <code>Value</code> field are automatically unwrapped.
Dot notation is supported for nested properties (e.g. <code>Scale.Value</code>). Tables with a <code>Value</code> field are automatically unwrapped.


== Parameters ==
<templatedata>
<templatedata>
{
{
Line 48: Line 29:
"description": "Retrieves a raw data value from abilities, heroes, or items."
"description": "Retrieves a raw data value from abilities, heroes, or items."
}
}
</templatedata><includeonly>[[Category:Data templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude>
</templatedata>
 
== Examples ==
 
=== Hero ===
<code>Drifter regenerates &#123;&#123;DataProp|Drifter|BaseHealthRegen&#125;&#125; HP each second.</code>
 
Drifter regenerates {{DataProp|Drifter|BaseHealthRegen}} HP each second.
 
=== Weapon ===
<code>Mo &amp; Krill fires &#123;&#123;DataProp|Mo & Krill|BulletsPerShot&#125;&#125; bullets per shot.</code>
 
Mo & Krill fires {{DataProp|Mo & Krill|BulletsPerShot}} bullets per shot.
 
=== Ability ===
<code>Singularity deals &#123;&#123;DataProp|Singularity|DPS&#125;&#125; damage per second.</code>
 
Singularity deals {{DataProp|Singularity|DPS}} damage per second.
 
=== Item ===
<code>Grit's barrier lasts &#123;&#123;DataProp|Grit|BarrierDuration&#125;&#125;s.</code>
 
Grit's barrier lasts {{DataProp|Grit|BarrierDuration}}s.
 
=== Not found ===
If the entity or property does not exist, the template returns an empty string.
 
<code>&#123;&#123;DataProp|Nonexistent Item|FakeProperty&#125;&#125;</code>
 
Result: "{{DataProp|Nonexistent Item|FakeProperty}}"
 
<includeonly>[[Category:Data templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude>

Revision as of 12:28, 1 June 2026

Usage

A shorthand template to retrieve raw technical values from datamined game data. Searches across abilities, heroes, and items automatically.

Powered by Module:GameData.

Dot notation is supported for nested properties (e.g. Scale.Value). Tables with a Value field are automatically unwrapped.

Parameters

Retrieves a raw data value from abilities, heroes, or items.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Entity name1

Name of the ability, hero, or item.

Example
Singularity, Drifter, Grit
Stringrequired
Property2

Property key to retrieve. Supports dot notation for nested values.

Example
DPS, BaseHealthRegen, BarrierDuration
Stringrequired

Examples

Hero

Drifter regenerates {{DataProp|Drifter|BaseHealthRegen}} HP each second.

Drifter regenerates 3.5 HP each second.

Weapon

Mo & Krill fires {{DataProp|Mo & Krill|BulletsPerShot}} bullets per shot.

Mo & Krill fires Prop not found: Mo & Krill/BulletsPerShot bullets per shot.

Ability

Singularity deals {{DataProp|Singularity|DPS}} damage per second.

Singularity deals 75 damage per second.

Item

Grit's barrier lasts {{DataProp|Grit|BarrierDuration}}s.

Grit's barrier lasts 4s.

Not found

If the entity or property does not exist, the template returns an empty string.

{{DataProp|Nonexistent Item|FakeProperty}}

Result: "Entity not found: Nonexistent Item"