Quick question: Is it possible to set a token's side by the side's name rather than number? For example, instead of "--set currentside|5" is there a way to do like "--set currentside|Name"?
Quick question: Is it possible to set a token's side by the side's name rather than number? For example, instead of "--set currentside|5" is there a way to do like "--set currentside|Name"?
There isn't currently.
Once a Rollable Table Token is created, it's completely divested from the Rollable Table. It no longer has the weights or the names associated with the sides, it really only has the image list in the same order. It doesn't even have knowledge of what table it was created from. All of that happens before the API even sees the token. (This is the reason why changing the table doesn't update the token.) To get around that, some exterior mapping in the API would need to be created when a token is created, which doesn't exist right now.
Hello i would like to heal a token via tokenmod, but without overhealling (i use DnD5 5E sheet) is it possible ?
I found this for healPot, but i would like to chose the number of heal point.
/em applies a Potion of Healing to @{target|Target|token_name} !token-mod --set bar1_value|[[{@{target|Target|bar1}+2d4+2, @{target|Target|bar1|Max}d1}kl1]] --ids @{target|Target|token_id}
Darshyne said:
Hello i would like to heal a token via tokenmod, but without overhealling (i use DnD5 5E sheet) is it possible ?
I found this for healPot, but i would like to chose the number of heal point./em applies a Potion of Healing to @{target|Target|token_name} !token-mod --set bar1_value|[[{@{target|Target|bar1}+2d4+2, @{target|Target|bar1|Max}d1}kl1]] --ids @{target|Target|token_id}
Alterbar is better for this.
Isn't Alterbar an add-on for GroupInitiative, and not actively supported anyway? or is it a standalone script?
Darshyne, you should be able to just add a query to that:
/em applies a Potion of Healing to @{target|Target|token_name} !token-mod --set bar1_value|[[{@{target|Target|bar1}+?{How many HP Healed?|0}, @{target|Target|bar1|Max}d1}kl1]] --ids @{target|Target|token_id}
Just change the "How many HP Healed" to whatever message you want to pop up.
To be fair I don't know how long it's been since Alterbar has been updated, because it now prints out NPC all the time, might just be me though.
Alterbar can be found here: https://gist.github.com/Sky-Captain-13/a503c35914644e6f885f170eaeedc705
I use the following macro for rolling the heal potions, requires Powercards too.
!power {{ --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|token_name} takes out a Potion of Healing for use on @{target|token_name}. --hroll|[[ [$Heal] ?{What type of potion?|Healing, 2d4+2|Greater Healing, 4d4+4|Superior Healing, 8d4+4|Supreme Healing, 10d4+20|Keoghtom's Ointment, 2d8+2} ]] --alterbar1| _target|@{target|token_id} _bar|1 _amount|[^Heal] }}
Could someone tell me what I'm doing wrong? I'm ultimately trying to devise a command my API script can generate that sets a token's bar1 to a value stored in bar3 and is bounded by 0 and bar1_max, but I hit a roadblock pretty early as I was working on it.
!token-mod --set bar1_value|=@{selected|bar1_max}
I had a token selected, and I tried to run that, but the console broke and spat out this:
Error: Firebase.update failed: First argument contains NaN in property 'bar1_value' Error: Firebase.update failed: First argument contains NaN in property 'bar1_value' at Ba (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:9:186) at Ba (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:10:207) at Aa (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:8:462) at Ea (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:10:403) at J.update (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:146:318) at TrackedObj._doSave (/home/node/d20-api-server/api.js:850:27) at later (/home/node/d20-api-server/node_modules/underscore/underscore.js:892:31) at Timeout._onTimeout (/home/node/d20-api-server/node_modules/underscore/underscore.js:829:19) at ontimeout (timers.js:386:14) at tryOnTimeout (timers.js:250:5)
Any clue what I'm doing wrong or what's wrong with it? I tried it on a different token and it broke there too.
I am surprised it's crashing, but i think I see two issues in your code. I don't think you need to use =, and that isn't how you access the max.
So it should probably be
!token-mod --set bar1_value|@{selected|bar1|max}
That set, it could also break if bar1 doesnt have a max.
Interesting. GiGs is right about the way to right a reference to max. You do still need the = if you expect the value could be negative. To bound, you’d probably set it something like:
!token-mod --set bar1|=[[{0,[[{@{selected|bar3},@{selected|bar1|max}}kl1]]}kh1]]
Ah, thank you. Final version ended up being below, but thanks for putting me on the right track!
!token-mod --set bar1_value|=[[{0,[[{@{selected|bar1}+@{selected|bar3},@{selected|bar1|max}}kl1]]}kh1]] bar3_value|0
It’s that bar1, etc are meaningless to the roll parser. If you’re already in another script, is there a reason not to just do the updates to tokens there? Alternatively, you could do the math in the first script and just pass the values.
Hey Aaron, I come here after many hours of fiddling and googlefu-ing but I can't figure out what I'm doing wrong with this macro. What I want is for it to change the token image on the rollable table for a druid, as far as I can tell everything else works perfectly with the exception of the image changing. I'm also very confident that it is my own ignorance that is causing the issue. Here is the code I have so far, and the rollable table has been created with pictures for all entries (I've included 2 examples hopefully to help troubleshoot):
/w gm &{template:npcaction} {{name=@{selected|token_name} }} {{rname=Wild Shape}} {{description=[Half Orc](!token-mod --set currentside|1 width|70 height|70 represents|@{Kodros Mournsnarl|character_id} bar2_link|ac bar3_link|hp name|Kodros showname|yes light_radius|60 light_dimradius|0 light_angle|360 --off light_otherplayers @{selected|token_id}) [Wolf](!token-mod --set currentside|2 width|70 height|70 represents|@{Druid Wolf|character_id} bar2_link|npc_ac bar3|11 name|'Kodros Wolf' showname|yes light_radius| light_dimradius| light_angle|360 --off light_otherplayers @{selected|token_id})
It will only be able to switch the faces if they are not in the marketplace. Are the faces of the Rollable Table ones you uploaded?
Ahh, no they are not. Like I said pretty sure it was me doing something wrong. I will upload all token faces as images to my library and see if that works.
AAAND bada bing bada boom! Aaron you're a saint and a scholar. Yes, I had uploaded all the rollable table images from the marketplace. Now that I've set them from my library it works like a freaking charm. Thank you so much for your help and for making this script, druids would be a nightmare without it I think.
OK, so I'm trying to use the same macro but for Polymorph spell. I'm using rollable table images that I've uploaded myself.
I only changed the names of things, not the syntax so I don't know why it doesn't work.
The code
&{template:npcaction} {{name=@{selected|token_name} }} {{rname=Polymorph}} {{description=[Aasimar](!token-mod --set currentside|1 width|70 height|70 represents|@{Copy of Geoffry|character_id} bar1_link|AC bar2_link|speed bar3_link|HP name|'Geoffry' showname|yes light_radius|60 light_dimradius|-5 light_angle|360 --off light_otherplayers @{selected|token_id}) [Mammoth](!token-mod --set currentside|6 width|210 height|210 represents|@{Poly Mammoth|character_id} bar1_link|AC bar2_link|speed bar3_link|HP name|'Mammoth Geoffry' showname|yes light_radius|0 light_dimradius|0 light_angle|360 --off light_otherplayers @{selected|token_id}) }}
And I simplified for troubleshooting (just change the token image with only one choice);
&{template:npcaction} {{name=@{selected|token_name} }} {{rname=Polymorph}} {{description=[Aasimar](!token-mod --set currentside|1 width|70 height|70 @{selected|token_id}) }}
All I get in chat are empty lines
Any ideas?
Just to be clear, all the images in the Rollable Table Token are uploaded to your user library? (Marketplace images must be downloaded and manually then dragged manually into the game.)
So the problem turned out to be the template 'npcaction'. I'm using the shaped sheet so I subbed '5e-shaped' and it works now although I need to fiddle with the output but the wiki is very helpful.
is it possible to use token mod to decrease the size of status markers or make them hidden until the token is clicked?
It is not possible to do that with the API. The API can't respond to a "select" action, nor can it change the size of the status markers.
While it would technically be possible to make them appear smaller by mega scaling everything on all layers of the map (if your token is 4x as large, as well as everything else being 4x as large, the status markers will appear 1/4 their original size), that's fraught with problems.
I am an API newbie who is trying to use the Token mod API to reset a few Token values
This is the macro that I am using
!token-mod --set bar1_link| bar2_link| bar3_link| bar1| bar2| bar3|
!token-mod {{
--set bar1|@{selected|npcd_hp}
--set bar2_value|@{selected|npcd_ac}
--on showname
--on showplayers_name
}}
Where I am having problems is with the following commands
--set bar1|@{selected|npcd_hp}
--set bar2_value|@{selected|npcd_ac}
The fields npcd_hp and npcd_ac are not being read from the NPC character sheet. Instead the strings "selected|npcd_hp" and "selected|npcd_ac" are being loaded into bars instead of the values.
Suggestions?
Untested code, but try this?
!token-mod {{
--set
bar1_value|@{selected|npcd_hp}
bar1_max|@{selected|npcd_hp|max}
bar2_link|@{selected|npcd_ac}
}}
If that does not work, make sure that npcd_hp and npcd_ac have values. Select a token linked to the character sheet and then type @{selected|npcd_hp} and @{selected|npcd_ac} into the chat and see what results you get.
Hi Aaron! I continue to find TokenMod to be the most generally useful API script around, so thank you again for sharing it and all your tech support.
Speaking of, I’m using a couple maps from the Princes of the Apocalypse module, and they are set to a unit/grid of 10’ (eg Temple of Eternal Flame). I have an existing spell effect macro that sets the token to a number of pixels assuming 70px is 5’, which is no longer true on those maps.
Is there any way to automatically detect and adjust for different unit size settings on the page?
Thanks for your time!
Joe
Joe said:
Hi Aaron! I continue to find TokenMod to be the most generally useful API script around, so thank you again for sharing it and all your tech support.
Speaking of, I’m using a couple maps from the Princes of the Apocalypse module, and they are set to a unit/grid of 10’ (eg Temple of Eternal Flame). I have an existing spell effect macro that sets the token to a number of pixels assuming 70px is 5’, which is no longer true on those maps.
Is there any way to automatically detect and adjust for different unit size settings on the page?
Thanks for your time!
Joe
To add to that, the cross ref for different scales entirely, and different unit sizing: i.e. when on Hex Maps, and when a partition = things like a quarter mile and such. Would be real useful to have token mod know how to do the math work for different scales and grids types.
If not though, Joe you could half the size of your grid to accomplish the same effect. I don't know if that would be visually acceptable, but it would make it easier for the ruler, tokens, etc. to be to the grid = 5' standard. I have played with that on maps before (adjusting the sizing) and spell effects, movement, and vision are all effected by non-standard map/ grid sizing. This was especially true on world maps, where that 60' vision suddenly
revealed everything in the country (I got over this by subbing a "party
token" in place and adjusting the vision on it, giving permissions to
all players).
Question?
Can I use Tokenmod together with Powercards? Can I use the conditionals of powercards together with tokenmod to change for example the amount of damage a character takes?
Joe said:
Is there any way to automatically detect and adjust for different unit size settings on the page?
That's an interesting idea. Maybe something like:
!token-mod --set width|25ft height|25ft
and I could do the lookup in TokenMod for what the page scale and such are? I'll think about that.
Danny C. said:
Question?
Can I use Tokenmod together with Powercards? Can I use the conditionals of powercards together with tokenmod to change for example the amount of damage a character takes?
That's a question that is probably better asked of the powercards people. There's nothing in TokenMod that interfaces with PowerCards, but also nothing that should prevent it from working. I really have no idea though.
Yes, exactly like that! That will make specifying size much easier in most cases I imagine, in addition to providing flexibility on different map scales
The Aaron said:
That's an interesting idea. Maybe something like:!token-mod --set width|25ft height|25ftand I could do the lookup in TokenMod for what the page scale and such are? I'll think about that.
I have to second this. It sounds like it would make for a great macro for people who move between map scales a lot. Map scales are sometimes measured in meters, though. Regardless, that number should be constant from the page. Since the page settings specific 1 unit = n [unit name] perhaps the command could be:
!token-mod --set width|25un height|25un
Joe said:
Yes, exactly like that! That will make specifying size much easier in most cases I imagine, in addition to providing flexibility on different map scales
The Aaron said:
That's an interesting idea. Maybe something like:
!token-mod --set width|25ft height|25ftand I could do the lookup in TokenMod for what the page scale and such are? I'll think about that.
If you want to avoid having the command reference “feet” when the map might be measured in miles, that sounds good, but we need to be careful how we are overloading the use of the word “unit”, and try to mimic how Roll20’s page settings uses it especially.
keithcurtis said:
I have to second this. It sounds like it would make for a great macro for people who move between map scales a lot. Map scales are sometimes measured in meters, though. Regardless, that number should be constant from the page. Since the page settings specific 1 unit = n [unit name] perhaps the command could be:
!token-mod --set width|25un height|25unwhich would be feet when the page is set to feet, meters when the page is set to meters, or furlongs when the page is set to furlongs.Joe said:
Yes, exactly like that! That will make specifying size much easier in most cases I imagine, in addition to providing flexibility on different map scales
The Aaron said:
That's an interesting idea. Maybe something like:
!token-mod --set width|25ft height|25ftand I could do the lookup in TokenMod for what the page scale and such are? I'll think about that.
True. Page settings actually say "Scale 1 unit = n [unit name]"
As far as I know, there is no front-facing code for the name for unit names. This is further confused by:
The number we want is [unit names]
"un" could be an abbreviation for Unit Name, but it could also stand for units, which is confusing. Perhaps "ms" for measures? Perhaps "su" for "scale units"? I don't think token mod should convert ft, mu, m, and km, the most common measurements (and the only ones in the dropdown). A mistake in units in the macro could wind up with a token accidentally becoming a thousand times too large.
I think the safest way is that it should pull the number in the scale field, and accept ft, mu, m, or km in the macro. Regardless of what the user types, it is a reference to the number in the scale box. those four abbreviations just mean "unit name".
Keeping track on this. Pls let us know what is decided/ updated. I could definitely be using this to macro a few things in my game.
Would this recognize a conversion between square and hex shaped units though? BC that is a major area of confusion, going from town or dungeon [square] scale to world/ kingdom [hex] scale, where tokens are either lost to miniaturization or a state sized token and view distance (It seems Bertha, the Half-Orc Bard, has been packing on a little weight in town... lol)
It would be tied to the measurements, not the grid. provided the measurements work correctly for the map scale, so would TokenMod. I'm going to try and knock this one out tonight while playing in Out of the Abyss and drinking a bottle of wine... just another Thursday night! =D
The Aaron said:
It would be tied to the measurements, not the grid. provided the measurements work correctly for the map scale, so would TokenMod. I'm going to try and knock this one out tonight while playing in Out of the Abyss and drinking a bottle of wine... just another Thursday night! =D
Nice!
The Aaron said:
It would be tied to the measurements, not the grid. provided the measurements work correctly for the map scale, so would TokenMod. I'm going to try and knock this one out tonight while playing in Out of the Abyss and drinking a bottle of wine... just another Thursday night! =D
Now that’s impressive multitasking! :-)
Well, not as impressive as it could have been. I got started but not finished. Still, I don’t think it’s going to be too hard.
The Aaron said:
It would be tied to the measurements, not the grid. provided the measurements work correctly for the map scale, so would TokenMod. I'm going to try and knock this one out tonight while playing in Out of the Abyss and drinking a bottle of wine... just another Thursday night! =D
On a quick aside (I don't want too many responses to this, as its off-topic) Am I missing something, or was Out of the Abyss removed from the Marketplace on Roll20? I could've sworn it was here a few weeks ago ... When I got back to working, I expected to be able to purchase that for some of my players who wanted to play it, now I can't find it.
keithcurtis said:
I don't think it has been released to the Marketplace on Roll20.
Hmm - I thought it was. Too bad ... good module. Anyway - back on topic ...
Update v0.8.42 -- Added relative scaling for Units, the Grid, or the Scale of the Measure Units. (Thanks Joe):
You can follow a number by one of u
, g
, or s
to adjust the scale that the number is applied in.
Use u
to use a number based on Roll20 Units, which are 70 pixels at 100% zoom. This will set a graphic to 280x140.
Use g
to use a number based on the current grid size. This will set a token to the middle of the 8th column, 4rd row grid. (.5 offset for half the center)
Use s
to use a number based on the current unit if measure. (ft, m, mi, etc) This will set a token to be 25ft by 35ft (assuming ft are the unit of measure)
Currently, you can also use any of the default units of measure as alternatives to s
: ft
, m
, km
, mi
, in
, cm
, un
, hex
, sq
You can use that with light_radius, light_dimradius, light_multiplier, aura1_radius, aura2_radius, left, top, width, height, and scale.
Additionally, I added a pseudo field Scale:
scale
is a pseudo field which adjusts both width
and height
with the same operation. This will scale a token to twice it's current size.
!token-mod --set scale|*2
The Aaron said:
Additionally, I added a pseudo field Scale:
scale
is a pseudo field which adjusts bothwidth
andheight
with the same operation. This will scale a token to twice it's current size.
Very, very nice and handy. I'll need to re-do a portion of my chat menu for this. Question on Scale. How is that used? To double a token is it:
!token-mod --set scale|2?
That’s actually an example in the help for scale. :).
scale|X
becomes
width|X height|X
so you’d use
!token-mod --set scale|*2
as equivalent to
!token-mod --set width|*2 height|*2
Wolf Thunderspirit said:
Would this recognize a conversion between square and hex shaped units though? BC that is a major area of confusion, going from town or dungeon [square] scale to world/ kingdom [hex] scale, where tokens are either lost to miniaturization or a state sized token and view distance (It seems Bertha, the Half-Orc Bard, has been packing on a little weight in town... lol)
This is something I still need to explore. On the Roll20 unit side of things, tokens are stored as defaulttoken with their pixel size. However, aura and light settings are based on the measurement scale. These contribute to the fact that Bertha looks big in town. That could be solved by having the guarantee that tokens representing characters are always stored at 70px==5ft resolution, in which case I could write a snippet that always rescaled tokens drug in based on the current map scale vs the stored defaulttoken.
On the Hex grid size side of things, this probably won’t make an improvement. I can likely add another couple of relative specifiers, or change how the grid one works if the grid type is hex. Let’s clarify what that would look like. Would a hex-sized token be scaled to the face-to-face distance or the point-to-point distance, or something else?
The Aaron said:
Wolf Thunderspirit said:
Would this recognize a conversion between square and hex shaped units though? BC that is a major area of confusion, going from town or dungeon [square] scale to world/ kingdom [hex] scale, where tokens are either lost to miniaturization or a state sized token and view distance (It seems Bertha, the Half-Orc Bard, has been packing on a little weight in town... lol)
This is something I still need to explore. On the Roll20 unit side of things, tokens are stored as defaulttoken with their pixel size. However, aura and light settings are based on the measurement scale. These contribute to the fact that Bertha looks big in town. That could be solved by having the guarantee that tokens representing characters are always stored at 70px==5ft resolution, in which case I could write a snippet that always rescaled tokens drug in based on the current map scale vs the stored defaulttoken.
On the Hex grid size side of things, this probably won’t make an improvement. I can likely add another couple of relative specifiers, or change how the grid one works if the grid type is hex. Let’s clarify what that would look like. Would a hex-sized token be scaled to the face-to-face distance or the point-to-point distance, or something else?
Not sure. I know if you're looking at a character from a dungeon pov, you're looking at it easily unit = 5ft. But the world/ hex grid would usually be one hex = quarter mile, and town views are different also (Not sure what the average hex/ square = in units). And tbh - the token would bounce around in that area for many feet of movement before getting to the next hex, so it may be worthless to consider. As well, the token itself would be very difficult to manage if it were to scale, being the size of a flea on a world map. Have the grid set to on, and you'll always occupy center unless you set the token as Art/ being immune to grid snapping.
While I'm not sure what you mean by pt to pt or face to face, that's what I'm getting. I think my method of using a "Party Token" on the world map is easier at this point.
Also - gotta be careful, I would think, of rescaling defaults. After all, a dragon at 1 unit isn't as frightening as one 4x4 units ;-)