Template:NpcData: Difference between revisions

LVL (talk | contribs)
Add support for get_nester_var
LVL (talk | contribs)
Extended parameters for new nested NPC data structure
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<includeonly>{{#if:{{{index|}}}
<includeonly>{{#invoke:NpcData|get_npc_var|{{{1}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}|{{{7|}}}|{{{8|}}}}}</includeonly><noinclude>
  |<!-- If index is provided, get an element from a list -->{{#invoke:NpcData|get_list_elem|{{{1}}}|{{{2}}}|{{{index}}}}}
  |<!-- Otherwise, check for dots (nested path) or fall back to single stat -->{{#if:{{#pos:{{{2}}}|.}}
      |{{#invoke:NpcData|get_nested_var|{{{1}}}|{{{2}}}|{{{3|}}}}}
      |{{#invoke:NpcData|get_npc_var|{{{1}}}|{{{2}}}|{{{3|}}}}}
  }}
}}</includeonly><noinclude>
{{Documentation}}
{{Documentation}}
</noinclude>
</noinclude>