getAllPropertyNames: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
Line 21: Line 21:
</source>
</source>


If you have two property sets, for instance "PC" and "NPC", you could print out all of the properties for the "PC" property set like so:
If you have two token property sets, for instance "PC" and "NPC", you could print out all of the properties for the "PC" property set like so:
<source lang="mtmacro" line>
<source lang="mtmacro" line>
PC Properties<br>
PC Properties<br>

Revision as of 21:40, 21 December 2008

Function getAllPropertyNames

Gets a string list containing the the token property names that are defined in the campaign properties.

Usage

[h: player = getAllPropertyNames()]
[h: player = getAllPropertyNames(type)]
[h: player = getAllPropertyNames(type, delim)]

If type is specified then the string list contains the property names for that token property type, otherwise it will contain the token property names for all token property types. If delim is specified then it is used to separate the values in the string list, if it is not specified then it defaults to ','.

Examples

You can use the following code to print out all of the properties in the campaign properties list..

Campaign Properties<br>
[h: props = getAllPropertyNames()]
[foreach(name, props, "<br>"): name]

If you have two token property sets, for instance "PC" and "NPC", you could print out all of the properties for the "PC" property set like so:

PC Properties<br>
[h: props=getAllPropertyNames("PC")]
[foreach(name, props, "<br>"): name]