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 .
×
D&D 2024 has arrived! Pre-order the new core rulebooks now and get an exclusive pre-order bonus for free!
Create a free account

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

1681741412
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The Faces script might also help here, but I've never experimented with using it for maps.
Jarren said: Darius said: I've been looking through the info on this post and the help part. I don't see this anywhere, so it may not be possible.  I have a Rolltable with 17 images (each one is a different map). I want to be able to quickly use a macro to select one of the maps that the players are dealing with in the moment. So far the best I've found is using: !token-mod --set currentside|?+ or using the (-) sign to go down or up through the images. My best case scenario would be to either select the the side # from a drop down menu or input the value of the side to select it specifically. Is this possible? It sounds like KeithCurtis' ' Scenes Macro for Theatre of the Mind-style play ' is exactly what you're looking for.   I use it and it works quite well once you have it set up.   Also as an FYI, you don't need to keep the images in a Rollable Table if you have a Pro subscription.  You can simply add new images to a 'Scenes' character with TokenMod - add the new image to the VTT, select the current image, then run this macro and target the new image: !token-mod --set imgsrc|+@{target|token_id} --ids @{selected|token_id} The link you sent for Keith scenes macro is broken apparently... is there another post for that ?
Lionel V. said: The link you sent for Keith scenes macro is broken apparently... is there another post for that ? It’s a working link; it’s just in the Pro forum. 
1681773411

Edited 1681773458
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Jarren said: Lionel V. said: The link you sent for Keith scenes macro is broken apparently... is there another post for that ? It’s a working link; it’s just in the Pro forum.  Forgive the cross-post (it's a little out of date and could probably be updated (I don't use RollAudioMaster or the Shaped Sheet anymore, for instance): Video Demo Even if your group uses tokens and maps for evey last battle, in most role-playing games, there are going to be long stretches where tokens and maps are unnecessary. You are haggling with a merchant, having an audience with a noble, or carousing in a tavern. Some DMs just keep the screen on the last map, others devote a whole page for a large picture. This can lead to player distraction in the former case (look at those toys), or page bloat in the latter (where among my 25 scene pages is the next encounter map?) This is a method I use to solve those problems. I am posting it on the Pro forum since it requires several API scripts in order to function, notably  Token-mod , and  Roll20 Audio Master . The first is essential, the second is the seasoning. Steps 1) Collect your scenes into a table To begin with, select the scenes you are going to need. Don't worry, you can add more later. Bring them into your library and set up a rollable table with one scene per entry. Save your table and generate a rollable table token with it. 2) Create one dedicated Scenes page Make it about 30 by 20 units, turn off the grid and make the background black. This will give you a theater look. 3) Create a dummy character Call this character "Scenes". Assign the rollable token to it. Place the token on the Map layer, in the approximate center of the Scenes page. 4) Create the ability macro This is the most complex step. I usually make a google sheet to parse long macros, but the code is very repetitive and straightforward. This code will create a Roll Template menu in your chat tab, which you will use to control your scene. For this example, I use the Roll template for the D&D 5e Shaped Sheet, but the guts of the macro is just a series of repeating API buttons, one for each scene. When you have your macro, place a controlling button on your macro bar for easy access. Now, to the macro. The opening code is just a bog standard Roll Template: /w gm &{template:5e-shaped} {{title=Scenes}} The next bit (on the same line, but separated for clarity, is the button that stops whatever music is playing. You might need this if the music is too loud, wrong for the encounter or giving your trouble understanding a player with a poor connection: {{text=[STOP ALL MUSIC](!roll20AM --audio,stop,ignore|) Now comes the repeating part. You will need one of these buttons for each scene. Only four bits need to be changed for each scene. [High Harbor](!roll20AM --audio,stop,ignore| !roll20AM --audio,play,loop| Medieval City Sounds 1 hour - City by Bhaal91 !token-mod --ignore-selected --set currentside| 1 --ids @{Scenes|character_id} !token-mod --ignore-selected --set width|[[70* 22 ]] height|[[70* 14 ]] --ids @{Scenes|character_id}) Line 1  has the name of the button (likely also the name of the scene), and then tells Roll20AM to stop playing any other sounds. This is important, because you want to stop the previous scene's sound when you begin the next. The button name is the part in square brackets, all the rest of the block is contained by parenthese. Line 2  tells Roll20AM to start playing the track from your jukebox that is associated with the upcoming scene. This must be letter-for-letter, and I would advise removing any problematic characters from a track title: quotes, colons, slashes, etc. Stick with A-Z, 1-0 and spaces and you should be fine. If you do not plan on including music with your scene changes, this line can be completely deleted. Line 3  tells Token-mod to set the side to display. Remember that the first side of a rollable table token is 1  (Edit: I mistakenly reported this as 0, earlier) . This --ids part tells Token-mod to change the face for the token associated with the character "Scenes" regardless of whether it is selected. This is why we placed it on the map layer, so we wouldn't accidentally move the token around with an accidental click. You don't need to have the token selected to use the macro. Line 4  sets the dimensions of the scene. This is usually much smaller than your page size in units. I've found that it's better for players to see a small scene to zoom in on, rather than a large one to zoom out of. You can't control their zoom level. You can however shift-click to ping pull all players to the center of the scene. This part may take a little trial-and-error to get what looks and feels right to you. It's necessary to change the size of the token, because some scene images will be rectangular, while others may be square. You will note that I set the height and weight as formulas: [[70*22]] instead of just telling it 1540px. This is purely for ease of programming. I can remember 22 inches or squares or units, more easily than a 3 or 4 digit string of pixels. The scene will always resize on center, so once a player is centered, they should stay there. So from this repeating code, all you have to change in each block is four values: the  name  of the scene button, the  track  to play,  height , and  width . Create as many of these as you need. At the very end of the macro, close the whole thing off with the double curly brackets that close the roll template: }} Here is an example of the full macro with three buttons in place: /w gm &{template:5e-shaped} {{title=Scenes}} {{text=[STOP ALL MUSIC](!roll20AM --audio,stop,ignore|) [High Harbor](!roll20AM --audio,stop,ignore| !roll20AM -audio,play,loop|Medieval City Sounds 1 hour - City by Bhaal91 !token-mod --ignore-selected --set currentside|1 --ids @{Scenes|character_id} !token-mod --ignore-selected --set width|[[70*22]] height|[[70*14]] --ids @{Scenes|character_id}) [Deadwood](!roll20AM --audio,stop,ignore| !roll20AM -audio,play,loop|Deadwood Inon Zur - The Fellwood !token-mod --ignore-selected --set currentside|2 --ids @{Scenes|character_id} !token-mod --ignore-selected --set width|[[70*22]] height|[[70*14]] --ids @{Scenes|character_id}) [Sage Order](!roll20AM --audio,stop,ignore| !roll20AM --audio,play,loop|Ritual by Kevin MacLeod !token-mod --ignore-selected --set currentside|3 --ids @{Scenes|character_id} !token-mod --ignore-selected --set width|[[70*22]] height|[[70*14]] --ids @{Scenes|character_id})}} Some notes: 1) If your players need to have token macros available during Theatre of the Mind, simply place their tokens somewhere on the token layer, preferably off-cneter of the scene somewhere. They can move them where they feel comfortable. Remember, your scene is actually a huge token on the map layer. It can't be accidentally moved or disturbed. 2) If you need to add more scenes, simply add them to your scenes table. You will need to generate a fresh token and place it on the map layer like step 3 above. Make sure you assign it to the Scenes character, and the macro will automatically be there. Edit your macro to add lines of code for each new scene. This is an ability macro, so you do not need to worry about any HTML replacements. 3) Remember, the example uses the Shaped Roll template, but the buttons can be used in any roll template. You will simply need to change the header and assign the buttons to a tag that will display them. The template I used has one called" Text" which is used for free text. Look up the roll template for your chosen sheet if you are unfamiliar with it. Thanks to The Aaron, for Token-mod, and to Scott C. for Roll20 Audio Master. These folks have added a huge amount of value to my Roll20 subscription. All images shown are found with Google Image search and used for demonstration purposes only. No copyright infringement is intended.
1682056111

