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

Token Mod basic questions for 5e

Hi everyone! I am trying to use some of Nick O's Token Mod scripts from his youtube tutorial.  However I'm doing something wrong.  I set up the Macro below as a token action, click, and the bars are not set properly.  When I run this script while selecting a 5E zombie, the red and blue bubbles are set to 8 (passive perception for a zombie) while the green bar is unset. I would love for 1) these bubbles to work and also 2) be able to set "whisper to no" (e.g. have all rolls visible), and finally  3) set the Nameplate feature to true and let all players see a nameplate. happy sunday and thanks! !token-mod {{ --set bright_vision|on night_vision|on night_vision_distance|30 bar1_link|hp bar2_link|ac bar3_link|passive_wisdom defaulttoken }}
1716138015
The Aaron
Roll20 Production Team
API Scripter
The token needs to be associated with a character first, something like: !token-mod {{ --set bright_vision|on night_vision|on night_vision_distance|30 represents|@{?{Character Name}|character_id} bar1_link|hp bar2_link|ac bar3_link|passive_wisdom defaulttoken }}
As a side note, you probably don't want to have hp linked to the character sheet for NPCs if you are going to have multiple NPCs at the same time. With hp linked, when you adjust the hp for one NPC, all the NPCs will have their hp adjusted if it is linked. You typically want to set the hp on the token to have the value and max for the character and unlink hp so you can edit each NPC individually. Here is a link to a Nick O video where he talks about this,  link
Thank you both! I was hoping to be able to select a group of tokens and have this script work on them all.  E.g. often I'd like to reset both character tokens but also monster tokens on a published adventure.  Any tips? thanks again
1716154738
timmaugh
Forum Champion
API Scripter
Starting with Aaron's command line above but extrapolating for "any/all tokens", if you can skip the "represents" property (since that was prompting you with a roll query), then you can do something like the below (differentiating between PC and NPC tokens): !forselected(^) token-mod {{   --set     bright_vision|on     night_vision|on     night_vision_distance|30      {^&if @^(selected.represents[none]) != none}        {^&if  @^(selected.npc_ac[pc]) = pc}         bar1_link|hp         bar2_link| ac         bar3_link| passive_wisdom       {^&else}         bar1_link|         bar2_link|         bar3_link|         bar1_value|@^(selected.hp)         bar1_max|@^(selected.hp.max)         bar2_value|@^(selected.ac)         bar2_max|@^(selected.ac.max)         bar3_value|@^(selected.passive_wisdom)         bar3_max|@^(selected.hp. passive_wisdom.max )       {^&end}     {^&end}     defaulttoken }}{& select *} That should select all tokens on the page (virtually), then increment through them testing that 1) they are associated with a character sheet, and 2) if they have an npc_ac value (if they do, they are treated as an NPC... with values for the bars instead of links. The above is air-coded, but should work. REQUIRED SCRIPTS:  Metascript Toolbox TokenMod
1716154828
timmaugh
Forum Champion
API Scripter
If you don't want to select all tokens on the page and would rather work with specifically those you have manually selected, you can remove this bit: {& select *} If you leave that in the command line, it will overwrite whatever tokens you have manually selected.