@Jarren: thanks for the clarification. Learned something new again :-)
Will a. said:This is a heck of a thread, is there any capabilities with token mod, or any other script to have conditionals. for example: if health(bar 3) is below a threshold(constant) add a dice(Roll)?
I believe that Script Cards contains conditionals, but I don't use it.
Will a. said:
This is a heck of a thread, is there any capabilities with token mod, or any other script to have conditionals. for example: if health(bar 3) is below a threshold(constant) add a dice(Roll)?
Also on top of this, does Reusing rolls through $[[0]] calls not work with token mod or is there a way i should be formatting it?
Will a. said:
Will a. said:
This is a heck of a thread, is there any capabilities with token mod, or any other script to have conditionals. for example: if health(bar 3) is below a threshold(constant) add a dice(Roll)?
Also on top of this, does Reusing rolls through $[[0]] calls not work with token mod or is there a way i should be formatting it?
IIRC, re-using rolls is generally a display-only feature. But there my be some very specific exceptions. This page might answer your questions.
Will a. said:
This is a heck of a thread, is there any capabilities with token mod, or any other script to have conditionals. for example: if health(bar 3) is below a threshold(constant) add a dice(Roll)?
I know Keith mentioned ScriptCards. Also, APILogic, a metascript that can be plugged into another script's command line.
APIL works from the perspective of what can be recognized at the time APIL runs, evaluating the conditionals, and then leaving the command line in a particular disposition for the intended-recipient script to take action on. The text within the boundaries of the conditional is what is left IN the command line if the conditional passes evaluation.
So, a test of bar3 being below some value (lets say, 5), then add a dice roll... the token-mod line could look like:
!token-mod --set bar3|+[[1d20]]
Then you'd ask how much of that is conditional on the value of bar3. Since that is the only thing we're setting, it's really everything. So we wrap that in the conditional parts of APIL:
!{& if @{selected|bar3} < 5 }token-mod --set bar3|+[[1d20]]{&end}
If there were MORE things you wanted to do in token-mod (like set other properties), then you might only want to conditionalize the single property setting:
!token-mod --set name|Potato {& if @{selected|bar3 < 5}bar3|+[[1d20]]{&end}
There are more examples in the APILogic thread, including nesting conditionals and complex AND and/or OR constructions.
!token-mod --set tooltip|@{selected|Cond} works, but how do I combine multipple atttributes and text together, to be set in tooltip together.
Such as:
!token-mod --set tooltip|"@{selected|Cond} and more"
or !token-mod --set tooltip|@{selected|Cond},@{selected|Cond2}
Pretty much like your first example... if there is a space, you have to use quotes. Remember, though, that we can't really style the tooltip, so whatever you put in the tooltip will look like a string of text.
!token-mod --set show_tooltip|no
Does not seem to work. 'yes' turns it on but I cant turn it off (only manually).
Andrew R. said:
I can report that this works:
!token-mod --on show_tooltip
!token-mod --off show_tooltip
On works, but off does not. I do have lots of other scripts active, so maybe a conflict somewhere. Weird, but a minor annoyance.
Is there a way to insert a line break in a tool tip? I'm currently using:
!token-mod {{ --set tooltip|"Parry @{selected|parryCur} Toughness @{selected|toughnesscur} (@{selected|toughnessArmor})" --on show_tooltip }}
I'd love to have a line break right before Toughness. I've tried: hitting enter in the macro itself (didn't think it would work, since you can have line breaks for the command anyway), \n, and <br>. But none of those work...
For those of you who want to move dynamic lighting easily (eg attached to a token), check out the Dynamic Light Recorder script: https://github.com/symposion/roll20-api-scripts/tree/master/DynamicLightRecorder
I noticed that the remove status marker command for multiple instances of the same marker has been changed to only remove the rightmost instance instead of every instance of that marker.
Now, the command "!token-mod --set statusmarkers|-blue[]" removes only one instance of the blue status, but what if I do want to remove all of them?
It's pretty awkward to count the instances and remove them one by one, and I don't want to clear all status markers of every type, just certain ones.
Is there still a convenient way to clear all status markers of a particular name?
Kaspar K. said:
Andrew R. said:
I can report that this works:
!token-mod --on show_tooltip
!token-mod --off show_tooltipOn works, but off does not. I do have lots of other scripts active, so maybe a conflict somewhere. Weird, but a minor annoyance.
I too cannot get the show_tooltip to turn off. I tried:
!token-mod --off show_tooltip !token-mod --set show_tooltip|off
Neither works however the 'ON' works with both.
I tried this on a test game where Tokenmod is the only script loaded.
There is another issue I am also having. I have a macro men using Tokenmod that allows me to change a PCs sight from Basic to Peripheral to 360 - works fine. It also allows me to set Darkvision, Nightvision, Infravision, and Ultravision - also works fine. Thus I can set a token to Peripheral vision and give that token Darkvision as well. Then, for example, if I change the token to Nightvision, although the settings show on the token, the settings do not take effect until I then click Save Settings within the token itself. It appears that what I need is for Tokenmod to have a Save Settings switch for Dynamic Lighting.
Sasha said:
I noticed that the remove status marker command for multiple instances of the same marker has been changed to only remove the rightmost instance instead of every instance of that marker.
Now, the command "!token-mod --set statusmarkers|-blue[]" removes only one instance of the blue status, but what if I do want to remove all of them?
It's pretty awkward to count the instances and remove them one by one, and I don't want to clear all status markers of every type, just certain ones.
Is there still a convenient way to clear all status markers of a particular name?
Sorry for the late reply, no idea how I missed this. You should be able to remove all of them by leaving the brackets off:
!token-mod --set statusmarkers|-blue
When I implemented this, there was a disparity between what the api would set abs what the UI would show. If I remember correctly, you'd have to set it off twice before it would work correctly, or something similar. I'll try to check this again.
Mike W. said:
Kaspar K. said:
Andrew R. said:
I can report that this works:
!token-mod --on show_tooltip
!token-mod --off show_tooltipOn works, but off does not. I do have lots of other scripts active, so maybe a conflict somewhere. Weird, but a minor annoyance.
I too cannot get the show_tooltip to turn off. I tried:
!token-mod --off show_tooltip !token-mod --set show_tooltip|off
Neither works however the 'ON' works with both.
I tried this on a test game where Tokenmod is the only script loaded.
Today's patch is supposed to fix this issue, is it still persisting?
Mike W. said:
There is another issue I am also having. I have a macro men using Tokenmod that allows me to change a PCs sight from Basic to Peripheral to 360 - works fine. It also allows me to set Darkvision, Nightvision, Infravision, and Ultravision - also works fine. Thus I can set a token to Peripheral vision and give that token Darkvision as well. Then, for example, if I change the token to Nightvision, although the settings show on the token, the settings do not take effect until I then click Save Settings within the token itself. It appears that what I need is for Tokenmod to have a Save Settings switch for Dynamic Lighting.
Is there a way to append text to a tooltip using --set tooltip command? Currently, it overwrites anything already in the tooltip.
Doug E. said:
Is there a way to append text to a tooltip using --set tooltip command? Currently, it overwrites anything already in the tooltip.
If not natively in TokenMod, then by using a Fetch construction:
!token-mod --set tooltip|"@(selected.tooltip); stuff you want to add"
Just don't put any TokenMod-breaking key combinations in there... like a double hyphen.
Doing it twice did not turn it off either.
The Aaron said:
When I implemented this, there was a disparity between what the api would set abs what the UI would show. If I remember correctly, you'd have to set it off twice before it would work correctly, or something similar. I'll try to check this again.
Mike W. said:
Kaspar K. said:
Andrew R. said:
I can report that this works:
!token-mod --on show_tooltip
!token-mod --off show_tooltipOn works, but off does not. I do have lots of other scripts active, so maybe a conflict somewhere. Weird, but a minor annoyance.
I too cannot get the show_tooltip to turn off. I tried:
!token-mod --off show_tooltip !token-mod --set show_tooltip|off
Neither works however the 'ON' works with both.
I tried this on a test game where Tokenmod is the only script loaded.
I just tested this again today and it is still not saving or implementing all the time..
The Aaron said:
Today's patch is supposed to fix this issue, is it still persisting?
Mike W. said:
There is another issue I am also having. I have a macro men using Tokenmod that allows me to change a PCs sight from Basic to Peripheral to 360 - works fine. It also allows me to set Darkvision, Nightvision, Infravision, and Ultravision - also works fine. Thus I can set a token to Peripheral vision and give that token Darkvision as well. Then, for example, if I change the token to Nightvision, although the settings show on the token, the settings do not take effect until I then click Save Settings within the token itself. It appears that what I need is for Tokenmod to have a Save Settings switch for Dynamic Lighting.
Ug. I've confirmed that the patch did not fix it. =(
Mike W. said:
I just tested this again today and it is still not saving or implementing all the time..
The Aaron said:
Today's patch is supposed to fix this issue, is it still persisting?
Mike W. said:
There is another issue I am also having. I have a macro men using Tokenmod that allows me to change a PCs sight from Basic to Peripheral to 360 - works fine. It also allows me to set Darkvision, Nightvision, Infravision, and Ultravision - also works fine. Thus I can set a token to Peripheral vision and give that token Darkvision as well. Then, for example, if I change the token to Nightvision, although the settings show on the token, the settings do not take effect until I then click Save Settings within the token itself. It appears that what I need is for Tokenmod to have a Save Settings switch for Dynamic Lighting.
Hmm. It's working fine for me. Do you want to PM me an invite to your game and GM me and I can come check it out?
Mike W. said:
Doing it twice did not turn it off either.
The Aaron said:
Sasha said:
I noticed that the remove status marker command for multiple instances of the same marker has been changed to only remove the rightmost instance instead of every instance of that marker.
Now, the command "!token-mod --set statusmarkers|-blue[]" removes only one instance of the blue status, but what if I do want to remove all of them?
It's pretty awkward to count the instances and remove them one by one, and I don't want to clear all status markers of every type, just certain ones.
Is there still a convenient way to clear all status markers of a particular name?
Sorry for the late reply, no idea how I missed this. You should be able to remove all of them by leaving the brackets off:
!token-mod --set statusmarkers|-blue
Huh... this seems to have broken. I'll look at fixing it.
The Aaron
Could you show me what command(s) you are using ad how you are using them to achieve this? I assume I am probably doign it wrong.
The Aaron said:
Hmm. It's working fine for me. Do you want to PM me an invite to your game and GM me and I can come check it out?
Mike W. said:
Doing it twice did not turn it off either.
I'm literally just using these:
!token-mod --on show_tooltip
!token-mod --off show_tooltip
With the token selected. Do you have the token selected? The other thing is, do you have tooltip text? And finally, how are you verifying this works, are you hovering through token to get the tooltip? Or are you looking at the checkbox in the UI? (That will be wrong, probably)
Now this is strange, when I used the code you showed me - it works fine. Also now my script is working with either way to shut off the tooltip. I made no changes at all.
Thanks again for helping me out.
On a side note and FYI: If your use the tooltip command in a Journal Command Button in a Handout and have a colon as part of the tooltip text, you must use the HTML Entity : in order to get that colon to be recognized and used.
For example, I had a tooltip that said "For Partial Darkness: User Darkness penalties.". The tooltip only showed "For Partial Darkness&" and nothing else. Replacing the 'colon' with : fixed the issue.
The Aaron said:
I'm literally just using these:
!token-mod --on show_tooltip
!token-mod --off show_tooltipWith the token selected. Do you have the token selected? The other thing is, do you have tooltip text? And finally, how are you verifying this works, are you hovering through token to get the tooltip? Or are you looking at the checkbox in the UI? (That will be wrong, probably)
API Buttons use the same syntax as url links. The Roll20 chat parser is simplistic and will treat a thing with a : in it as a URL.
Thanks for the information, I knew that but for some reason my mind did not click today - Must be the weather!
The Aaron said:
API Buttons use the same syntax as url links. The Roll20 chat parser is simplistic and will treat a thing with a : in it as a URL.
Related question. These are working for me, but they don't seem to persist for the default token. I turn on the tooltips, update the default token, but when I drag a new token out, the tool tips are off again. It's not really token-mod related because I can manually turn them on and it still does not work.
Token with Tool Tip on and set to the default token for the character
New token Dragged on, Tool Tip is off
Looks like a bug in the tool tips honestly. Wonder if there is a way to write a script that would turn the tool tips on for a new token when it is dropped onto the map? I am looking to replace showing nameplates with using tool tips for names to help with screen clutter.
The Aaron said:
I'm literally just using these:
!token-mod --on show_tooltip
!token-mod --off show_tooltipWith the token selected. Do you have the token selected? The other thing is, do you have tooltip text? And finally, how are you verifying this works, are you hovering through token to get the tooltip? Or are you looking at the checkbox in the UI? (That will be wrong, probably)
It sounds like you just need to set the token back as the default token for that character:
!token-mod --set defaulttoken
Yes, that's a bug with the current tooltips implementation. I spotted and reported it when tooltips were announced. I hope it'll get fixed sometime.
I'm using tooltips to show the 13th Age defenses, so I turn the tooltip on while prepping the session. No biggie.
!token-mod --on show_tooltip
Any luck yet at fixing this?
The Aaron said:
Ug. I've confirmed that the patch did not fix it. =(
Mike W. said:
I just tested this again today and it is still not saving or implementing all the time..
The Aaron said:
Today's patch is supposed to fix this issue, is it still persisting?
Mike W. said:
There is another issue I am also having. I have a macro men using Tokenmod that allows me to change a PCs sight from Basic to Peripheral to 360 - works fine. It also allows me to set Darkvision, Nightvision, Infravision, and Ultravision - also works fine. Thus I can set a token to Peripheral vision and give that token Darkvision as well. Then, for example, if I change the token to Nightvision, although the settings show on the token, the settings do not take effect until I then click Save Settings within the token itself. It appears that what I need is for Tokenmod to have a Save Settings switch for Dynamic Lighting.
The Aaron said:
It sounds like you just need to set the token back as the default token for that character
That doesn't work for my 13th Age monster tokens setup as MOOKS per the documentation. :-(
My player's CHARACTER tokens don't use tooltips so far. They really appreciate the tooltips on the monsters, it speeds up play a lot.
Oh!? Tooltip state isn't saved for default tokens!?!?? I'll verify that and then escalate to the Devs.
The API doesn't have that kind of access. It's running on a server in the cloud, and only interacts with the backend.
Well I guess I will have to live with that. Thanks.
The Aaron said:
The API doesn't have that kind of access. It's running on a server in the cloud, and only interacts with the backend.
The Aaron said:
Oh!? Tooltip state isn't saved for default tokens!?!?? I'll verify that and then escalate to the Devs.
Yup. It was reported at the time. Given the nature of the feature which felt like a Hacktoberfest sort of thing, I don't have high hopes of any change in functionality.
Is there a way to set line breaks inside of a tooltip?
Here is what I am working on to use on all my player characters.
!token-mod {{
--set
represents|@{Dave|character_id}
name|"Dave"
bar1_link|ac
bar2_link|speed
bar3_link|hp
tooltip|"AC: @{selected|AC}; PP: @{selected|passive_wisdom}; Move Speed: @{selected|speed}; Save DC: @{selected|spell_save_dc}"
defaulttoken
--on
show_tooltip
}}
The tooltip works mostly as intended, what it shows is something along the lines of
AC: 21; PP: 19; MS:
45; Save DC: 17;
what i'd like is
AC: 21;
PP: 19;
MS: 45;
Save DC: 17;
Also, is there any ways I can improve this, so that I don't have to change the names every time, perhaps a quarry in form of a drop down menu for both of the Name fields? That way I have one button that I can just press for setting up a token, without editing it each time.
And how can I also have it automatically grant basic vision, or night vison?
Rob F. said:
Is there a way to set line breaks inside of a tooltip?
Not currently, neither normally or with API. The Tooltip text is heavily sanitized, and doesn't allow any formatting right now. Hopefully that will change for later.
Update v0.8.73 - Fixed a bug that crashed TokenMod when any message used an inline roll of a Tollable Table with no rows. (Thanks Shane M. )
Additionally, I've changed TokenMod so it will do a better job of ignoring messages that aren't meant for it. =D
Request: Minor QoL
That's definitely on my list. I can probably hit the first bullet (and perhaps the second), but the help rewrite is a larger task that I've been working on.
I am having issues with the following (All from chat as I am testing right now):
Emits Bright Light is off. Emits Low Light is off. Directional Light is 0.
I use this command:
!token-mod --set emits_bright_light|on emits_low_light|on bright_light_distance|2 low_light_distance|5 has_directional_bright_light|on directional_bright_light_total|180This sets all the fields, actually emits bright light but the light is 360°, even though the field on the token says 180°. The 180° does not take effect until I manually click "Save Changes" on the token.
Emits Bright Light is already on. Directional Light is off.
!token-mod – set has_directional_bright_light|on directional_bright_light_total|180This does nothing.
I am stumped, what am I doing wrong here?