Script:Object Properties
From Roll20 Wiki
Version: 0.1
Last Modified: 2015-06-11
Code: ObjectProperties
Dependencies: None
Conflicts: None
ObjectProperties allows the user to get and set properties of specified objects. This provides quick access to token IDs, image URLs, etc., as well as the ability to set token bar values, move tokens, and various other tricks which would otherwise require (very small) specialized scripts.
It is recommended that this script be used in conjunction with the CommandShell module, which will improve output formatting and command discovery.
Syntax
!getprop [options] [properties]
!setprop [options] <property-value pairs>
Formally:
S
→ getpropoptions
properties
S
→ pagesizeoptions
property-value pairs
options
→option
options
options
→ ε
option
→ -string
option
→ --string
option
→ -string string
option
→ --string string
properties
→properties
string
properties
→ ε
property-value pairs
property-value pairs
property-value pairs
property-value pairs
string string
Parameter | Values |
---|---|
options | The !pagesize command accepts the following options:
|
Examples
- !getprop
- Will display all properties of each selected object.
- !getprop -t graphic -i -Jp3illTx5IjO2NMoxEC name
- Will display the name of the specified graphic object (token).
- !getprop -n Fighter _id _type
- Will display the ID and type of all objects named "Fighter" (e.g. a character and its associated tokens).
- !getprop _pageid
- Will display the ID of the page containing the selected object (an easy way for a GM to get the ID of the page currently being viewed).
- !setprop -r top 70 left -70
- Will move the selected object(s) one square down and one square left.
- !setprop top +70 left -70
- CAUTION: Unlike the previous command, this will move the selected object(s) to the coordinates (-70,70), or off the left edge of the map along the first horizontal grid line.
- !setprop -r bar1_value -3
- Will subtract 3 from bar 1 of the selected token(s).
- !setprop bar1_value -3
- CAUTION: Will set bar 1 of the selected token(s) to "-3".
Changelog
v0.1 (2015-06-11)
- Initial release