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] Aura/Tint HealthColor

Hey all, Love this script but I am having an issue with it. I have found that when using graphic object created from a deck (technically its still a mook or a token, just has added feature as far as i can tell) the script does not apply any of the functions to it other than to set the initial aura to it. Beyond that it does not trigger any of the death or special affects nor does the aura color change.  Looking at the script I think I figured out how its defining between player and graphic object.. //Monster or Player var oCharacter = getObj('character', obj.get("_represents")); var type = (oCharacter.get("controlledby") === "" || oCharacter.get("controlledby") === "all") ? 'Monster' : 'Player'; If I understand what this defines, there shouldn't be any difference in the behavior of the script as a deck will assign all player to the object when dragged out to the board but that can be easily removed, so I am not sure why it doesn't trigger when configured as a mook or npc/pc.  Any ideas?
1526222050
The Aaron
Pro
API Scripter
It's probably because it looks for changes to tokens, which are a subtype of graphic.  Cards are their own separate subtype.  You should be able to add handling for cards by inserting this bolded line around line 325:         registerEventHandlers = function() {             on('chat:message', handleInput);             on("change:token", handleToken);             on("change:card", handleToken);         }; That will cause it to notice when card's are changed and deal with them.
1526230227

Edited 1526230249
Thanks Aaron, Worked like a charm! I had thought that might be the case but didn't see where it was handling it but i was also looking at a very old code of the script. Found the 1.51 version and made the mod.  Any chance of this getting change put in the one click install? I am finding that using a deck for a bestiary for mooks to be quite handy. Thanks again!!!
1526232048
The Aaron
Pro
API Scripter
Guess I'll ask the author.  =D
1526266043
DXWarlock
Sheet Author
API Scripter
Ill look into adding an option to turn cards on and off Mark.  Not sure when I can actually get to it, life has been busy lately but in the next week or 2 Im sure :)
Sounds good no rush, just figured others might like the feature.