This is an existing bug with the UDL implementation for the API and something that Roll20 will need to fix.
This is an existing bug with the UDL implementation for the API and something that Roll20 will need to fix.
Please help. My game was looking good but when I toggled on player can id my whole game got messed up. My chat went blank, and even blinks on and off and my buttons in the top left ie. pointer, layer, fx and initiative buttons completely disappear when I hover over them. My whole screen in just kind of wonky. I tried to delete tokenmod and reinstall it but nothing has changed. And it all started when I toggled the player can id's button. Any help would be awesome.
Actually i kind of figured it out. Not really but I fixed it :). I had to delete TokenMod then completely clear my chat archive and that worked. For some reason every time I re entered my game there was some script from tokenmod in the chat that was messing up my screen. So when I cleared my chat archive it fixed it. Weird I know.
It's almost certainly a coincidence. That setting toggles a javascript variable and would have nothing to do with browser behavior such as you describe. If restarting the computer (not just the browser) doesn't clear it up, try running in a private browsing window to eliminate most instances of an interfering extension. Probably not a bad idea to delete the cache as well. If you want to be thorough, you could also try clearing the Chat Archive. A game's Creator is often able to fix issues with their Text Chat by clearing the Chat Archive (note: not clearing your current Chat Log). A GM might want to copy/back up the Chat Archive before the Creator clears it.
I think this might be a bug in the latest Chrome. I had a weird issue with character replacements and flashing text a few days ago, but it cleared up on refresh, or possibly restart of the browser.
keithcurtis said:
It's almost certainly a coincidence. That setting toggles a javascript variable and would have nothing to do with browser behavior such as you describe. If restarting the computer (not just the browser) doesn't clear it up, try running in a private browsing window to eliminate most instances of an interfering extension. Probably not a bad idea to delete the cache as well. If you want to be thorough, you could also try clearing the Chat Archive. A game's Creator is often able to fix issues with their Text Chat by clearing the Chat Archive (note: not clearing your current Chat Log). A GM might want to copy/back up the Chat Archive before the Creator clears it.
I think he should try another browser, that's seems the simplest. Try Friefox if you're using Chrome or vice versa. Or, if nothing helps, IE (yikes). That could rule out a browser problem.
i! I got a question.
Is it possible to change this value of a token?
I ask because I've been trying to figure it out but so far the attributes provided in the guidelines don't seem to work.
You may think that using --set rotation| would do the trick, BUT I also use the TokenLock script, which won't let my players use that macro, so I kind of need to change that particular token setting, but I've no idea if it's possible. Can someone help? :(
Ninix said:
i! I got a question.
Is it possible to change this value of a token?
I ask because I've been trying to figure it out but so far the attributes provided in the guidelines don't seem to work.You may think that using --set rotation| would do the trick, BUT I also use the TokenLock script, which won't let my players use that macro, so I kind of need to change that particular token setting, but I've no idea if it's possible. Can someone help? :(
That's directional_bright_light_center or directional_low_light_center. Be sure that has_directional_bright_light is on, or has_directional_low_light.
Farzivel said:
Is tokenmod able to set the Tint Color attribute for night vision? I've been trying to figure it out but just can't seem to find the answer. Any help would be much appreciated and I love the work you guys do!
Yes, that's night_vision_tint
I'm having trouble converting this legacy dynamic lighting token-mod command to work with the new dynamic lighting features / command. The token mod effect is to simulate a flashlight, by illuminate the area in front of the token in short (15-degree) arc.
Here's the command that used to work with legacy dynamic lighting:
!token-mod --set light_hassight|yes light_otherplayers|yes light_angle|30 light_radius|15 light_dimradius|10
That used to work with the old dynamic lighting, and I'm prepping my first map to use the new dynamic lighting feature. I tried this:
!token-mod --set bright_vision|yes has_directional_bright_light|yes directional_bright_light_center|0 light_angle|15 directional_bright_light_total|10 light_otherplayers|yes
No light emits from the token ... what am I missing?
If you open the token after running the command send them save it, does that fix the vision? This sounds like an existing Roll20 bug.
HI all,
Is the players journal a parameter than can be adapted by token mod ?
For example, if i want to give a player control over conjured animals, i can set him to control the tokens, but he cannot access the sheet if not in his journal.
Don't know if that's a possibility with token mod.
thanks for your answer !
The Aaron said:
If you open the token after running the command send them save it, does that fix the vision? This sounds like an existing Roll20 bug.
I flipped through some back threads, and figured out this was what I needed:
!token-mod {{
--on
emits_bright
emits_low
has_directional_bright_light
--set
bright_distance#10
low_distance#6
directional_bright_light_total#20
}}
Marco W. said:
Okay, at least it's not me : )
Are there any known workarounds?
Thanks for the quick reply
So is this the same issue as switching from a candle's light to a torch's and the actual light not changing?
Very likely. If you run the command and it doesn't seem to change everything, then you open the token properties and just click save and everything is fixed, that's the Roll20 bug.
I've looked around a bit, and gave the handout doc a read, but there's no handy way to place multiple tokens in a nice ordered grid is there?
Big fan, I've used TokenMod for several campaigns now (edit: apparently Roll20 doesn't recognise the unicode thumbsup emoji...)
!token-mod --set bar1_value|@(selected|bar2_max}
...should do it. This assumes the token is selected. You might need to use different identification syntax depending on the need. Note that this will only work correctly on one token at a time. To iterate across a selected group of tokens would reuire a couple of Timmaugh's meaa scripts.
That eg doesnt work, it puts the text into the field rather than the value... there must be something else required to translate the value. I've tried the common ones but not found an answer yet.
Tubal said:
I've looked around a bit, and gave the handout doc a read, but there's no handy way to place multiple tokens in a nice ordered grid is there?
Not with TokenMod, but here's a little script I wrote to do that called MarshalTokens. Just select the tokens and run:
!marshal-tokens
and it will put them in as close to a square as it can.
Code:
on('ready',()=>{ const positioner = (x,y) => { const shell = (n) => Math.ceil(Math.sqrt(n)); const xyForN = (n) => { let s = shell(n); let sm = s-1; let sSeq=n-(Math.pow(sm,2)); let pSeq=Math.ceil(sSeq/2); return { x: (sSeq%2 ? pSeq : s)-1, y: (sSeq%2 ? s : pSeq)-1 }; }; let startx = x; let starty = y; let count=0; return (obj)=>{ let coord = xyForN(++count); obj.set({ top: starty+(coord.y*70), left: startx+(coord.x*70) }); }; }; const normalizer = (n) => { return (Math.max(0,Math.floor((n-35)/70))*70)+35; }; on('chat:message',function(msg){ if('api'===msg.type && /^!marshal-tokens(\b\s|$)/i.test(msg.content) && playerIsGM(msg.playerid)){ let tokens = [...new Set([ ...msg.content.split(/\s+/).slice(1), ...((msg.selected && msg.selected.map(s=>s._id)) || []) ])] .map(id=>getObj('graphic',id)) .filter(g=>undefined !== g) ; let firstToken = (tokens[0]||{get:()=>0}); let x=normalizer(firstToken.get('left')); let y=normalizer(firstToken.get('top')); let poser = positioner(x,y); tokens.forEach(poser); } }); });
Kevin Flynn said:
That eg doesnt work, it puts the text into the field rather than the value... there must be something else required to translate the value. I've tried the common ones but not found an answer yet.
Can you post what command you're running, and a picture of what is in the bars for the token in question?
Hmm. My fault, probably. I might have been sloppy there.It should have been:
!token-mod --set bar1_value|@{selected|bar2|max}
...Lookups use a different syntax.
If it's a text value, you probably want
!token-mod --set bar1_value|"@{selected|bar2|max}"
If your just trying to set the bar back to its max value, there's a pseudo property for that. I'm pretty sure this is it, but search the docs for reset to be sure:
!token-mod --set bar3_reset|
Close enough, thanks!The Aaron said:
Not with TokenMod, but here's a little script I wrote to do that called MarshalTokens. Just select the tokens and run:
I use these scripts to handle my NPC portraits. I have a bunch of buttons to set sizes and layers etc to reveal and hide them.
If someone has a functional bullseye lantern syntax for UDL Tokenmod I would love to see it as I have gone crosseyed for hours trying to figure out why its not working. I feel like there is a bug here cause when it tries to work it breaks all light till you manually go in and fiddle with the save button.
There very definitely is a bug. That's on the Roll20 side. API changes to UDL don't trigger an update on the token's light settings. For now, you have to open the edit properties and save to force an update.
Everything seems to work except for the directional light button that toggles it on and off to me but maybe I'm just incorrectly relying upon ctrl+L too much and haven't actually put this session to use with actual live players yet to see it fail to work. Everything but the bullseye lantern works.
DM Eddie said:
Everything seems to work except for the directional light button that toggles it on and off to me but maybe I'm just incorrectly relying upon ctrl+L too much and haven't actually put this session to use with actual live players yet to see it fail to work. Everything but the bullseye lantern works.
Yup, I can verify that's the same bug. Fortunately, I don't think I have ever had a player want to use a bullseye lantern.
DM Eddie said:
If someone has a functional bullseye lantern syntax for UDL Tokenmod I would love to see it as I have gone crosseyed for hours trying to figure out why its not working. I feel like there is a bug here cause when it tries to work it breaks all light till you manually go in and fiddle with the save button.
This is the macro I use.
!token-mod --on emits_bright_light has_directional_bright_light --off emits_low_light --set bright_light_distance#120 low_light_distance#60 directional_bright_light_center#90 directional_bright_light_total#10
It seems to work for me.
hi Aaron,
Thanks for this awesome script. I use it all the time :)
Maybe its a stupid question, but why is there these parameters in the setting of directional light
directional_bright_light_center
directional_low_light_center
directional_bright_light_total
directional_low_light_total
on the edit properties page they seem not to destinguish between the two.
This has been my most dedicated effort to use dynamic lighting for a group I host for and I set up the macro for token mod perfectly fine a few days ago, it worked fully. After this weeks patch, whenever I use the light macro it changes the entire area where the lighting would be to complete darkness. I have done NOTHING to my game session since I made the functional keys. Please tell me this is happening to everyone or I'm going to be stuck reverting for the thousandth time back to LDL.
?{What Lightsource?|Turn off lights,!token-mod --off emits_bright emits_low|Candle,!token-mod --on has_bright_light_vision emits_bright emits_low --set bright_distance#5 low_distance#5|Moon Touched Weapon,!token-mod --on has_bright_light_vision emits_bright emits_low --set bright_distance#15 low_distance#15|Torch or Light Cantrip,!token-mod --on has_bright_light_vision emits_bright emits_low --set bright_distance#20 low_distance#20|Lamp,!token-mod --on has_bright_light_vision emits_bright emits_low --set bright_distance#15 low_distance#30|Hooded Lantern,!token-mod --on has_bright_light_vision emits_bright emits_low --set bright_distance#30 low_distance#30}
Hi Aaron, I'm trying to set up a macro that will allow the players to link a token to their character sheet. But for some reason the following line is giving me an error:
!token-mod --set represents|@{"?{Character}"|character_id}
The error message is:
TypeError: u is undefined
Do you know what might be going on? I know I have to expand the macro to also link bars and things eventually, but I was starting with getting this command working. Thanks for your time!
Probably you want either:
!token-mod --set represents|"?{Character}"
Or
!token-mod --set represents|@{?{Character}|character_id}
In the former case, token mod will search for the character by name (or name fragment), in the latter the player types the name precisely and Roll20 does the expansion to the character id in the local client before passing it to the API. I've not tried this second case and I don't know if Roll Queries can be used for attribute expansion like that, I'd have to check.
Pretty sure that second formation won't work, but it will work if you put the sheet call into a Fetch construction:
!token-mod --set represents|@(?{Character}|character_id)
That will give the roll query time to resolve before Fetch goes to find the character.
The Aaron said:
Probably you want either:
!token-mod --set represents|"?{Character}"Or
!token-mod --set represents|@{?{Character}|character_id}In the former case, token mod will search for the character by name (or name fragment), in the latter the player types the name precisely and Roll20 does the expansion to the character id in the local client before passing it to the API. I've not tried this second case and I don't know if Roll Queries can be used for attribute expansion like that, I'd have to check.
The first suggestion seems like the better option for what I want, so it being simpler is a bonus. I’ll let you know if there are any issues when I get a chance to try it, but thanks regardless! :-)
For the record, your first suggestion worked great, thanks again!
Here is my final macro, though at the moment I have to run it twice because the first time I run it on a blank token (created from a rollable table in this case) I get "No character was found for 'selected'" in the chat, and the token name is set to ""selected" (including the leading quotation mark). But running the macro again immediately then fixes it.
!token-mod --on showname showplayers_name showplayers_bar3 --set represents|"?{Character}" name|"@{selected|character_name}" bar1_link|hp bar2_link|ac bar3_link|hp_temp defaulttoken
I think I understand why it is doing that. If you have any suggestion for how to have it work for the token name on the first run, I'm curious to hear it, but this is an easy enough workaround that I'm fine with it. :-)
I'm looking at the TokenMod help journal entry, and it includes the following:
When appending a url, you can use a
followed by a number to specify where to place the new image. Indicies start at 1.
I think that you meant to say "@ followed by a number".
The reason I'm looking is because my players have requested a way to get a token automatically from a PC's avatar. As players they can set the avatar, and the above TokenMod macro I made lets them link an existing token to a PC, but they can't drop any new images onto the tabletop even if they go make one from their avatar image using https://rolladvantage.com/tokenstamp/ or some other tool.
I was thinking if they could create any token (I guess you can always drag a die roll from chat onto the tabletop, right?), they could use TokenMod to change the image using something like the following:
!token-mod --set imgsrc|URL
Where URL is the address of an image in their image library. But does that work for players, who don't normally have access to their image library in the game? I'd test that myself, but that leads me to my second question: where do you get that URL? Even if they create their own game to have access to the images tab of the journal area, I'm having trouble getting the URL of any of those images.
Thanks for all your help! I'd be great if my players could get their own token images set up rather than sending them to me and me having to do it. ;-)
Automating this whole token process could also be considered a feature request for your PlayerCharacters script, if you think it makes sense. Creating a default token with a player-chosen image is probably something any player that creates their own new PC will want to do. Maybe copying it from the current avatar would be a way to use the existing interface?