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

[Script Update] TokenMod -- An interface to adjusting properties of a token from a macro or the chat area.

March 17 (3 years ago)

Edited March 17 (3 years ago)

Hi Aaron!

Nevermind. It seems to be working now. Have no idea why it didn't before...

[I'm running Rime of the Frostmaiden and was using TokenMod to swing wildshape forms for the Druid using one of you past videos (great content!). But now after this latest update (1.5) I get this error and the the token no longer works. Any ideas why?.... Just noticing now that TokenMod is no longer in the API list. Is there a API that could do what TokenMod use to do?]

Thanks in advance!

James

March 17 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
If you are using it for Druid Wild Shapes, there is a script specifically for this that does an awful lot more. I believe it is called D&D 5e WildShape and is available in the One Click.
March 17 (3 years ago)


keithcurtis said:

If you are using it for Druid Wild Shapes, there is a script specifically for this that does an awful lot more. I believe it is called D&D 5e WildShape and is available in the One Click.


This! I am using wildshape with my campaign and my druid loves it. It does require some set up but once you get it going it works great!



March 18 (3 years ago)

Other scripts were working. Sandbox was restarted. Current diagnosis from The Aaron was some weird issue between TokenMod and DeathTracker; with DeathTracker (which I'd loaded to see if other scripts were working) unloaded, TokenMod is working fine. The Aaron is exploring the problem, but torch/light stuff is currently working.

March 19 (3 years ago)

Edited March 19 (3 years ago)

I seem to have encountered a strange bug with the defaulttoken command, which I don't think has previously discussed (apologies if I just didn't find it).

Whenever I use that command to set a token as the default one, it does something to screw up that token's vision, making any light sources create darkness areas instead of light areas.


In the image below, the token has darkvision and the black circle is centred around a torch token I created which is shedding 20ft bright and 20ft dim. The pool of light (from the torch) is visible to all other tokens, and was visible to the one in the screenshot before I used "!token-mod --set defaulttoken" on it and then dragged it out from the journal again.


The only way I have found to fix the issue, is to turn off the token's "vision" and then turn it back on, and save the token as default again manually. Also, the vision has to be turned off/on through the UI. Using the token-mod command to flip it didn't fix it.

March 19 (3 years ago)

Edited March 19 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

Interesting!  I'll try and duplicate that. The defaulttoken command merely calls a Roll20 function rather than directly changing a property on an object. That function has some notable other bugs, but this is the most bizarre one I've seen so far. 

March 19 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

That doesn't have anything to do with TokenMod, right?  You should start a new thread for that sort of thing.

March 19 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter


falarr87 said:

I seem to have encountered a strange bug with the defaulttoken command, which I don't think has previously discussed (apologies if I just didn't find it).

Whenever I use that command to set a token as the default one, it does something to screw up that token's vision, making any light sources create darkness areas instead of light areas.


In the image below, the token has darkvision and the black circle is centred around a torch token I created which is shedding 20ft bright and 20ft dim. The pool of light (from the torch) is visible to all other tokens, and was visible to the one in the screenshot before I used "!token-mod --set defaulttoken" on it and then dragged it out from the journal again.


The only way I have found to fix the issue, is to turn off the token's "vision" and then turn it back on, and save the token as default again manually. Also, the vision has to be turned off/on through the UI. Using the token-mod command to flip it didn't fix it.


I haven't been able to duplicate this, do you have a set of steps that will cause it to happen?


The Aaron said:


I haven't been able to duplicate this, do you have a set of steps that will cause it to happen?


Thanks for the quick reply. These are the steps that re-produce it for me:

1. Create a new character in the journal.

2. Drag new char to TT from journal.

3. Give token "Vision" and "Night Vision" (I set 60ft).

4. Save token settings and save the token as default (manually).

5. Drag the newly saved token out from the journal.

(At this stage the token should be able to see everything as expected)

6. Select the token and use: !token-mod --set defaulttoken

7. Drag a new version of the token out from the journal again.

(Now the token will see any light sources as darkness).


