Year of the Dragon: Through April 23rd, claim the adventure pack Slice of Life for free! Speak to Xatheral in the Hall of Heroes.

Game mechanicsNewbie guideIn developmentDDO StoreSocial Media


ChallengesClassesCollectablesCraftingEnhancementsEpic DestiniesFavorFeats

GlossaryItemsMapsMonstersPlacesQuestsRacesReincarnationSkillsSpells


Please create an account or log in to build a reputation and unlock more editing privileges, and then visit DDO wiki's IRC Chat/Discord if you need any help!

User:Faltout/SandBox/Parameters to variables

From DDO wiki
Jump to navigation Jump to search

Usage[edit]

This template converts its parameters to variables. This is useful only when you don't provide the parameters manually but instead they are generated from a DPL call.

{{Parameters to variables
 | prefix = x
 ... <!-- parameters with a x prefix -->
}}
  • prefix indicates that only the parameters starting with this prefix should be converted. The prefix should not be a prefix of the word "prefix". Default prefix is "x".

Output: The output of this template is

  1. A variable {{#var: num<prefix>}} containing the number of variables converted. This is useful for performing loops on the variables.
  2. A set of variables {{#var: <prefix><number>}} where <prefix> is the prefix given to the template and <number> is an ascending number starting from 1 and ending at {{#var: num<prefix>}}. This allows you to use a loop and access all the variables. The value of the variables is the value of the parameters given.

Example[edit]

{{#dpl:
 | category = Patron factions
 | include = -
 | listseparators = {{Parameters to variables {{!}}prefix = x,{{!}}x%NR%=%PAGE%,,}}
}}

The above will result in a bunch of variables containing the names of the patron factions. With a simple loop, we could list them.

{{#loop: num
 | 1
 | {{#var: numx}}
 |<nowiki/>
# {{#var: x{{#var: num}} }}
}}

  1. House Deneith
  2. Agents of Argonnessen
  3. House Jorasco
  4. House Kundarak
  5. House Phiarlan
  6. Purple Dragon Knights
  7. The Coin Lords
  8. The Free Agents
  9. The Silver Flame
  10. The Twelve
  11. The Yugoloth
  12. Keepers of the Feather
  13. Sharn City Council
  14. House Cannith
  15. The Gatekeepers
  16. The Harpers
  17. Morgrave University
  18. The Summer Court

CODE[edit]