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

[Help] NPC Action / Token Action Question

1442354494
Zym
Sheet Author
I can set up 'Actions' for my monsters in 5ed perfectly.  I can also set up non-API macros for the same monster and use macro as 'Token Action' However, is it possible to make my NPC 'action' used as a 'Token Action' (avoiding Abilities as much as possible) This would really speed up things so I don't have to write macros in 'Abilities' Also.... I am new to the mentoring so new to API. I stored the API for power cards in the Game Settings, and tried to create a API power card macro under 'Abilities' Didn't work... for me.... :-(   I was hoping to get that working with character_id for the NPC or my avatar as the emote. I couldn't get that to work, because I don't exactly know what is a character id.... Would that just be 'Skeleton' ?
1442360408
Zym
Sheet Author
I think I have this one solved now...
1442385646

Edited 1442385743
Lithl
Pro
Sheet Author
API Scripter
As far as using character ids in the power cards goes, id are unique identifiers stored for all Roll20 objects by the API, and they are not normally user-facing. They tend to look something like "-IpzPx2j_9piP09ceyOv". Obviously, since they're essentially random strings of characters and the ids aren't actually displayed  anywhere, you can't just type them into your macro. However, the id of a character or token is available as an attribute: @{character_id} or @{token_id}. Just like normal attributes, if you're putting it in a macro rather than, for example, a field on the character sheet, you'd need to specify which  character/token you're talking about with either @{Name|character_id}, @{selected|character_id}, or @{target|character_id}. Just like regular attributes, @{selected|character_id} and @{target|character_id} only work if the selected/targeted token is representing a character. (@{token_id} works with selected/target regardless of representing a character.)
1442394833

Edited 1442394863
Zym
Sheet Author
So if I want to put it into an 'ability' to show the NPCs token every time I use an ability. What would the code look like? This code, is wrong. @{token_id}%{selected|Perception_Check}
Something like @{selected|token_name} %{selected|Perception_Check}
1442409265
Zym
Sheet Author
Cool. That works for a text output. How about an icon output for his token image? Will it resize automatically? if not, may i be as brave to ask what would be the 'code' for dimension also.
1442417810

Edited 1442417963
Lithl
Pro
Sheet Author
API Scripter
!power --charid|@{selected|character_id} --emote|@{selected|character_name} does something awesome! --name|Example power --leftsub|Coolness --rightsub|Radicalness --Foo:|Bar Gets you something like this: The image will be 50x50 pixels (with 2px padding on the right and 4px padding on the bottom). Using token_id won't get you an avatar with the Power Cards script, but it also won't break anything.
1442422734
Zym
Sheet Author
Well I tried, and can't get it to work ( I know that's going to bother someone ) So hell with it. :_)