In case you need it, my light source is a simple torch image with Bright Light on and set to 20, and Low Light on and set to 20. All other settings on it are default.

In the page settings, the only UDL settins are DL=On and Update when Token Drop=On. Nothing is enabled in legacy lightning.


Another quick note on the above issue...

I thought I'd test to see if it might be caused by a clash with another API script but I've created a completely new game and only installed tokenmod and still have the problem.

March 19 (3 years ago)

So I'm using this script to help me replicate a Lights Out puzzle that I'm displaying for my players. I have multi-sided tokens already set up on the grid and have a macro button to increment the face value, which works to flip it. My original plan was to have the players indicate which cell they want to press, then I would select all the relevant tokens and run the macro. What I'm wondering, however, is if there's a scripted way to select the cardinal-direction adjacent tokens based on the initially-selected token. That way, all the appropriate lights are automatically selected and changed when the macro is run on a single token. Anyone have ideas for that?

March 19 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

There's not a positional selection method, but you could hardcode the ids of certain graphics:

!token-mod --set <some properties> --ignore-selected --ids <some hard coded id>
March 19 (3 years ago)

Yeah, I think that's probably my best bet. Here I was hoping I'd avoid hard coding 16 different sets of IDs haha. At least it's only a 4x4 grid and not a 7x7 like I'd originally wanted. Thanks for the reply!

March 26 (3 years ago)

When setting token markers with a macro is there a way to suppress the chat messages? I'd rather it just apply the marker and not send anything to the chat. Especially with any marketplace markers it is rather ugly with all the numbers.

March 26 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

What message?  What command are you running, can you screenshot the output?

March 26 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

I'm going to guess you have something like CombatMaster installed that is outputting some message.  TokenMod doesn't output anything unless you use the --report command  (or --help, but then it also doesn't change anything about tokens).

March 26 (3 years ago)

Edited March 26 (3 years ago)

!token-mod --set statusmarkers|?{Conditions} --on showname --ids{target|token-id}


I've only got TokenMod and 5ed OGL in my game.
March 26 (3 years ago)


March 26 (3 years ago)

Edited March 26 (3 years ago)

You'll probably want to add all the conditions as a dropdown (otherwise if you misspell the condition it won't add the marker), and you need a space after --ids and an @ call and a _ instead of -.

!token-mod --set statusmarkers|?{Condition} --on showname --ids @{target|token_id}
!token-mod --set statusmarkers|?{Condition|Sparkle|Deafened|Concentrating|Number1} --on showname --ids @{target|token_id}
March 26 (3 years ago)


Jarren K. said:

You'll probably want to add all the conditions as a dropdown (otherwise if you misspell the condition it won't add the marker), and you need a space after --ids and an @ call and a _ instead of -.

!token-mod --set statusmarkers|?{Condition} --on showname --ids @{target|token_id}
!token-mod --set statusmarkers|?{Condition|Sparkle|Deafened|Concentrating|Number1} --on showname --ids @{target|token_id}

Sorry, I guess I should have put the whole macro. I'm definitely not typing it in every time. It's querying a dropdown then passing it.