Edited 1682056273
CryptoCartographer
Pro
Marketplace Creator
I have some custom status markers with spaces in the names, and I can't seem to retrieve their tags so I can address them with tokenmod.  !list-sm  doesn't return any result. Is this deprecated? Edit: the tags also do not appear in TokenMod help for the default markers.
1682056655
The Aaron
Roll20 Production Team
API Scripter
!list-sm is a separate script: /* global libTokenMarkers */ on('ready', ()=>{ // Make sure libTokenMarkers exists, and has the functions that are expected if('undefined' === typeof libTokenMarkers || (['getStatus','getStatuses','getOrderedList'].find(k=> !libTokenMarkers.hasOwnProperty(k) || 'function' !== typeof libTokenMarkers[k] )) ) { // notify of the missing library sendChat('',`/w gm <div style="color:red;font-weight:bold;border:2px solid red;background-color:black;border-radius:1em;padding:1em;">Missing dependency: libTokenMarkers</div>`); } else { const c = (()=>{ let last = '#eeeeff'; return () => { last = ('#eeeeff' === last ? '#eeffee' : '#eeeeff'); return last; }; })(); const fmtMarker = (m)=>`<div style="background-color: ${c()}; border: 1px solid #aaa; padding: .1em;">${m.getHTML(3,"float:left;")}<div style="float:left"><b>${m.getName()}</b><br><code>${m.getTag()}</code></div><div style="clear:both;"></div></div>`; // Watch for chat messages on('chat:message',(msg) => { // when `!set-sm` occurs, do something if('api'===msg.type && /^!list-sm(\b\s|$)/i.test(msg.content)){ let who = (getObj('player',msg.playerid)||{get:()=>'API'}).get('_displayname'); // get all the markers that match the first argument let markers = libTokenMarkers .getOrderedList() .map(fmtMarker) .join(''); sendChat('All TokenMarkers',`/w "${who}" <div style="background-color:#ccc;">${markers}</div>`); } }); } }); If that doesn't show them, you can PM me a join link to your game and GM me and I can try and sort out what's going on.
1682060313
CryptoCartographer
Pro
Marketplace Creator
Got it. That worked. Thanks! The Aaron said: !list-sm is a separate script
1683092546
Critical Tavern
Pro
Marketplace Creator
Translator
This was working before, but now it isn't. Anyone know what I can do? !token-mod --set aura1_color|transparent --set aura2_color|transparent I use it to erase auras from things transmografied after using Token Aura mods.
1683124624
The Aaron
Roll20 Production Team
API Scripter
That's really peculiar.  I tried it just now and it didn't work, but when I started messing with testing it, it did.  At a minimum, some alternatives are: Set it to nothing !token-mod --set aura1_color| aura2_color| Set the radius to 0 !token-mod --set aura1_radius|0 aura2_radius|0
1683132181
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
IIRC, !token-mod --set aura1_radius|0 aura2_radius| is different from !token-mod --set aura1_radius|0 aura2_radius|0 Has this changed?
1683135417
The Aaron
Roll20 Production Team
API Scripter
Oh, that's a good point.  It would be better to use: !token-mod --set aura1_radius| aura2_radius| Which turns off the aura, rather than 0 which just makes the aura the same size as the token.  If you're using a standard round pog token, you wouldn't see any difference as the aura is under the token, but a transparent token would let you see aura beneath it:  
I'm new to using this mod, which I love so far. I am trying to setup the Wildshape macro that was described in the video. It mostly works, but I think I am missing something (I really wish this entire thread was searchable - I'm betting you've already answered it before - apologies, if so). When I select a wildshape from the prompt, it does link to the hp, ac, and speed attributes on the correct creature, but I lose the current HP that shows in the circle (max gets set fine) and then the AC and Speed should actually be npc_ac and npc_speed for the monster sheets, so those do not update correctly. I'm thinking I have to add a bit more to the macro, but... I currently have: !token-mod {{ --set ?{Choose Form|Graydon,currentside#1 represents#@{Graydon|character_id} width#[[70]] height#[[70]] |Ape,currentside#2 represents#@{WS-Ape|character_id} width#[[70]] height#[[70]] |Brown Bear,currentside#3 represents#@{WS-Brown Bear|character_id} width#[[2*70]] height#[[2*70]] |Dire Wolf,currentside#4 represents#@{WS-Dire Wolf|character_id} width#[[2*70]] height#[[2*70]] |Panther,currentside#5 represents#@{WS-Panther|character_id} width#[[70]] height#[[70]] } bar1_link|hp bar2_link|ac bar3_link|speed name|"Graydon"
1684603134
The Aaron
Roll20 Production Team
API Scripter
Hmm.  You are missing the }} at the end, but that shouldn't cause the bars to fail to update with their values.  I think someone else was having problems with this and there may be a bug in play.  I'll do some testing.
That was my cut/paste error - actual macro does have the }} at the end. My goal is to set the bars to hp (and max_hp), npc_ac, and npc_speed when selecting an NPC (monster) and the hp, ac, and speed when resetting to the PC sheet, if that's possible. FWIW, I'm using the standard 5e D&D sheet - I mostly use stuff out of the box - this is my only API usage.
I was having that problem several months ago; My issue TheAaron's suggestion to use version 0.8.74 from Github My results Basically, 0.8.74 fixed the issue except for Bar 3
1684625530
The Aaron
Roll20 Production Team
API Scripter
Thanks for tracking that down, Doug E.  That's really peculiar because bar3 isn't treated any differently in TokenMod than the other bars.  I just checked the code again and verified they are all the same.  I'm going to have to see if I can create a repeatable case and get it to the devs.
I deleted the script from my game and added 0.8.74, which corrected the problem in which monster stats got written back to the PCs sheet. It also accurately set the ac. What I had to tweak on each monster sheet to make the rest work: Monster sheets' 'hp' attribute is set to (blank)/max-hp (e.g., blank/15). I added the hp to the first part of the attribute (current), e.g., 15/15. Monster sheets have a npc_speed attribute but no speed attribute. I created a speed attribute and plugged in the value of the npc_speed. Now everything is working as desired. I never really understood why Roll20 has separate npc_speed and speed or sometimes npc_ac and ac. I'm guessing you'd need to inspect the target sheet to determine if it is an npc and, if so, use the npc attributes? Thank you both for your help.
1684638831
Andrew R.
Pro
Sheet Author
I’ll bet you can find an Attribute that tells you that it’s an NPC sheet. The Character Sheet will use it to display the correct tab / pane. 
I'm having the same problem as  this here  where once I revert back to the Druid all the bubbles are messed up and it changes the info on the sheet to match the messed up bubbles. I'm running 8.74 like was suggested.
1685915784
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Steven C. said: I never really understood why Roll20 has separate npc_speed and speed or sometimes npc_ac and ac. I'm guessing you'd need to inspect the target sheet to determine if it is an npc and, if so, use the npc attributes? This technique is employed because PC AC (for example) is figured, but NPC AC is arbitrary. I.e. NPC statblocks have whatever AC the designer saw fit to give it. PCs have AC dependent based on dexterity, armor, class abilities, race abilities and so on. There are many cases like this. At first, I thought this was really annoying, especially when writing scripts that work off those values. It's still annoying, but I understand why it is the way it is.
It looks like you got it from One-click. Try adding the script from the Github Master Azroth said: I'm having the same problem as  this here  where once I revert back to the Druid all the bubbles are messed up and it changes the info on the sheet to match the messed up bubbles. I'm running 8.74 like was suggested.
Doug E. said: It looks like you got it from One-click. Try adding the script from the Github Master Azroth said: I'm having the same problem as  this here  where once I revert back to the Druid all the bubbles are messed up and it changes the info on the sheet to match the messed up bubbles. I'm running 8.74 like was suggested. That fixed everything thank you. It even works with MonsterHitDice
First time posting and it's probably easy - but I am not a scripter and this is driving me mad. I know the --report function is experimental, but I expect it should work better than this. Trying to do a simple drop down for Status markers for tokens that will also send a message about that status marker. !token-mod ?{Status|Blind, --set statusmarkers#Blind::243718 --report control#"A blinded creature cannot see and automatically fails any ability check that requires sight. Attack rolls against the creature have advantage, and the creature's attack rolls have disadvantage."|Charmed, --set statusmarkers#Charmed::243720|Deafened, --set statusmarkers#Deafened::243729|Frightened, --set statusmarkers#Frightened::243759|Grappled, --set statusmarkers#Grappled::243762|Incapacitated, --set statusmarkers#Incapacitated::243777|Invisible, --set statusmarkers#Invisible::243781|Paralyzed, --set statusmarkers#Paralyzed::243784|Petrified, --set statusmarkers#Petrified::243787|Poisoned, --set statusmarkers#Poison::243793|Prone, --set statusmarkers#101-KnockedDown::5818047|Restrained, --set statusmarkers#601-Entangled-Grappled::5818089|Stunned, --set statusmarkers#Stunned::243815|Unconscious, --set statusmarkers#Unconscious::243821|Clear All, --set statusmarkers#=blue#-blue} All the drop down options work and all of the icons mark appropriately, but the --report responds with (From: ) A   and goes no further. I've tried: Using spaces Using html code for spaces Removing the apostrophe from within the quote Separating the items to different lines Adding {{ before ?{Status and }} at the very end I'm considering trying to call a macro instead of the --report text but I don't know how to do that (yet). Also, I don't have the macro made for the status reports. I would ask if anyone has any suggestions? Thank you!
WAIT! I think I may have it - I had to replace the # after control  with the html code for # ( # ) - And now it works!  However, what I have discovered - * words * in the text makes it italicized. Certain html codes (such as ∙ (for a leading dot) work, but the carriage return/enter html code has no effect. I still can't figure out how to call a macro that I have formatted in place of the text  (--report control# put macro here ) I'd love for that first option (Blind) to call:  &{template:desc} {{desc=**Blinded:**  * A blinded creature can't see and automatically fails any ability check that requires sight. * Attack rolls against the creature have advantage and the creature's attack rolls have disadvantage. }} Still, I have functioning --report action and I'm happy! !token-mod ?{Status |Blind, --set statusmarkers#Blind::243718 --report control # "A blinded creature can't see and automatically fails an ability check that requires sight. Attack rolls against the creature have advantage and the creature's attack rolls have disadvantage."  |Charmed, --set statusmarkers#Charmed::243720 --report control#" (etc., etc.) Lee said: First time posting and it's probably easy - but I am not a scripter and this is driving me mad. I know the --report function is experimental, but I expect it should work better than this. Trying to do a simple drop down for Status markers for tokens that will also send a message about that status marker. !token-mod ?{Status|Blind, --set statusmarkers#Blind::243718 --report control#"A blinded creature cannot see and automatically fails any ability check that requires sight. Attack rolls against the creature have advantage, and the creature's attack rolls have disadvantage."|Charmed, --set statusmarkers#Charmed::243720|Deafened, --set statusmarkers#Deafened::243729|Frightened, --set statusmarkers#Frightened::243759|Grappled, --set statusmarkers#Grappled::243762|Incapacitated, --set statusmarkers#Incapacitated::243777|Invisible, --set statusmarkers#Invisible::243781|Paralyzed, --set statusmarkers#Paralyzed::243784|Petrified, --set statusmarkers#Petrified::243787|Poisoned, --set statusmarkers#Poison::243793|Prone, --set statusmarkers#101-KnockedDown::5818047|Restrained, --set statusmarkers#601-Entangled-Grappled::5818089|Stunned, --set statusmarkers#Stunned::243815|Unconscious, --set statusmarkers#Unconscious::243821|Clear All, --set statusmarkers#=blue#-blue} All the drop down options work and all of the icons mark appropriately, but the --report responds with (From: ) A   and goes no further. I've tried: Using spaces Using html code for spaces Removing the apostrophe from within the quote Separating the items to different lines Adding {{ before ?{Status and }} at the very end I'm considering trying to call a macro instead of the --report text but I don't know how to do that (yet). Also, I don't have the macro made for the status reports. I would ask if anyone has any suggestions? Thank you!
So, this mostly  works. And it's the parts that do not that have me thoroughly confused. From the drop down that this creates, Grappled  and  Petrified  do not print any text. However, Blind, Charmed, Deafened, Frightened, etc all function exactly as expected. I have gone over and over this and I don't see what is wrong!  All of the selections (including the faulty lines) create the appropriate status markers (I have a custom list, so I apologize in advance if anyone wants try and test this). But those two specific lines do not print anything for the --report command.  For reference, this is a test game/sandbox I have which only has the following APIs loaded: ChatSetAttr, TableExport, TokenMod (obviously), 5th Edition OGL by Roll20 Companion, and one manually loaded script called Twins (also by The Aaron). The sandbox does not throw any errors that I've seen while I've been testing this.  Thanks in advance to anyone who can help! !token-mod ?{Status|Blind, --set statusmarkers#Blind::243718 --report control#"∙ A blinded creature can't see and automatically fails any ability check that requires sight. ∙ Attack rolls against the creature have advantage and the creature's attack rolls have disadvantage." |Charmed, --set statusmarkers#Charmed::243720 --report control#"∙ A charmed creature can't attack the charmer or target the charmer with harmful abilities or magical effects. ∙ The charmer has advantage on any ability check to interact socially with the creature." |Deafened, --set statusmarkers#Deafened::243729 --report control#"A deafened creature can't hear and automatically fails any ability check that requires hearing." |Frightened, --set statusmarkers#Frightened::243759 --report control#"∙ A frightened creature has disadvantage on ability checks and attack rolls while the source of its fear is within line of sight. ∙ The creature can't willingly move closer to the source of its fear." |Grappled, --set statusmarkers#Grappled::243762 --report control#"∙ A grappled creature's speed becomes 0 and it can't benefit from any bonus to its speed. ∙ The condition ends if the grappler is incapacitated (An incapacitated creature can't take actions or reactions) ∙ The condition also ends if an effect removes the grappled creature from the reach of the grappler or grappling effect, such as when a creature is hurled away by a thunderwave spell." |Incapacitated, --set statusmarkers#Incapacitated::243777 --report control#"An incapacitated creature can't take actions or reactions." |Invisible, --set statusmarkers#Invisible::243781 --report control#"∙ An invisible creature is impossible to see without the aid of magic or a special sense. For the purpose of hiding - the creature is heavily obscured. The creature's location can be detected by any noise it makes or any tracks it leaves. ∙ Attack rolls against the creature have disadvantage and the creature's attack rolls have advantage." |Paralyzed, --set statusmarkers#Paralyzed::243784 --report control#"∙ A paralyzed creature is incapacitated (An incapacitated creature can't take actions or reactions) and can't move or speak. ∙ The creature automatically fails strength and dexterity saving throws. ∙ Attack rolls against the creature have advantage. ∙ Any attack that hits the creature is a critical hit if the attacker is within 5ft of the creature." |Petrified, --set statusmarkers#Petrified::243787 --report control#"∙ A petrified creature is transformed- along with any nonmagical object it is wearing or carrying - into a solid, inanimate substance(usually stone). Its weight increases by a factor of ten and it ceases aging. ∙ The creature is incapacitated (An incapacitated creature can't take actions or reactions) - can't move or speak - and is unaware of its surroundings. ∙ Attack rolls against the creature have advantage. ∙ The creature automatically fails strength and dexterity saving throws. ∙ The creature has resistance to all damage. ∙ The creature is immune to poison and disease - although a poison or disease already in its system is suspended and not neutralized." |Poisoned, --set statusmarkers#Poison::243793 --report control#"A poisoned creature has disadvantage on attack rolls and ability checks." |Prone, --set statusmarkers#101-KnockedDown::5818047 --report control#"∙ A prone creature's only movement option is to crawl unless it stands up and thereby ends the condition. ∙ The creature has disadvantage on attack rolls. ∙ An attack roll against the creature has advantage if the attacker is within 5ft of the creature and otherwise the attack roll has disadvantage." |Restrained, --set statusmarkers#601-Entangled-Grappled::5818089 --report control#"∙ A restrained creature's speed becomes 0 and it can't benefit from any bonus to its speed. ∙ Attack rolls against the creature have advantage and the creature's attack rolls have disadvantage. ∙ The creature has disadvantage on dexterity saving throws." |Stunned, --set statusmarkers#Stunned::243815 --report control#"∙ A stunned creature is incapacitated (An incapacitated creature can't take actions or reactions) - can't move - and can speak only falteringly. ∙ The creature automatically fails strength and dexterity saving throws. ∙ Attack rolls against the creature have advantage." |Unconscious, --set statusmarkers#Unconscious::243821 --report control#"∙ An unaware creature is incapacitated (An incapacitated creature can't take actions or reactions) - can't move or speak - and is unaware of its surroundings. ∙ The creature drops whatever it's holding and falls prone. ∙ The creature automatically fails strength and dexterity saving throws. ∙ Attack rolls against the creature have advantage. ∙ Any attack that hits the creature is a critical hit if the attacker is within 5ft of the creature." |Clear All, --set statusmarkers#=blue#-blue}
1689724833

Edited 1689724925
The Aaron
Roll20 Production Team
API Scripter
Sorry for the late reply, I somehow missed your messages.  I don't know why it's happening, but I know what the issue is.  For some reason, when that command passes through the Roll Query, it is stripping the closing " from the command.  If you just run the command directly: !token-mod --set statusmarkers#pink --report control#"• A grappled creature's speed becomes 0 and it can't benefit from any bonus to its speed. • The condition ends if the grappler is incapacitated (An incapacitated creature can't take actions or reactions) • The condition also ends if an effect removes the grappled creature from the reach of the grappler or grappling effect, such as when a creature is hurled away by a thunderwave spell." It works, but if you run it through the Roll Query: !token-mod ?{test|foo,--set statusmarkers#pink --report control#"• A grappled creature's speed becomes 0 and it can't benefit from any bonus to its speed. • The condition ends if the grappler is incapacitated (An incapacitated creature can't take actions or reactions) • The condition also ends if an effect removes the grappled creature from the reach of the grappler or grappling effect, such as when a creature is hurled away by a thunderwave spell."|bar,test} The output is: !token-mod --set statusmarkers#pink --report control#"• A grappled creature's speed becomes 0 and it can't benefit from any bonus to its speed. • The condition ends if the grappler is incapacitated (An incapacitated creature can't take actions or reactions) • The condition also ends if an effect removes the grappled creature from the reach of the grappler or grappling effect (No trailing " ) You can actually add the " at the end, after the Roll Query: !token-mod ?{test|foo,--set statusmarkers#pink --report control#"• A grappled creature's speed becomes 0 and it can't benefit from any bonus to its speed. • The condition ends if the grappler is incapacitated (An incapacitated creature can't take actions or reactions) • The condition also ends if an effect removes the grappled creature from the reach of the grappler or grappling effect, such as when a creature is hurled away by a thunderwave spell."|bar,test}" And that will let it run.  Very peculiar. Something like: !token-mod ?{Status|Blind, --set statusmarkers#Blind --report control#"∙ A blinded creature can't see and automatically fails any ability check that requires sight. ∙ Attack rolls against the creature have advantage and the creature's attack rolls have disadvantage." |Charmed, --set statusmarkers#Charmed --report control#"∙ A charmed creature can't attack the charmer or target the charmer with harmful abilities or magical effects. ∙ The charmer has advantage on any ability check to interact socially with the creature." |Deafened, --set statusmarkers#Deafened --report control#"A deafened creature can't hear and automatically fails any ability check that requires hearing." |Frightened, --set statusmarkers#Frightened --report control#"∙ A frightened creature has disadvantage on ability checks and attack rolls while the source of its fear is within line of sight. ∙ The creature can't willingly move closer to the source of its fear." |Grappled, --set statusmarkers#Grappled --report control#"∙ A grappled creature's speed becomes 0 and it can't benefit from any bonus to its speed. ∙ The condition ends if the grappler is incapacitated (An incapacitated creature can't take actions or reactions) ∙ The condition also ends if an effect removes the grappled creature from the reach of the grappler or grappling effect, such as when a creature is hurled away by a thunderwave spell." |Incapacitated, --set statusmarkers#Incapacitated --report control#"An incapacitated creature can't take actions or reactions." |Invisible, --set statusmarkers#Invisible --report control#"∙ An invisible creature is impossible to see without the aid of magic or a special sense. For the purpose of hiding - the creature is heavily obscured. The creature's location can be detected by any noise it makes or any tracks it leaves. ∙ Attack rolls against the creature have disadvantage and the creature's attack rolls have advantage." |Paralyzed, --set statusmarkers#Paralyzed --report control#"∙ A paralyzed creature is incapacitated (An incapacitated creature can't take actions or reactions) and can't move or speak. ∙ The creature automatically fails strength and dexterity saving throws. ∙ Attack rolls against the creature have advantage. ∙ Any attack that hits the creature is a critical hit if the attacker is within 5ft of the creature." |Petrified, --set statusmarkers#Petrified --report control#"∙ A petrified creature is transformed- along with any nonmagical object it is wearing or carrying - into a solid, inanimate substance(usually stone). Its weight increases by a factor of ten and it ceases aging. ∙ The creature is incapacitated (An incapacitated creature can't take actions or reactions) - can't move or speak - and is unaware of its surroundings. ∙ Attack rolls against the creature have advantage. ∙ The creature automatically fails strength and dexterity saving throws. ∙ The creature has resistance to all damage. ∙ The creature is immune to poison and disease - although a poison or disease already in its system is suspended and not neutralized." |Poisoned, --set statusmarkers#Poison --report control#"A poisoned creature has disadvantage on attack rolls and ability checks." |Prone, --set statusmarkers#101-KnockedDown --report control#"∙ A prone creature's only movement option is to crawl unless it stands up and thereby ends the condition. ∙ The creature has disadvantage on attack rolls. ∙ An attack roll against the creature has advantage if the attacker is within 5ft of the creature and otherwise the attack roll has disadvantage." |Restrained, --set statusmarkers#601-Entangled-Grappled --report control#"∙ A restrained creature's speed becomes 0 and it can't benefit from any bonus to its speed. ∙ Attack rolls against the creature have advantage and the creature's attack rolls have disadvantage. ∙ The creature has disadvantage on dexterity saving throws." |Stunned, --set statusmarkers#Stunned --report control#"∙ A stunned creature is incapacitated (An incapacitated creature can't take actions or reactions) - can't move - and can speak only falteringly. ∙ The creature automatically fails strength and dexterity saving throws. ∙ Attack rolls against the creature have advantage." |Unconscious, --set statusmarkers#Unconscious --report control#"∙ An unaware creature is incapacitated (An incapacitated creature can't take actions or reactions) - can't move or speak - and is unaware of its surroundings. ∙ The creature drops whatever it's holding and falls prone. ∙ The creature automatically fails strength and dexterity saving throws. ∙ Attack rolls against the creature have advantage. ∙ Any attack that hits the creature is a critical hit if the attacker is within 5ft of the creature." |Clear All, --set statusmarkers#=blue#-blue}"
1689725379
The Aaron
Roll20 Production Team
API Scripter
Update v0.8.76 -- I was watching Nick Olivo's very excellent video on Custom Status Markers , part of which he devoted to using TokenMod.  He highlighted a few pain points, and that prompted me to fix them.  =D I've added a few new commands: !token-mod --help-statusmarkers This just whispers back to chat the listing of Status Markers, as it appears in the help.  Very handy for looking up the names/tags for the markers in the game. !token-mod --rebuild-help When new Custom Status Markers are added to the game, the help handout isn't updated.  This command will reconstruct the help handout.  Note that you'll need to refresh the game client when you add Custom Status Markers to see them on tokens, and also before you run this command to reconstruct the handout. Additionally, I've improved the method for clearing all Status Markers.  Originally, you'd clear them by setting a specific one, then removing it, as: !token-mod --set statusmarkers|=blue|-blue That was always a bit of a hack based on how the status markers were parsed.  I've now set it so you can set them to nothing to clear all of them: !token-mod --set statusmarkers|= That saves a bit of typing and is cleaner with regard to the meaning.  You can still use the old way, so this shouldn't break anyone.  Thanks for the great video Nick!
Thanks for always improving, Aaron! :D
1689772485
Nick O.
Forum Champion
Thanks, Aaron!
Tried updating some tokens' avatars with an image I'd uploaded, but it's not working and I am getting the "ERROR: You cannot set the imgsrc or avatar of an object unless you use an image that is in your Roll20 Library. See the API documentation for more info." error message in the API log. It's the same sort of call I've made a bunch before. Any idea why it's not working today? (Mod Library install, Latest, presumably 0.8.77)
1690779523
The Aaron
Roll20 Production Team
API Scripter
You can only set images with the API if they are in a user library (something uploaded by dragging to the map).  You're trying to set something from the marketplace.  To do that, you'd need to download the image (Z and right click, save as) and re-upload it first.
I get that. The images I was attempting to use were ones I had literally just uploaded, however, not Marketplace resources. The Aaron said: You can only set images with the API if they are in a user library (something uploaded by dragging to the map).  You're trying to set something from the marketplace.  To do that, you'd need to download the image (Z and right click, save as) and re-upload it first.
1690818301
The Aaron
Roll20 Production Team
API Scripter
Hmm.  That's peculiar.  Can you post (or PM if you prefer) the url for the image you're trying to set that is causing that error to pop up?
Is there a way to set up a query for how many targets can be selected to apply status markers? For example, i have a bless macro that applies an icon to tokens and setting it up like this works: !token-mod   --set statusmarkers|!regen-blue;;6187535  --ids @{target|1|token_id}  @{target|2|token_id}  @{target|3|token_id}  but when I tried to add a query for a level like below, it goes straight to prompting the selection of the max number of tokens in the query (so in this example i'm prompted for four tokens right away) before allowing me to select the spell level: !token-mod  --set statusmarkers|!regen-blue;;6187535  --ids ?{Spell Level?|1, @{target|1|token_id} @{target|2|token_id} @{target|3|token_id}|2, @{target|1|token_id} @{target|2|token_id} @{target|3|token_id} @{target|4|token_id}} It works like this. If you select 1st level in the dropdown, it only applies to the first three selected tokens but you have to click through all the targets. If I can get it to limit the target selection just to the ones relative to the spell level in the list that would be awesome.
1691211070
The Aaron
Roll20 Production Team
API Scripter
There's not a great way to do that with a query, but I don't think you need to generally.  You can supply as many levels of token ids as you would ever need, but for fewer, just finish out all the clicks on the last token.  So for example, if you prompted for 5 tokens to bless, you could just click token A once, token B once, and then click token C 3 times to use up the rest of the 5 prompts.  It will only apply to the unique tokens selected, ignoring the extra 2 token C ids.
1691218799
Andrew R.
Pro
Sheet Author
I would bet that a MetaScript can help with that. 
1691248181

Edited 1691248230
timmaugh
Pro
API Scripter
Metascript interaction with targeting/query syntax gets tricky because metascripts can only get involved after Roll20 has finished parsing the message (including queries/targeting). That means that a true metascript solution wouldn't get you around still having to click through all of the targeting registrations. At best, you could do global variables for the various target groups, then reference the targeted set with a query: {&global ([OneTarget]@{target|1|token_id}) ([TwoTargets]@{target|1|token_id}, @{target|2|token_id})  ([ThreeTargets]@{target|1|token_id} , @{target|2|token_id} , @{target|3|token_id} ) } ...then, elsewhere... ?{Spell Level|1,OneTarget|2,TwoTargets|3,ThreeTargets|} However, that's not terribly different from what you already have going on. InsertArg Option Another option would be to use InsertArg. IA acts like a command line pre-amp script, and was the progenitor of the metascripts. One thing it can do is to build a command line with a flexible number of targeting statements... that is, you start with an IA command line with a query asking you how many targeting statements you want, then the query places the proper IA verbiage so that those targeting statements are constructed in the correct place in the NEW command line that is output (probably as a button in the chat output). Then you'd click that button to run the new, ad hoc command line... and you'd get prompted with the proper number of targets. IA has a pretty stiff learning curve, and the above process is bit of a long way to go about things, especially if this would be the only reason and the only instance where you'd need IA. But, if you're interested, I can offer options (I'd suggest starting a new thread so as to not clutter the TokenMod thread). SelectManager Option (Different Workflow) Finally, one other option that will soon be available would involve a bit of a different approach (which might not work for this instance). SelectManager is getting (with next week's 1-click merge) the ability to do criteria-based selection. For instance, even now you can do wildcard selection of tokens based around their names (ie, "GoblinArmy*" would get all tokens on the page whose name began: "GoblinArmy..."). With the new update, you will be able to require things like bar values, aura presence/radius/color, status marker presence/value, attribute presence/value (for a token-representing a character), gmnotes, tooltip, etc. Again, acknowledging this would be a different approach, if you were able to pre-designate the tokens somehow (by marker, tooltip, or gmnotes -- probably using TokenMod to apply the designation), then you could pick that group fairly easily. For instance, if you marked them with the statusmarker "Targeted", then you could select them in the TokenMod line like this: !token-mod   --set statusmarkers|!regen-blue;;6187535 {&select *, +Targeted} In fact, you could then have extra verbiage in that command line that was contained within a query asking you if you wanted to ALSO remove the Targeted status marker. If you answer "Yes" (maybe you intend to target a different group in your next attack), it inserts TokenMod verbiage to remove the marker. If you answer "No" (as if you intended to target the same group), it does not include the removal verbiage. If I were to do this, I would probably have a macro bar (or token action bar) button that was a TokenMod command line to apply the Targeted marker to a single token (or maybe 2 tokens, to save time -- and I would click on the same token twice if I only needed to apply it to a single token). Then, prior to my attack, I would click the button (and target a token or pair of tokens) until my targets were designated. Then I would run the TokenMod command that targeted all tokens marked with the Targeted marker (the example provided, just above)... and I would have that command line hard-coded to remove the Targeted status marker at the same time. I wouldn't find it too burdensome to designate my targets every time... even if I had to click a button before clicking the target token. But that's just me. Again, this functionality (selecting via criteria) is coming with the next 1-click merge).
1691273495
The Aaron
Roll20 Production Team
API Scripter
Lady Victoria said: Tried updating some tokens' avatars with an image I'd uploaded, but it's not working and I am getting the "ERROR: You cannot set the imgsrc or avatar of an object unless you use an image that is in your Roll20 Library. See the API documentation for more info." error message in the API log. It's the same sort of call I've made a bunch before. Any idea why it's not working today? (Mod Library install, Latest, presumably 0.8.77) Ok, I've tracked this down.&nbsp; The issue is a change in the URLs that are used to show images using Z when you select a token.&nbsp; When you copy those URLs, you'll get something like: <a href="https://files.d20.io/images/343644296/ap9Q6-nX330cJQlGxqL3rQ/original.png?16852128175" rel="nofollow">https://files.d20.io/images/343644296/ap9Q6-nX330cJQlGxqL3rQ/original.png?16852128175</a> Where you used to get: https:// s3.amazonaws.com/ files.d20.io/images/343644296/ap9Q6-nX330cJQlGxqL3rQ/original.png?16852128175 (note the bold part) For now, you can get around this issue by adding that part back to the URL before passing it to a script.&nbsp; I spoke with the devs and they should get this fixed next week.&nbsp; I'm also going to add some checking to my scripts that take image urls, but that's quite a few, so might be a slow roll to get them out.
1692472903

Edited 1692964972
I may be missing something simple but i'm really struggling with using token-mod to set a bar value to call a character sheet macro: I have a chain of macros and rolltables that create all the info i need for a random trap. First macro populates bar1,2,3 values and max' with numbers for DC of disarming/discovering/damage dealt by trap, as well as descriptions of trap triggers and actual traps. the second macro calls whatever is in said bar values and max' as a roll template that details everything about the trap. Almost everything is working great, although it's taken me a while to get to this point lol, the issue i'm hitting is one of the possible triggers for said trap is answering a riddle incorrectly, supplying the riddle is handled by another macro that uses a rolltable to pick a random riddle. SO in that one instance the text in the bar value includes a chat menu button that calls a separate macro that supplies the riddle but it isn't working. things i've tried: riddle trigger: Got [riddle](~riddle)wrong - doesn't keep connection to character sheet where "-J-" is name of my macro holder character sheet: Got [riddle](~-J-|riddle)wrong pipe is processed by token-mod so whole thing breaks down Got [riddle](~-J-&amp;#124;riddle)wrong hashmark is processed by token-mod so whole thing breaks down. Got [riddle](!&amp;#13;%{-J-|riddle})wrong same issue as above with hashmark Got [riddle](`&amp;#37;{-J-|riddle}) wrong as above Sorry if this doesn't make sense, i can post all my work if thats better but i hoped just this bit would show where my problem is and soemone could just point out where i'm being stupid.
issue with Macro launching tokenmod macros hi i have done a macro that should launch different tokenmod based on selection ?{night vision?|300,#tm-vision_night_300 |60, #tm-vision_night_60 |NO,!tokenmod --off night_vision} that should launch similar macros, one being !token-mod --on bright_vision night_vision --set night_vision_distance#300 night_vision_tint#RGB(204,229,255) i tested it once and it worked fine then on second lounch in the option prompt i do not get 300, 60, NO but RGB(204,229,255) as a seggested text input and obviously breaks. any clue on what i could be doing wrong thanks Andrea
1694627526
timmaugh
Pro
API Scripter
I think you're running into problems with how the query is getting parsed by Roll20 (characters from the included macros breaking the query). You can spend time making HTML replacements in your macros, but then you won't be able to run them ON THEIR OWN -- not embedded in a roll query. You could also turn this statement into a chat menu , which is a viable option. Another option would be to add the MetaScriptToolbox script, and change your command line to be: !?{night vision?|300,#(tm-vision_night_300) |60,#(tm-vision_night_60) |NO,!tokenmod --off night_vision} That should handle each item in the list correctly, no matter what you pick. Also, it will allow you to still run your macros independently of being in a roll query.
1694655215
The Aaron
Roll20 Production Team
API Scripter
lark86 said: I may be missing something simple but i'm really struggling with using token-mod to set a bar value to call a character sheet macro: I have a chain of macros and rolltables that create all the info i need for a random trap. First macro populates bar1,2,3 values and max' with numbers for DC of disarming/discovering/damage dealt by trap, as well as descriptions of trap triggers and actual traps. the second macro calls whatever is in said bar values and max' as a roll template that details everything about the trap. Almost everything is working great, although it's taken me a while to get to this point lol, the issue i'm hitting is one of the possible triggers for said trap is answering a riddle incorrectly, supplying the riddle is handled by another macro that uses a rolltable to pick a random riddle. SO in that one instance the text in the bar value includes a chat menu button that calls a separate macro that supplies the riddle but it isn't working. things i've tried: riddle trigger: Got [riddle](~riddle)wrong - doesn't keep connection to character sheet where "-J-" is name of my macro holder character sheet: Got [riddle](~-J-|riddle)wrong pipe is processed by token-mod so whole thing breaks down Got [riddle](~-J-&amp;#124;riddle)wrong hashmark is processed by token-mod so whole thing breaks down. Got [riddle](!&amp;#13;%{-J-|riddle})wrong same issue as above with hashmark Got [riddle](`&amp;#37;{-J-|riddle}) wrong as above Sorry if this doesn't make sense, i can post all my work if thats better but i hoped just this bit would show where my problem is and soemone could just point out where i'm being stupid. I think I'm going to need more information.&nbsp; Depending on how you are executing the macros, the changes to the bar may not have taken place in the API yet.
1694680841

Edited 1694680958
The Aaron said: lark86 said: I may be missing something simple but i'm really struggling with using token-mod to set a bar value to call a character sheet macro: [... see original post ...] Sorry if this doesn't make sense, i can post all my work if thats better but i hoped just this bit would show where my problem is and soemone could just point out where i'm being stupid. I think I'm going to need more information.&nbsp; Depending on how you are executing the macros, the changes to the bar may not have taken place in the API yet. ok you asked for it lol (thanks): Macro that sets up trap: * It gets the trap and trigger descriptions from a selection of roll tables depending on the type of trap. !token-mod {{ --set bar1_current|[[?{difficulty?|random,[[3d4+8]]|easy,11|medium,14|hard,17|deadly,20}+1d4-1d2]] bar2_current|[[1d4+1d6+?{difficulty?}]] bar3_current|[[1d4+1d6+?{difficulty?}]] bar1_max|[[floor(?{difficulty?}/3.3)-2]] bar2_max|"[[1t[traps-?{type?|all|door|floor|container}]]]" bar3_max|"[[1t[triggers-?{type?}]]]" }} Macro that then activates trap: *roll template that pulls everything from the token that was set as the trap &amp;{template:dmg} {{save=1}} {{savedc=@{selected|bar1}}} {{saveattr=Trap}} {{desc=@{selected|bar2|max}}} {{damage=1}} {{dmg1flag=1}} {{dmg1=$[[0]]}} {{dmg1type=trap damage}} {{dmg2flag=1}} {{dmg2=x@{selected|bar1|max}}} {{dmg2type=difficulty mult.}} {{rname=}} Most of the triggers in the roll table are just descriptions which seem to work fine. But one contains a chat button that activates another macro that generates a riddle. Here's the entries I've tried in the r oll table with the riddle button as listed in previous post : Got [riddle](~riddle)wrong - doesn't keep connection to character sheet *where "-J-" is name of my macro holder character sheet: Got [riddle](~-J-|riddle)wrong pipe is processed by token-mod so whole thing breaks down Got [riddle](~-J-&amp;#124;riddle)wrong hashmark is processed by token-mod so whole thing breaks down. Got [riddle](!&amp;#13;%{-J-|riddle})wrong same issue as above with hashmark Got [riddle](`&amp;#37;{-J-|riddle}) wrong as above I tried just calling straight from riddle roll table but same issue with token-mod processing&nbsp; hashmark On getting the [riddle](!rt &amp;#91;&amp;#91;1t&amp;#91;riddles&amp;#93;&amp;#93;&amp;#93;) wrong Here's the Riddle macro: !rt &amp;{template:traits} {{name=Riddle}} {{description=[[1t[riddles]]]}} And finally and example of a riddle from the roll table: "As&nbsp; time moves, so it creates. The lessons learned, and the ways of fate. I am&nbsp; each one, and yet still more. All you've known, seen and done before. Tell&nbsp; me, what am I?" [Answer](!/w gm Memories, information, knowledge,&nbsp; etc{&amp;amp;simple}) I really hope you can help as I'm so close to everything working with this but i totally understand if not. Thanks
1694785672
The Aaron
Roll20 Production Team
API Scripter
I'm not clear on what problem you're having. I don't even see where this has to do with TokenMod beyond the one command setting the bar values and max values. Those should be easily confirmed before the roll template is issued.&nbsp; At one point, you say " pipe is processed by token-mod", but I don't see where that's happening.&nbsp; !rt in those commands, I'd that RecursiveTable or RealRollableTables?&nbsp;
1694786653

Edited 1694786758
The Aaron said: I'm not clear on what problem you're having. I don't even see where this has to do with TokenMod beyond the one command setting the bar values and max values. Those should be easily confirmed before the roll template is issued.&nbsp; At one point, you say " pipe is processed by token-mod", but I don't see where that's happening.&nbsp; !rt in those commands, I'd that RecursiveTable or RealRollableTables?&nbsp; RecursiveTable&nbsp; so as far as i can tell when i run the first macro: !token-mod {{ --set bar1_current|[[?{difficulty?|random,[[3d4+8]]|easy,11|medium,14|hard,17|deadly,20}+1d4-1d2]] bar2_current|[[1d4+1d6+?{difficulty?}]] bar3_current|[[1d4+1d6+?{difficulty?}]] bar1_max|[[floor(?{difficulty?}/3.3)-2]] bar2_max|"[[1t[traps-?{type?|all|door|floor|container}]]]" bar3_max|"[[1t[triggers-?{type?}]]]" }} and " [[1t[triggers-?{type?}]]] " is replaced with " O n getting [riddle](~-J-|riddle)wrong" token-mod doesn't seem to actually populate bar3 max of the selected token with that text, it gets as far as " O n getting [riddle](~-J- &nbsp;but no further, I'm only guessing but I thought this might&nbsp;be because it is interpreting&nbsp;the "|"?
1694959801
The Aaron
Roll20 Production Team
API Scripter
Oh!! &nbsp;Ok, now I see where the problem lies. There isn't an easy fix for that. Probably I need to rewrite the argument parser for TokenMod as a Recursive Descent Parser, rather than a Regular Expression based strong splitter. That's something I want to do for other reasons, but it's not likely to happen soon. :(
chat menu it is many thanks!!! timmaugh said: I think you're running into problems with how the query is getting parsed by Roll20 (characters from the included macros breaking the query). You can spend time making HTML replacements in your macros, but then you won't be able to run them ON THEIR OWN -- not embedded in a roll query. You could also turn this statement into a chat menu , which is a viable option. Another option would be to add the MetaScriptToolbox script, and change your command line to be: !?{night vision?|300,#(tm-vision_night_300) |60,#(tm-vision_night_60) |NO,!tokenmod --off night_vision} That should handle each item in the list correctly, no matter what you pick. Also, it will allow you to still run your macros independently of being in a roll query.
The Aaron said: Oh!! &nbsp;Ok, now I see where the problem lies. There isn't an easy fix for that. Probably I need to rewrite the argument parser for TokenMod as a Recursive Descent Parser, rather than a Regular Expression based strong splitter. That's something I want to do for other reasons, but it's not likely to happen soon. :( yeah i thought something like that might be the case, thanks anyway man.
I don't know if there's a way to search this thread efficiently, but has anyone tried to use the "represents" argument with a query? When I'm building new character sheets, I want to link the tokens in the same way every time (bar1 max is max hp, bar2 linked to ac, etc.) So far I've been able to set a macro that will link all the stats, but only if the token represents a character in my journal, which means opening the token editing page and picking it from the dropdown. Is it possible to save this step by using the represents argument, querying the name, and then continuing from there? Or is it just too dangerous to open myself up to assigning a token to a typo?
1695470882
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I don't use a drop down for this purpose, but I do use a&nbsp; Chat Menu : /w gm &amp;{template:npcatk} {{rname=Set NPC}} {{description=[Hommelton Resident](!token-mod --set represents|@{Commoner|character_id} bar1_value|@{Commoner|hp|max}&nbsp; bar1_max|@{Commoner|hp|max} showplayersname|true name|Commoner bar_location|overlap_bottom) [Commoner](!token-mod --set represents|@{Commoner|character_id} bar1_value|@{Commoner|hp|max}&nbsp; bar1_max|@{Commoner|hp|max} bar2_link|npc_speed&nbsp; bar3_link|npc_ac bar_location|overlap_bottom) [Guard](!token-mod --set represents|@{Guard|character_id} bar1_value|@{Guard|hp|max}&nbsp; bar1_max|@{Guard|hp|max} bar2_link|npc_speed&nbsp; bar3_link|npc_ac bar_location|overlap_bottom) [Thug](!token-mod --set represents|@{Thug|character_id} bar1_value|@{Thug|hp|max}&nbsp; bar1_max|@{Thug|hp|max} bar2_link|npc_speed&nbsp; bar3_link|npc_ac bar_location|overlap_bottom) [Criminal](!token-mod --set represents|@{Criminal|character_id} bar1_value|@{Criminal|hp|max}&nbsp; bar1_max|@{Criminal|hp|max} bar2_link|npc_speed&nbsp; bar3_link|npc_ac bar_location|overlap_bottom) [Veteran](!token-mod --set represents|@{Veteran|character_id} bar1_value|@{Veteran|hp|max}&nbsp; bar1_max|@{Veteran|hp|max} bar2_link|npc_speed&nbsp; bar3_link|npc_ac bar_location|overlap_bottom) [Gladiator](!token-mod --set represents|@{Gladiator|character_id} bar1_value|@{Gladiator|hp|max}&nbsp; bar1_max|@{Gladiator|hp|max} bar2_link|npc_speed&nbsp; bar3_link|npc_ac bar_location|overlap_bottom) [Priest](!token-mod --set represents|@{Priest|character_id} bar1_value|@{Priest|hp|max}&nbsp; bar1_max|@{Priest|hp|max} bar2_link|npc_speed&nbsp; bar3_link|npc_ac bar_location|overlap_bottom) [Noble](!token-mod --set represents|@{Noble|character_id} bar1_value|@{Noble|hp|max}&nbsp; bar1_max|@{Noble|hp|max} bar2_link|npc_speed&nbsp; bar3_link|npc_ac bar_location|overlap_bottom) [Sage](!token-mod --set represents|@{Sage|character_id} bar1_value|@{Sage|hp|max}&nbsp; bar1_max|@{Sage|hp|max} showplayersname|true name|'@{selected|token_name}' bar_location|overlap_bottom) [Set Name](~Set-Name) [Re-run Macro for next token](~Generic-NPC)}} This takes a selected token and makes it into what I call a "Stock NPC". These are all classes and threat levels of NPCs and might not actually represent the statblock. Lord Farthingale might be nobility, but he's as dangerous as a thug, for instance. It looks like this: