Template:DataProp/doc: Difference between revisions

From The Deadlock Wiki
Jump to navigation Jump to search
Vergir (talk | contribs)
Update not-found example to show error message (with help from vergir-bot LLM)
Document the optional Street Brawl variant parameter (with help from vergir-bot LLM)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Usage ==
== Usage ==
A shorthand template to retrieve raw technical values from datamined game data. Searches across abilities, heroes, and items automatically.
A shorthand template to retrieve raw technical values from datamined game data. Searches across abilities, heroes, and items automatically, and can also look up [[Console commands|console variables]] (convars) on request.


Powered by [[Module:GameData|Module:GameData]].
Powered by [[Module:GameData|Module:GameData]].


For nested properties use dot notation e.g. <code>LevelScaling.TechPower</code>. It also automatically unwraps things like <code>DPS.Value</code>.
Dot notation is supported for nested properties (e.g. <code>Scale.Value</code>). Tables with a <code>Value</code> field are automatically unwrapped.
 
An optional third parameter selects a game mode variant. Passing <code>Street Brawl</code> returns the value as changed for [[Street Brawl]]; properties that Street Brawl leaves alone fall back to the base value, so the parameter is safe to use on any property. Only abilities are affected.


== Parameters ==
== Parameters ==
Line 12: Line 14:
"1": {
"1": {
"label": "Entity name",
"label": "Entity name",
"description": "Name of the ability, hero, or item.",
"description": "Name of the ability, hero, or item. Pass the literal value Convar to look up a console variable instead.",
"type": "string",
"type": "string",
"required": true,
"required": true,
"example": "Singularity, Drifter, Grit"
"example": "Singularity, Drifter, Grit, Convar"
},
},
"2": {
"2": {
"label": "Property",
"label": "Property",
"description": "Property key to retrieve. Supports dot notation for nested values.",
"description": "Property key to retrieve. Supports dot notation for nested values. When the first parameter is Convar, this is the console variable name instead.",
"type": "string",
"type": "string",
"required": true,
"required": true,
"example": "DPS, BaseHealthRegen, BarrierDuration"
"example": "DPS, BaseHealthRegen, citadel_camera_fov"
},
"3": {
"label": "Variant",
"description": "Optional game mode variant. Accepts Street Brawl, ignoring case and spacing, and returns the value changed for Street Brawl. Properties that Street Brawl does not change fall back to the base value. Applies to abilities only.",
"type": "string",
"required": false,
"example": "Street Brawl"
}
}
},
},
"format": "inline",
"format": "inline",
"paramOrder": ["1", "2"],
"paramOrder": ["1", "2", "3"],
"description": "Retrieves a raw data value from abilities, heroes, or items."
"description": "Retrieves a raw data value from abilities, heroes, items, or console variables."
}
}
</templatedata>
</templatedata>
Line 34: Line 43:


=== Hero ===
=== Hero ===
<code>Drifter regenerates &#123;&#123;DataProp|Drifter|BaseHealthRegen&#125;&#125;HP each second.</code>
<code>Drifter regenerates &#123;&#123;DataProp|Drifter|BaseHealthRegen&#125;&#125; HP each second.</code>
 
Drifter regenerates {{DataProp|Drifter|BaseHealthRegen}}HP each second.


=== Not found ===
Drifter regenerates {{DataProp|Drifter|BaseHealthRegen}} HP each second.
If the entity or property does not exist, the template returns a visible error message.


<code>&#123;&#123;DataProp|Nonexistent Item|FakeProperty&#125;&#125;</code>
=== Weapon ===
<code>Mo &amp; Krill fires &#123;&#123;DataProp|Mo & Krill|Weapon.BulletsPerShot&#125;&#125; bullets per shot.</code>


{{DataProp|Nonexistent Item|FakeProperty}}
Mo & Krill fires {{DataProp|Mo & Krill|Weapon.BulletsPerShot}} bullets per shot.
 