?{Conditions|Number1::3652779|Number2::3652782|Number3::3652785|Number4::3652788|Number5::3652791|Number6::3652794|Number7::3652797|Number8::3652800|Number9::3652804|Number10::3652808|Number11::3652813|Number12::3652818|Number13::3652822|Number14::3652825|Number15::3652830|Number16::3652834|Number17::3652838|Number18::3652840|Number19::3652844|Number20::3652849|Number30::3652852|Number40::3652856|Number50::3652858|Number60::3652862|Number70::3652865|Number80::3652868|Number90::3652871|Number100::3652874|Number-1::3652877|Number-2::3652880|Number-3::3652883|Number-4::3652886|Number-5::3652889|Number-6::3652891|Number-7::3652893|Number-8::3652895|Number-9::3652897|Number-10::3652899|Number-11-31::3652901|Number-12::3652903|Number-13::3652905|Number-14::3652907|Number-15::3652909|Number-16::3652912|Number-17::3652913|Number-18::3652914|Number-19::3652915|Number-20::3652916|Number-30::3652917|Number-40::3652918|Number-50::3652919|Number-60::3652920|Number-70::3652921|Number-80::3652922|Number-90::3652923|Number-100::3652925|Biohazard::3652776|Disguised::3652777|Peace::3652780|Radiant::3652783|Radioactive::3652786|Sun::3652789|Warning::3652792|Winged_Boot::3652795|Three_Quarters_Cover::3652798|Half_Cover::3652801|Winged::3652803|Ethereal::3652806|Fish::3652811|Ghost::3652816|Goblet::3652821|Healing::3652824|HP_Reduced::3652827|Laughing::3652832|Manacles::3652835|Moon::3652837|Music::3652841|Rage::3652845|Seeing::3652848|Slowed::3652851|Sparkle::3652854|Speaking::3652857|Speed_boost::3652860|Steering::3652863|Strengthened::3652866|Swimming::3652869|Bag::3652872|Beer::3652875|Protection::3652878|Hex::3652881|Paw::3652885|Up::3652888|Double_Up::3652890|Triple_Up::3652892|Down::3652894|Double_Down::3652896|Triple_Down::3652898|Bloodied::3652900|Boot::3652902|Bubbles::3652904|Deputy::3652906|Disarmed::3652908|Plus::3652910|Minus::3652911|Check_1::3652775|Check_2::3652778|Check_3::3652781|Ex_1::3652784|Ex_2::3652787|Ex_3::3652790|Exhaustion_1::3652793|Exhaustion_2::3652796|Exhaustion_3::3652799|Exhaustion_4::3652802|Exhaustion_5::3652805|Exhaustion_6::3652810|Frightened::3652814|Grappled::3652819|Incapacitated::3652823|Invisible::3652826|Petrified::3652831|Poisoned::3652833|Prone::3652836|Restrained::3652839|Stunned::3652842|Web::3652847|Deafened::3652850|Magic_mark::3652853|Blur::3652855|Frozen::3652859|Concentrating::3652861|Marked::3652864|Strengthened::3652867|Silenced::3652870|Exclaim::3652873|Shield::3652876|Flying::3652879|Blinded::3652882|Charmed::3652884|Asleep::3652887}
!token-mod --set statusmarkers|?{Conditions} --on showname --ids{target|token-id}

The only thing it does changing the @ and _ is make me choose the token before the dropdown shows, rather than using the currently selected token. And it now puts a blank message in chat, but still creates a message.

March 26 (3 years ago)

Edited March 26 (3 years ago)

You're getting a blank line because your first query doesn't have a fake API call in front of it:

Try this:

