Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Total NOOB - Need help

December 24 (8 years ago)

Edited December 24 (8 years ago)
So I am a total, complete, absolute noob when it comes to anything related to scripts, and coding, etc. I have no idea how any of it works, how to use it, etc. 
I have a pro sub, so it gives me access to the API... The featue I am looking for is in a script called TokenMod, but I have no idea how to imoplement it, if there's a GUI for it, how to turn it on (?) -- in short... this API stuff is like trying to learn Chinese. 

I just need a step by step guide on how to use this stuff... it seems like a lot of this is written by coders, for coders, and I can't make heads or tails out of it..... So here's what I am looking for....

I want to hit a button, select a token, and toggle an aura on or off... that's it. I know it exists in TokenMod (again, I don't know how to use that. The documentation doesn't make any sense to me). I am using auras to track health in a Star Wars d6 game... (so blue is stunned, yellow incapacitated... that sort of thing...)

Can someone help me, in layman's terms. How do I use tokenmod to do what I want to do? 
December 24 (8 years ago)

Edited December 24 (8 years ago)
I would recommend starting out by reading our API Introduction page and then the first section of the API Use Guide, which details how to access the API Script page of your Game.

TokenMod is available for One-Click install via the Script Library; the first tab on the API Scripts page. Find and select TokenMod on the Roll20 API Script Library dropdown menu. Then, scroll past the documentation, and click the blue Add Script button.
December 24 (8 years ago)
Within TokenMod's Script Library documentation, you can find an example of how to adjust the radius of an aura:
Here is setting a standard DnD 5e torch, turning off aura1 and setting aura2 to 30. Note that the | is still required for setting a blank value, such as aura1_radius below.
!token-mod --set light_radius|40 light_dimradius|20 aura1_radius| aura2_radius|30

The code can also be rewritten to emphasize its structure:
!token-mod {{
--set
     light_radius|40
     light_dimradius|20
     aura1_radius|
     aura2_radius|30
}}

Note that --set acts upon all of its supplied arguments, including aura1_radius. We're only interested in that argument, so we can simplify this example like so:
!token-mod --set aura1_radius|
This turns off aura1.

To turn aura1 back on, we would supply aura1 with a radius. This is demonstrated in the initial example, too.
December 24 (8 years ago)
Changing the color of an aura is also documented within the Script Library:

Color

Colors can be any hex number color (with or without preceding #), or the word transparent.

Available Color Properties:

tint_color
aura1_color
aura2_color
Turning off the tint and setting aura1 to a reddish color.
!token-mod --set tint_color|transparent aura1_color|ff3366

Note that this also uses --set.
December 24 (8 years ago)
Adding Drop-Down Roll Queries to your TokenMod macros is recommended. However, take heed of this piece of documentation:
Note: Anywhere you use |, you can use # instead. Sometimes this make macros easier.

You'll want to always use # within Roll Queries. e.g.
!token-mod --set ?{Condition|
  None, aura1_radius# |
  Stunned, aura1_radius#2 aura1_color#0000ff |
  Incapacitated, aura1_radius#2 aura1_color#ffff00 
}
December 24 (8 years ago)
thanks a lot!

I'll dig into this and see if i can figure it out
December 24 (8 years ago)
Very cool.
So for some reason I have a "blank" option in the drop down, with nothing there... and I'm trying to figure out how to make the auras circle, I know its an option.... Thanks for this
December 24 (8 years ago)
Never mind! Got it. Setting it to Aura 2 makes it circle. Okay thanks, I think I got what I need!
December 24 (8 years ago)
Looking to see how to create a KILLED option in the dropdown, and adding the giant red x or the skull status.... I'll figure this out. 
December 24 (8 years ago)
Great! Good luck!
December 24 (8 years ago)
Gold
Forum Champion

Enrique said:

Looking to see how to create a KILLED option in the dropdown, and adding the giant red x or the skull status.... I'll figure this out. 

Here's the macro I made for this. I call it "xKill" and made it a Token Action global macro, this way it is a kill button that appears on any Token that the GM has selected.

I've included some features I like. Sets Hit Points to zero, adds the big red X.  It announces in chat that the "Name" was defeated (using some clever wording, "It seems that Red Dragon is defeated"... leaves open the possibility that they were not actually killed but merely seemingly 'defeated').  Then it bleeds profusely using Roll20 special effects. *grin*

!token-mod --set bar2_value|0 statusmarkers|dead
/desc It seems that @{selected|token_name} is defeated.
/fx splatter-blood @{selected|token_id} @{selected|token_id}
/fx glow-blood @{selected|token_id} @{selected|token_id}
/fx bubbling-blood @{selected|token_id} @{selected|token_id}


January 24 (8 years ago)
Gold, when I use that macro, it spurts blood gives the message to chat, but doesn't change anything else about the token.