<includeonly>[[Category:Data templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude>


=== Ability ===
=== Ability ===
Line 57: Line 62:
Grit's barrier lasts {{DataProp|Grit|BarrierDuration}}s.
Grit's barrier lasts {{DataProp|Grit|BarrierDuration}}s.


=== Not found ===
=== Convar ===
If the entity or property does not exist, the template returns an empty string.
<code>The default camera field of view is &#123;&#123;DataProp|Convar|citadel_camera_fov&#125;&#125;.</code>
 
The default camera field of view is {{DataProp|Convar|citadel_camera_fov}}.
 
=== Street Brawl ===
<code>Essence Bomb has a radius of &#123;&#123;DataProp|Essence Bomb|Radius&#125;&#125;m, or &#123;&#123;DataProp|Essence Bomb|Radius|Street Brawl&#125;&#125;m in Street Brawl.</code>
 
Essence Bomb has a radius of {{DataProp|Essence Bomb|Radius}}m, or {{DataProp|Essence Bomb|Radius|Street Brawl}}m in Street Brawl.
 
Street Brawl does not change Essence Bomb's damage, so the base value is returned:
 
<code>&#123;&#123;DataProp|Essence Bomb|Damage|Street Brawl&#125;&#125;</code>
 
{{DataProp|Essence Bomb|Damage|Street Brawl}}
 
=== Errors ===
If the entity does not exist:
 
<code>&#123;&#123;DataProp|Nonexistent Thing|Whatever&#125;&#125;</code>
 
{{DataProp|Nonexistent Thing|Whatever}}
 
If the entity exists but the property does not:
 
<code>&#123;&#123;DataProp|Abrams|FakeProp&#125;&#125;</code>
 
{{DataProp|Abrams|FakeProp}}
 
If the convar does not exist:
 
<code>&#123;&#123;DataProp|Convar|fake_convar&#125;&#125;</code>
 
{{DataProp|Convar|fake_convar}}
 
If the variant is not recognised:


<code>&#123;&#123;DataProp|Nonexistent Item|FakeProperty&#125;&#125;</code>
<code>&#123;&#123;DataProp|Essence Bomb|Radius|Deathmatch&#125;&#125;</code>


Result: "{{DataProp|Nonexistent Item|FakeProperty}}"
{{DataProp|Essence Bomb|Radius|Deathmatch}}


<includeonly>[[Category:Data templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude>
<includeonly>[[Category:Data templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude>

Latest revision as of 14:39, 28 July 2026

A shorthand template to retrieve raw technical values from datamined game data. Searches across abilities, heroes, and items automatically, and can also look up console variables (convars) on request.

Powered by Module:GameData.

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

An optional third parameter selects a game mode variant. Passing Street Brawl returns the value as changed for Street Brawl; properties that Street Brawl leaves alone fall back to the base value, so the parameter is safe to use on any property. Only abilities are affected.

Parameters

[edit source]

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

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Entity name1

Name of the ability, hero, or item. Pass the literal value Convar to look up a console variable instead.

Example
Singularity, Drifter, Grit, Convar
Stringrequired
Property2

Property key to retrieve. Supports dot notation for nested values. When the first parameter is Convar, this is the console variable name instead.

Example
DPS, BaseHealthRegen, citadel_camera_fov
Stringrequired
Variant3

Optional game mode variant. Accepts Street Brawl, ignoring case and spacing, and returns the value changed for Street Brawl. Properties that Street Brawl does not change fall back to the base value. Applies to abilities only.

Example
Street Brawl
Stringoptional

Examples

[edit source]

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

Drifter regenerates 3.5 HP each second.

Weapon

[edit source]

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

Mo & Krill fires 4 bullets per shot.

Ability

[edit source]

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

Singularity deals 75 damage per second.

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

Grit's barrier lasts 4s.

Convar

[edit source]

The default camera field of view is {{DataProp|Convar|citadel_camera_fov}}.

The default camera field of view is 75.

Street Brawl

[edit source]

Essence Bomb has a radius of {{DataProp|Essence Bomb|Radius}}m, or {{DataProp|Essence Bomb|Radius|Street Brawl}}m in Street Brawl.

Essence Bomb has a radius of 7m, or 6m in Street Brawl.

Street Brawl does not change Essence Bomb's damage, so the base value is returned:

{{DataProp|Essence Bomb|Damage|Street Brawl}}

90

Errors

[edit source]

If the entity does not exist:

{{DataProp|Nonexistent Thing|Whatever}}

Entity not found: Nonexistent Thing

If the entity exists but the property does not:

{{DataProp|Abrams|FakeProp}}

Prop not found: Abrams/FakeProp

If the convar does not exist:

{{DataProp|Convar|fake_convar}}

Convar not found: fake_convar

If the variant is not recognised:

{{DataProp|Essence Bomb|Radius|Deathmatch}}

Unknown variant: Deathmatch