!?{Conditions|Number1::3652779|Number2::3652782|Number3::3652785|Number4::3652788|Number5::3652791|Number6::3652794|Number7::3652797|Number8::3652800|Number9::3652804|Number10::3652808|Number11::3652813|Number12::3652818|Number13::3652822|Number14::3652825|Number15::3652830|Number16::3652834|Number17::3652838|Number18::3652840|Number19::3652844|Number20::3652849|Number30::3652852|Number40::3652856|Number50::3652858|Number60::3652862|Number70::3652865|Number80::3652868|Number90::3652871|Number100::3652874|Number-1::3652877|Number-2::3652880|Number-3::3652883|Number-4::3652886|Number-5::3652889|Number-6::3652891|Number-7::3652893|Number-8::3652895|Number-9::3652897|Number-10::3652899|Number-11-31::3652901|Number-12::3652903|Number-13::3652905|Number-14::3652907|Number-15::3652909|Number-16::3652912|Number-17::3652913|Number-18::3652914|Number-19::3652915|Number-20::3652916|Number-30::3652917|Number-40::3652918|Number-50::3652919|Number-60::3652920|Number-70::3652921|Number-80::3652922|Number-90::3652923|Number-100::3652925|Biohazard::3652776|Disguised::3652777|Peace::3652780|Radiant::3652783|Radioactive::3652786|Sun::3652789|Warning::3652792|Winged_Boot::3652795|Three_Quarters_Cover::3652798|Half_Cover::3652801|Winged::3652803|Ethereal::3652806|Fish::3652811|Ghost::3652816|Goblet::3652821|Healing::3652824|HP_Reduced::3652827|Laughing::3652832|Manacles::3652835|Moon::3652837|Music::3652841|Rage::3652845|Seeing::3652848|Slowed::3652851|Sparkle::3652854|Speaking::3652857|Speed_boost::3652860|Steering::3652863|Strengthened::3652866|Swimming::3652869|Bag::3652872|Beer::3652875|Protection::3652878|Hex::3652881|Paw::3652885|Up::3652888|Double_Up::3652890|Triple_Up::3652892|Down::3652894|Double_Down::3652896|Triple_Down::3652898|Bloodied::3652900|Boot::3652902|Bubbles::3652904|Deputy::3652906|Disarmed::3652908|Plus::3652910|Minus::3652911|Check_1::3652775|Check_2::3652778|Check_3::3652781|Ex_1::3652784|Ex_2::3652787|Ex_3::3652790|Exhaustion_1::3652793|Exhaustion_2::3652796|Exhaustion_3::3652799|Exhaustion_4::3652802|Exhaustion_5::3652805|Exhaustion_6::3652810|Frightened::3652814|Grappled::3652819|Incapacitated::3652823|Invisible::3652826|Petrified::3652831|Poisoned::3652833|Prone::3652836|Restrained::3652839|Stunned::3652842|Web::3652847|Deafened::3652850|Magic_mark::3652853|Blur::3652855|Frozen::3652859|Concentrating::3652861|Marked::3652864|Strengthened::3652867|Silenced::3652870|Exclaim::3652873|Shield::3652876|Flying::3652879|Blinded::3652882|Charmed::3652884|Asleep::3652887}
!token-mod --set statusmarkers|?{Conditions} --on showname --ids @{selected|token_id}

The default for TokenMod is the selected token, so because you had an incorrect --ids call, it was ignoring that section. 

There is also a possibility that you have a blank line somewhere in your macro. Double-check that you don't have any blank lines.

Using @{target|token_id} will force you to click on the target token.  Using @{selected|token_id} will use whichever tokens are selected.

Also, you should only need the full Status Marker ID (e.g. Number1::3652779) if there are spaces in the name. So for your examples above, you should be able to use:

 ?{Conditions|Number1|Number2|Number3| ... }
But if you've already got your macro set up then it's fine to just leave them as is.
March 26 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

The output is coming from the first line, where you select a condition and it replaces the ?{Conditions|...} block with your choices.  You're basically entering:

Number1::3652779
!token-mod --set statusmarkers|Number1::3652779 --on showname --ids @{target|token_id}

Is there a away to set night vision effect?
I looked all over the included document but was unable to find a clear answer...

March 29 (3 years ago)

Edited March 29 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

I don't believe that's been exposed to the API yet.

March 29 (3 years ago)


The Aaron said:

I don't believe that's been exposed to the API yet.

