getPropertyNamesRaw: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Fixing wikilink)
m (Adding to Property Function category)
Line 29: Line 29:
===Notes===
===Notes===
When token properties are created during campaign, they are persistent in the MapTool campaign, regardless of whether they are editable in the ''Edit Token'' window. In other words, even though a property is removed from the campaign properties, it remains available in the MapTool code. [[getPropertyNamesRaw|getPropertyNamesRaw()]] will return ''all'' token properties that exist or have ever existed in the particular campaign, even if users cannot directly edit those properties (''i.e.'', they do not appear in the token's properties when you double click on a token). To get only properties that are currently visible and editable, use [[getAllPropertyNames|getAllPropertyNames()]].
When token properties are created during campaign, they are persistent in the MapTool campaign, regardless of whether they are editable in the ''Edit Token'' window. In other words, even though a property is removed from the campaign properties, it remains available in the MapTool code. [[getPropertyNamesRaw|getPropertyNamesRaw()]] will return ''all'' token properties that exist or have ever existed in the particular campaign, even if users cannot directly edit those properties (''i.e.'', they do not appear in the token's properties when you double click on a token). To get only properties that are currently visible and editable, use [[getAllPropertyNames|getAllPropertyNames()]].
[[Category:Token Function]]
[[Category:Token Function]][[Category:Property Function]]

Revision as of 19:00, 20 November 2012

getPropertyNamesRaw() Function

Introduced in version 1.3b64
Returns a String List or JSON Array containing the names of the Token Properties on a Token. The type of the value returned depends on the delimiter parameter. The difference between this function and getPropertyNames() is that getPropertyNames() returns all the property names in lower case (see this forum thread to get the reason why it was created).

Usage

getPropertyNamesRaw()
getPropertyNamesRaw(delim)
getPropertyNamesRaw(delim, id)

Parameters

  • delim - The delimiter used to separate the values in the String List, defaults to ",". Returns a JSON Array if set to "json".
  • id - The token id of the token which has its property names returned, defaults to the Current Token.

     Note: This parameter can only be used in a Trusted Macro

Example

To display the names of all of the properties on the current token use.
[h: names = getPropertyNamesRaw()]
[foreach(name, names, "<br>"): name]


Version Changes

None.

Notes

When token properties are created during campaign, they are persistent in the MapTool campaign, regardless of whether they are editable in the Edit Token window. In other words, even though a property is removed from the campaign properties, it remains available in the MapTool code. getPropertyNamesRaw() will return all token properties that exist or have ever existed in the particular campaign, even if users cannot directly edit those properties (i.e., they do not appear in the token's properties when you double click on a token). To get only properties that are currently visible and editable, use getAllPropertyNames().