Difference between revisions of "Script:Marking Conditions"
From Roll20 Wiki
(updated to use @target/@selected instead of poorly-implemented descriptors, and added means to remove singular markers) |
Andreas J. (Talk | contribs) m |
||
(10 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | + | {{revdate}} | |
+ | {{main|API:Script Index}} | ||
− | |||
− | |||
− | |||
− | |||
− | {| | + | {{script overview |
− | | | + | |name=Marking Conditions |
− | + | |author={{user profile|235259|Brian}} | |
− | + | |dependencies={{api repository link|splitArgs}} | |
− | |- | + | |version=3.3 |
− | + | |lastmodified=2015-03-26}} | |
− | + | '''Marking Conditions''' creates the API commands <code>!mark</code>, <code>!unmark</code>, and <code>!clearmark</code> | |
− | |- | + | <br clear="all"> |
− | | | + | |
− | | | + | === Syntax === |
+ | {{syntaxbox top|formal=true|Marking Conditions}} | ||
+ | {{API command|mark}} {{API parameter|name=tokenid}} {{API parameter|name=status</em> {{API parameter|name=type|optional=true}}<em>|optional=true}}<br> | ||
+ | {{API command|unmark}} {{API parameter|name=tokenid}} {{API parameter|optional=true|name=status</em> {{API parameter|optional=true|name=type}}<em>}}<br> | ||
+ | {{API command|clearmark}} {{API parameter|name=tokenid}} | ||
+ | {{Formal API command| | ||
+ | {{token|S}} {{rarr}} {{API command|mark}} {{token|tokenid}} {{token|status|-}} | ||
+ | {{token|S}} {{rarr}} {{API command|unmark}} {{token|tokenid}} {{token|status|-}} | ||
+ | {{token|S}} {{rarr}} {{API command|clearmark}} {{token|tokenid|-}} | ||
+ | {{token|tokenid}} {{rarr}} {{string|-}} | ||
+ | {{token|status}} {{rarr}} {{epsilon}} | ||
+ | {{token|status}} {{rarr}} {{string}}{{token|damage|-}} | ||
+ | {{token|damage}} {{rarr}} {{epsilon}} | ||
+ | {{token|damage}} {{rarr}} acid<br> | ||
+ | {{token|damage}} {{rarr}} cold<br> | ||
+ | {{token|damage}} {{rarr}} fire<br> | ||
+ | {{token|damage}} {{rarr}} force<br> | ||
+ | {{token|damage}} {{rarr}} lightning<br> | ||
+ | {{token|damage}} {{rarr}} necrotic<br> | ||
+ | {{token|damage}} {{rarr}} poison<br> | ||
+ | {{token|damage}} {{rarr}} psychic<br> | ||
+ | {{token|damage}} {{rarr}} radiant<br> | ||
+ | {{token|damage}} {{rarr}} thunder | ||
+ | }} | ||
+ | {{syntaxbox end}} | ||
+ | |||
+ | {{param description top}} | ||
+ | {{param description|name=tokenid|value=ID of a token object. This can be obtained with <code>@{target{{!}}token_id}</code> or <code>@{selected{{!}}token_id}</code>.}} | ||
+ | {{param description|name=status|value=Optional. Either the name of a [[API:Objects#Graphic (Token/Map/Card/Etc.)|statusmarker icon]], or else one of many aliases to D&D 4e conditions. | ||
− | If ''status'' is not specified, the purple statusmarker will be used. | + | |
− | | | + | If ''status'' is not specified, the purple statusmarker will be used.}} |
− | + | {{param description|name=type|value=Optional. A D&D 4e damage type. Only used if ''status'' is "ongoing", "damage", or "dam". If supplied, should be one of: | |
− | | | + | |
* acid | * acid | ||
* cold | * cold | ||
Line 31: | Line 55: | ||
* radiant | * radiant | ||
* thunder | * thunder | ||
− | If ''type'' is not specified, a statusmarker to represent untyped damage will be used. | + | If ''type'' is not specified, a statusmarker to represent untyped damage will be used.}} |
− | + | {{param description bottom}} | |
The <code>!mark</code> command will set a marker, while the <code>!unmark</code> command will clear it. <code>!clearmark</code> will clear all markers from the token. | The <code>!mark</code> command will set a marker, while the <code>!unmark</code> command will clear it. <code>!clearmark</code> will clear all markers from the token. | ||
− | ==== | + | ==== Conditions and Aliases ==== |
− | + | The available ''status'' aliases and the D&D 4e conditions they map to are listed below. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | ==== | + | {| class="wikitable" |
− | ''' | + | |- |
− | < | + | ! Condition |
− | + | ! Aliases | |
− | ''' | + | ! Condition |
− | < | + | ! Aliases |
− | + | |- style="vertical-align:top" | |
− | ''' | + | | style="width:100px" | '''Blinded''' |
− | < | + | | style="width:200px" | blinded<br>blind |
− | + | | style="width:100px" | '''Prone''' | |
− | ''' | + | | style="width:200px" | prone |
− | < | + | |- style="vertical-align:top" |
− | + | || '''Dazed''' | |
− | ''' | + | || dazed<br>daze |
− | < | + | || '''Restrained''' |
+ | || restrained | ||
+ | |- style="vertical-align:top" | ||
+ | || '''Deafened''' | ||
+ | || deafened<br>deaf | ||
+ | || '''Slowed''' | ||
+ | || slowed<br>slow | ||
+ | |- style="vertical-align:top" | ||
+ | || '''Dominated''' | ||
+ | || dominated<br>dominate | ||
+ | || '''Stunned''' | ||
+ | || stunned<br>stun | ||
+ | |- style="vertical-align:top" | ||
+ | || '''Immobilized''' | ||
+ | || immobilized<br>immobile<br>immob | ||
+ | || '''Weakened''' | ||
+ | || weakened<br>weak | ||
+ | |- style="vertical-align:top" | ||
+ | || '''Marked''' | ||
+ | || marked<br>mark | ||
+ | || '''Ongoing Damage''' | ||
+ | || ongoing<br>damage<br>dam | ||
+ | |- style="vertical-align:top" | ||
+ | || '''Petrified''' | ||
+ | || petrified<br>petrify<br>stone | ||
+ | || '''Dying<br>Helpless<br>Unconscious<br>Insubstantial<br>Surprised''' | ||
+ | | style="width:200px" | '''''Marking Conditions''' explicitly does not handle these statuses, and will generate an error message if you try to use one.'' | ||
+ | |} | ||
− | + | === Changelog === | |
− | + | {{changelog version|3.3|2015-03-26|* [bugfix] fixed bugs reported by {{user profile|376031|Ron}}}} | |
+ | {{changelog version|3.2|2015-01-24|* [bugfix] no-arg crash}} | ||
+ | {{changelog version|3.1|2015-01-22|* Fixed transcription error}} | ||
+ | {{changelog version|3.0|2015-01-09|* Release}} |
Latest revision as of 13:49, 11 October 2021
Page Updated: 2021-10-11 |
Main Page: API:Script Index
Version: 3.3
Last Modified: 2015-03-26
Code: Marking Conditions
Dependencies: splitArgs
Conflicts: None
Marking Conditions creates the API commands !mark
, !unmark
, and !clearmark
[edit] Syntax
!mark <tokenid> [status [type]]
!unmark <tokenid> [status [type]]
!clearmark <tokenid>Formally:
S
→ !marktokenid
status
S
→ !unmarktokenid
status
S
→ !clearmarktokenid
tokenid
→ string
status
→ ε
status
→ stringdamage
damage
→ ε
damage
→ acid
damage
→ cold
damage
→ fire
damage
→ force
damage
→ lightning
damage
→ necrotic
damage
→ poison
damage
→ psychic
damage
→ radiant
damage
→ thunder
Parameter | Values |
---|---|
tokenid | ID of a token object. This can be obtained with @{target|token_id} or @{selected|token_id} .
|
status | Optional. Either the name of a statusmarker icon, or else one of many aliases to D&D 4e conditions.
|
type | Optional. A D&D 4e damage type. Only used if status is "ongoing", "damage", or "dam". If supplied, should be one of:
If type is not specified, a statusmarker to represent untyped damage will be used. |
The !mark
command will set a marker, while the !unmark
command will clear it. !clearmark
will clear all markers from the token.
[edit] Conditions and Aliases
The available status aliases and the D&D 4e conditions they map to are listed below.
Condition | Aliases | Condition | Aliases |
---|---|---|---|
Blinded | blinded blind |
Prone | prone |
Dazed | dazed daze |
Restrained | restrained |
Deafened | deafened deaf |
Slowed | slowed slow |
Dominated | dominated dominate |
Stunned | stunned stun |
Immobilized | immobilized immobile immob |
Weakened | weakened weak |
Marked | marked mark |
Ongoing Damage | ongoing damage dam |
Petrified | petrified petrify stone |
Dying Helpless Unconscious Insubstantial Surprised |
Marking Conditions explicitly does not handle these statuses, and will generate an error message if you try to use one. |
[edit] Changelog
v3.3 (2015-03-26)
- [bugfix] fixed bugs reported by Ron
v3.2 (2015-01-24)
- [bugfix] no-arg crash
v3.1 (2015-01-22)
- Fixed transcription error
v3.0 (2015-01-09)
- Release