I hope that roll20 is going to expose all these things soon?! E.g. bar location and style are also not available in token-mod. And soon there will be no possibility to dodge UDL any longer. :-(


falarr87 said:


The Aaron said:


I haven't been able to duplicate this, do you have a set of steps that will cause it to happen?


Thanks for the quick reply. These are the steps that re-produce it for me:

1. Create a new character in the journal.

2. Drag new char to TT from journal.

3. Give token "Vision" and "Night Vision" (I set 60ft).

4. Save token settings and save the token as default (manually).

5. Drag the newly saved token out from the journal.

(At this stage the token should be able to see everything as expected)

6. Select the token and use: !token-mod --set defaulttoken

7. Drag a new version of the token out from the journal again.

(Now the token will see any light sources as darkness).


In case you need it, my light source is a simple torch image with Bright Light on and set to 20, and Low Light on and set to 20. All other settings on it are default.

In the page settings, the only UDL settins are DL=On and Update when Token Drop=On. Nothing is enabled in legacy lightning.



Have you had any luck with this one The Aaron?

April 04 (3 years ago)

Edited April 04 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

I just tried it and I did get the same behavior you brought up:


This is something broken on Roll20's side.  I'll pass this on to the devs, it's not something I have control over with TokenMod.


Ah I see. Well at least it's not me being stupid.


Thanks for looking into it. Let's hope they fix it soon.

April 04 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

Agree! 

April 04 (3 years ago)

I have a strange thing that happens only when I run a particular macro (and slightly different versions of it) that uses TokenMod.

Here is the macro:

!token-mod {{
--set bar1_link|hp
--set bar2_link|npc_ac
--set bar3_link|passive_wisdom
--set name|@{selected|npc_name}
--on showplayers_bar1
--on showplayers_bar2
--off showplayers_aura1
--off showplayers_aura2
--on has_bright_light_vision
}}
!ta attacks
!ta init
!token-mod --set bar1_value|@{selected|hp|max}
!token-mod --set defaulttoken
/w GM Set Up Token - for specific NPC

When I run this for the first time on a map, it works perfectly. After that, however, it fails to link bar1 properly, or at least it sets the hp to 0. It gets into this routine where the first time I run this on a token, bar1 has no link. If I then run the macro again immediately, the bar is linked properly.


Every other command in the macro seems to work properly.


I've changed the order, I've added extra lines to set the bar1 value again, but nothing seems to stop the behaviour.

April 04 (3 years ago)

Edited April 04 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

I'm not sure why that isn't working.  Is there a reason you aren't putting those two token mod commands as part of the above command?  Maybe try that and see if it works?

!token-mod {{
  --on
    showplayers_bar1
    showplayers_bar2
    has_bright_light_vision
  --off
    showplayers_aura1
    showplayers_aura2
  --set
    bar1_link|hp
    bar2_link|npc_ac
    bar3_link|passive_wisdom
    name|@{selected|npc_name}
    bar1|@{selected|hp|max}
    defaulttoken
}}
!ta attacks
!ta init
/w GM Set Up Token - for specific NPC
Side note, you can set bar1 and it will set bar1_value and bar1_max to the same thing.
April 04 (3 years ago)

The Aaron said:

I'm not sure why that isn't working.  Is there a reason you aren't putting those two token mod commands as part of the above command?  Maybe try that and see if it works?

!token-mod {{
  --on
    showplayers_bar1
    showplayers_bar2
    has_bright_light_vision
  --off
    showplayers_aura1
    showplayers_aura2
  --set
    bar1_link|hp
    bar2_link|npc_ac
    bar3_link|passive_wisdom
    name|@{selected|npc_name}
    bar1|@{selected|hp|max}
    defaulttoken
}}
!ta attacks
!ta init
/w GM Set Up Token - for specific NPC
Side note, you can set bar1 and it will set bar1_value and bar1_max to the same thing.

Thanks for the quick response!

I originally put the default token command at the very end because I forgot that the token action commands don't really care about the specific token!

I left it out though, and added the line with the max hp, in an attempt to deal with the strange behaviour I'm seeing. And still seeing with your modified macro. Very odd.






April 04 (3 years ago)

Edited April 04 (3 years ago)


Bernd S. said:


The Aaron said:

I don't believe that's been exposed to the API yet.

I hope that roll20 is going to expose all these things soon?! E.g. bar location and style are also not available in token-mod. And soon there will be no possibility to dodge UDL any longer. :-(


Feeling this .... +1

April 06 (3 years ago)
I use following macro to quickly roll and setup individual tokens with random HP and show stuff to players. Is there a way to have it roll HP individually and assign it to each token for all selected tokens?

!token-mod {{
  --on 
    showname
    showplayers_name
    showplayers_bar1
    light_hassight
  --set 
     bar2_value|@{selected|npc_ac}|
     bar1|[[@{selected|npc_hpformula}]]
     statusmarkers|-dead
}}
April 06 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

Not with TokenMod currently, but I really want to add that as a feature, I'm just not sure what the interface should be.  In the interim, how about installing this little snippet I threw together.  With it, you can set the bar you want to change to "RerollHP" and it will do the individual rolls based on the represented character:

!token-mod {{
  --on 
    showname
    showplayers_name
    showplayers_bar1
    light_hassight
  --set 
     bar2_value|@{selected|npc_ac}|
     bar1_value|RerollHP
     statusmarkers|-dead
}}

Snippet:

/* globals TokenMod */
on('ready',()=>{
    const HP_FORMULA_ATTRIBUTE = "npc_hpformula";
    const regex = /^\s*rerollhp\s*$/i;

    const checkHPReroll = (obj) => {
      let bar = regex.test(obj.get('bar1_value')) 
        ? 1
        : regex.test(obj.get('bar2_value'))
          ? 2
          : regex.test(obj.get('bar3_value'))
            ? 3
            : 0
            ;
      if( bar && obj.get('represents').length ) {
        let a = findObjs({
          type: 'attribute',
          characterid: obj.get('represents'),
          name: HP_FORMULA_ATTRIBUTE
        })[0];
        if(a){
          sendChat('',`[[${a.get('current')}]]`,(r)=>{
            obj.set({
              [`bar${bar}_value`]: r[0].inlinerolls[0].results.total,
              [`bar${bar}_max`]: r[0].inlinerolls[0].results.total
            });
          });
          
        }
      }
    };

    if('undefined' !== typeof TokenMod && TokenMod.ObserveTokenChange){
        TokenMod.ObserveTokenChange(checkHPReroll);
    }
    on("change:token", checkHPReroll);

});

April 07 (3 years ago)

Thank you so much for the quick response. As someone whose programming experience is VERRRRY limited, where do I post this code? In a new macro? As a new script for the game? In the same macro?

Sorry for my lack of skill and understanding. I'm at that point where I don't know what I don't know. I really appreciate the effort you've put in and don't want to ask more of your time.

The Aaron said:

Not with TokenMod currently, but I really want to add that as a feature, I'm just not sure what the interface should be.  In the interim, how about installing this little snippet I threw together.  With it, you can set the bar you want to change to "RerollHP" and it will do the individual rolls based on the represented character:



April 07 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

No problem.  Just put it in as a new script in a new script tab in the API Scripts section of your game.

April 08 (3 years ago)

Help! I wasn't getting response when I used TokenMod, so I decided to run the --help. I copied and pasted it from the blurb in the API script library for TokemMod to be sure I got it right. My Chat started spewing out mostly blank white space with occasional snippets. I scrolled back and forth and couldn't make sense of what was happening. I exited and restarted. Same thing, I went to API and disabled TokenMod and restarted the API sandbox. No change. I noticed that while I was in chat my icon didn't show up. When I went to journal it showed up. I opened up one of my player's character thinking to see what would happen in chat when she swung her sword. When a clicked over to chat and moved the cursor over to click on her longsword that part of her character sheet disappeared. Wherever on the sheet I moved the cursor it blanked the sheet until I just had a blank rectangle on the screen. I moved the cursor away but it remained blank until I moved back and clicked on journal again and the character sheet reappeared. Clicking on longsword while on journal gives the usual signal and switching back to chat shows the roll which was made, but when I try moving onto the character sheet again it disappears. There isn't anything magical about journal. The screen shows normal on any other choice but chat--art, compendium, jukebox, and macros. I can also swing the sword successfully on compendium, I did notice that swinging it once didn't show up, I had to swing it twice to get it to show up. I also noticed that if I scrolled around a little the icons for chat, art, journal, etc. disappeared and I had to scroll way up through long stretches of blank before they appeared. Also sometimes my quick bar shows but flashes on and off and I can see a sliver of my icon off the left side of the screen. This happened three days ago and I held off thinking that Roll20 was having trouble and it would correct when they fixed their glitch. No luck. You're my last hope to avoid cancelling. Any idea what's going on?

April 08 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

I have no idea what's going on, but if you want to PM me an invite and GM me, I'll come try and figure it out.

April 08 (3 years ago)

Thank you for your prompt response and for spending the time to solve my problem. You are The Aaron indeed!

April 08 (3 years ago)

I guess I'll be using Firefox from now on. I tried force restart several times. Then I tried clear browsing data and force restart again. Then I ran update and force restart again. Nothing fixed it. Fortunately I have Firefox to use, but I suppose the next step is deleting Chrome and reloading from scratch. I'll try that tomorrow. Thanks again for your help.

April 10 (3 years ago)

Figured it out. Apparently the chat for each player is different. You had a different chat from me, so you didn't have any problem. My chat was filled with some garbage from the failed --help that was causing the bizarre behavior. Apparently when you sign on with a different browser you get a different chat so when I signed on with Firefox everything worked. I just deleted my chat archive in Chrome and everything's back to normal. Thank you again for your help.

Is TokenMod able to support adjusting the Night Vision Effect of a token? If so, what is the syntax?

April 13 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

Night Vision Effects like sharpen are not exposed to the API currently. 

April 13 (3 years ago)
Gwar
Pro

I just pulled down 0.8.64, and am getting the following in my output API


"SyntaxError: Unexpected token '?'

    at eval (<anonymous>)

    at messageHandler (evalmachine.<anonymous>:713:6)

    at process.<anonymous> (/home/node/d20-api-server/node_modules/tiny-worker/lib/worker.js:65:55)

    at process.emit (events.js:314:20)

    at emit (internal/child_process.js:877:12)

    at processTicksAndRejections (internal/process/task_queues.js:85:21)"

April 13 (3 years ago)

Edited April 13 (3 years ago)

Hi,

i hope my question wasn't answered before. I've tried to set up a macro for a flashlight:


!token-mod {{?{Modus|Taschenlampe ein,
--on
bright_vision
emits_bright
emits_low
has_directional_bright_light

-- set
bright_distance#40
low_light_distance#20
directional_bright_light_center#90
directional_bright_light_total#50

|Taschenlampe aus,
--off
bright_vision
emits_bright
emits_low
has_directional_bright_light
}}}

However if i turn on the Flashlight ("Taschenlampe ein") the Token get's the followig settings:

It seems like the values for bright and low are added together somehow and set as lowlight value.

What can i do to toggle a flashlight thats emits 50 m bright light + 10 m low light?

Thanks in advance and regards

Jonas


April 13 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

You appear to have a space between -- and set in the above macro.  That's going to prevent it from working. Try this (bolded the line that had the issue):

!token-mod {{?{Modus|Taschenlampe ein,
--on
bright_vision
emits_bright
emits_low
has_directional_bright_light
--set
bright_distance#40
low_light_distance#20
directional_bright_light_center#90
directional_bright_light_total#50
|Taschenlampe aus,
--off
bright_vision
emits_bright
emits_low
has_directional_bright_light
}}}


April 13 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter


Gwar said:

I just pulled down 0.8.64, and am getting the following in my output API


"SyntaxError: Unexpected token '?'

    at eval (<anonymous>)

    at messageHandler (evalmachine.<anonymous>:713:6)

    at process.<anonymous> (/home/node/d20-api-server/node_modules/tiny-worker/lib/worker.js:65:55)

    at process.emit (events.js:314:20)

    at emit (internal/child_process.js:877:12)

    at processTicksAndRejections (internal/process/task_queues.js:85:21)"


That error stack isn't in a script, it's in Roll20 code.  If you restart the sandbox, everything should work.  If it doesn't, let me know and I'll help follow up.

Thanks for the fast reply. I removed the space.

However the value for "bright_distance" is still inserted to the low light value at the token settings.

If i execute the following at a token without any light settings turned on before

!token-mod --on bright_vision emits_bright emits_low --set bright_distance#40

I'm getting the following token settings:

If i didn't insert any value at "low_light_distance" the second value in the picture above should be 0?

This example is from a completly new game without any other apis running.