createTable: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Text replacement - "<source" to "<syntaxhighlight") |
||
(11 intermediate revisions by 4 users not shown) | |||
Line 2: | Line 2: | ||
|name=createTable | |name=createTable | ||
|version=1.4.0.1 | |version=1.4.0.1 | ||
|trusted=true | |||
|description= | |description= | ||
Creates an empty table, specifying its access levels and optional image | Creates an empty table, specifying its access levels and optional image. | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
createTable(tableName, visible, accessible) | createTable(tableName, visible, accessible) | ||
createTable(tableName, visible, accessible, imageId) | createTable(tableName, visible, accessible, imageId) | ||
</ | </syntaxhighlight> | ||
'''Parameters''' | '''Parameters''' | ||
{{param|tableName|A string containing the name of the Table.}} | {{param|tableName|A string containing the name of the Table. '''Warning: if a table with that name already exists it will be cleared.'''}} | ||
{{param|visible|Whether or not the table can be seen by players in the Table Window, {{true}} or {{false}}.}} | {{param|visible|Whether or not the table can be seen by players in the Table Window, {{true}} or {{false}}.}} | ||
{{param|accessible|Whether or not the table can be used by players to lookup values, {{true}} or {{false}}.}} | {{param|accessible|Whether or not the table can be used by players to lookup values, {{true}} or {{false}}.}} | ||
{{param|imageId|Optional and is the asset id of an image that will be used for the table in the Table Window. If an invalid or missing asset id is used, the table will display a red "X".}} | {{param|imageId|Optional and is the asset id of an image that will be used for the table in the Table Window. If an invalid or missing asset id is used, the table will display a red "X".}} | ||
|examples= | |examples= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[r:createTable("tableX",1,1)] | [r:createTable("tableX",1,1)] | ||
[r:createTable("tableY",1,1,getTableImage("tableZ"))] | [r:createTable("tableY",1,1,getTableImage("tableZ"))] | ||
</ | </syntaxhighlight> | ||
|also= | |also= | ||
{{func|addTableEntry}} {{func|setTableRoll}} {{func|deleteTable}} | |||
}} | }} | ||
[[Category:Table Function]] | [[Category:Table Function]] |
Latest revision as of 23:59, 14 March 2023
createTable() Function
Note: This function can only be used in a Trusted Macro
• Introduced in version 1.4.0.1
Creates an empty table, specifying its access levels and optional image.
Usage
createTable(tableName, visible, accessible)
createTable(tableName, visible, accessible, imageId)
Parameters
tableName
- A string containing the name of the Table. Warning: if a table with that name already exists it will be cleared.visible
- Whether or not the table can be seen by players in the Table Window,true
(1
) orfalse
(0
).accessible
- Whether or not the table can be used by players to lookup values,true
(1
) orfalse
(0
).imageId
- Optional and is the asset id of an image that will be used for the table in the Table Window. If an invalid or missing asset id is used, the table will display a red "X".
Examples
[r:createTable("tableX",1,1)]
[r:createTable("tableY",1,1,getTableImage("tableZ"))]