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

Using TokenMod to read a status marker of an NPC (Hunter's Mark)?

First of all, thanks to all the great work from people on this site, from whom I have been able to borrow and adapt code using my minimal programming skills. I've set it up that the target of Hunter's Mark gets the archery-target status marker. (TokenMod) I also have macros that roll to attack, check if the attack hits and applies damage to the target if it does. (ScriptCards) What I am looking for is for the damage part of the attack macro to add an extra 1d6 of damage if the target has the archery-status marker (e.g. &nbsp; --=Damage|1d8 + @{selected|strength_mod} [STR] + [[(@{target|sm_archery-target})]]d6 [H MARK]). I tried code from The Aaron (<a href="https://app.roll20.net/forum/post/7826678/is-it-possible-to-read-the-value-of-a-token-statusmarker-from-a-macro" rel="nofollow">https://app.roll20.net/forum/post/7826678/is-it-possible-to-read-the-value-of-a-token-statusmarker-from-a-macro</a>) from two years ago. However, as The Aaron noted: "Note that this only works on characters that are controlled by someone.&nbsp; If you need to do it for NPCs, you should set yourself as the controller on them. so that it will get the attributes created and maintained." Is there anyway to do this?&nbsp; Thanks, Bill&nbsp;
1634280407

Edited 1634280465
The Aaron
Roll20 Production Team
API Scripter
In that case, I was talking about NPCs as non-player, unique monsters. The solution was to set the GM as the controlling player explicitly.&nbsp; For Mooks, it's a harder problem as each monster character might have quite a few tokens representing it, and you wouldn't want to add damage to all of them if only one of them was marked. A better solution in that case might be to reserve one bar on the token for added damage and set it to "1d8" or similar, then roll it as part of the damage formula.&nbsp;
Thanks for the reply. That makes sense as I was seeing the issue with multiple tokens in my testing. I like your idea about reserving one bar and will look into it.
Bill said: First of all, thanks to all the great work from people on this site, from whom I have been able to borrow and adapt code using my minimal programming skills. I've set it up that the target of Hunter's Mark gets the archery-target status marker. (TokenMod) I also have macros that roll to attack, check if the attack hits and applies damage to the target if it does. (ScriptCards) What I am looking for is for the damage part of the attack macro to add an extra 1d6 of damage if the target has the archery-status marker (e.g. &nbsp; --=Damage|1d8 + @{selected|strength_mod} [STR] + [[(@{target|sm_archery-target})]]d6 [H MARK]). I tried code from The Aaron ( <a href="https://app.roll20.net/forum/post/7826678/is-it-possible-to-read-the-value-of-a-token-statusmarker-from-a-macro" rel="nofollow">https://app.roll20.net/forum/post/7826678/is-it-possible-to-read-the-value-of-a-token-statusmarker-from-a-macro</a> ) from two years ago. However, as The Aaron noted: "Note that this only works on characters that are controlled by someone.&nbsp; If you need to do it for NPCs, you should set yourself as the controller on them. so that it will get the attributes created and maintained." Is there anyway to do this?&nbsp; Thanks, Bill&nbsp; I use Scriptcards for my Attacks and here is the check that I run to see if Hunter's Mark is applied and if so, add the damage from it. &nbsp; --:HuntersMark| &nbsp; --|/Check for marked-2 statusmarker, if not present set Damage4 to 0 &nbsp; --?[*T:t-statusmarkers] -inc "marked-2"|&gt;IsMarked&nbsp; &nbsp; --$Damage4|0&nbsp; &nbsp; --&lt;| &nbsp; --:IsMarked| &nbsp; &nbsp; --&amp;Damage4|yes &nbsp; &nbsp; --+[&amp;damagename4]:|[&amp;damageMod4][r][$Damage4] [&amp;damageType4][/r] &nbsp; &nbsp; --&amp;TotalDamage|[$Damage] + [$Damage4] &nbsp; &nbsp; --&lt;|
1634617311
Victor B.
Pro
Sheet Author
API Scripter
Sigh, I'm not sure why people are you steering you away from this, but that is in the arena of Combat Master.&nbsp; Assign Hunter's marks to an NPC or Player.&nbsp; Build in Macos (through another The Aaron script called On My Turn)&nbsp; or build in API into CM to do this or simply note in the chat that Hunters Mark is in this character for X number of rounds and roll another dice in game.&nbsp; This is what CM does.&nbsp; .&nbsp;&nbsp;
What a great community! Matt M.&nbsp; - thanks for that! I'm relatively new to Sciptcards and APIs in general and appreciate the sample code. Victor B. - thanks for the suggestion. I've only just had an initial play with Combat Master and need to have a closer look to better appreciate what it offers. Bill .&nbsp;
Hi Matt M., Thanks again for the code. I'm having trouble getting the right results - how is the statusmarker assigned "marked-2"? I've tried the standard status markers (coloured dots, etc.), but I suspect I need to explicitly assign it. Bill Matt M. said: I use Scriptcards for my Attacks and here is the check that I run to see if Hunter's Mark is applied and if so, add the damage from it. &nbsp; --:HuntersMark| &nbsp; --|/Check for marked-2 statusmarker, if not present set Damage4 to 0 &nbsp; --?[*T:t-statusmarkers] -inc "marked-2"|&gt;IsMarked&nbsp; &nbsp; --$Damage4|0&nbsp; &nbsp; --&lt;| &nbsp; --:IsMarked| &nbsp; &nbsp; --&amp;Damage4|yes &nbsp; &nbsp; --+[&amp;damagename4]:|[&amp;damageMod4][r][$Damage4] [&amp;damageType4][/r] &nbsp; &nbsp; --&amp;TotalDamage|[$Damage] + [$Damage4] &nbsp; &nbsp; --&lt;|
1634687185
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Victor B. said: Sigh, I'm not sure why people are you steering you away from this, but that is in the arena of Combat Master.&nbsp; Did anyone in the thread even mention Combat Master? I use it to tie conditions to token markers, and it does that very well. I turn virtualy everything else off, but for that purpose, there is not currently a better solution I can think of.
1634758852

Edited 1634762718
marked-2 is just the statusmarker that I have chosen to use for Hunter's Mark.&nbsp; You would replace this with whatever statusmarker you use to indicate Hunter's Mark (archery-target).&nbsp; This just checks to see if the target token has a particular statusmarker.&nbsp; I use this a lot to check for all sorts of statusmarkers that would change the attack (aid-2 for Advantage, paralyzed for automatic critical hit, etc.).&nbsp; How you get the marker on the target is something different.&nbsp; You could manually mark the target when Hunter's Mark is cast.&nbsp; I give my players a simple macro as a token action that lets them select a target and puts the statusmarker on it.&nbsp;&nbsp; !token-mod --ids @{target|token_id} --set statusmarkers|+marked-2 Try this and see if this does what you are looking for. &nbsp; --?[*T:t-statusmarkers] -inc "archery-target"|=HMARK;1|=HMARK;0 --=Damage|1d8 +@{selected|strength_mod} [STR] + [$HMARK]d6 [HUNTERS MARK]&nbsp; Also, if you don't have libTokenMarkers installed from the OneClick Script Library, this may be why you can't reference your statusmarker. Bill said: Hi Matt M., Thanks again for the code. I'm having trouble getting the right results - how is the statusmarker assigned "marked-2"? I've tried the standard status markers (coloured dots, etc.), but I suspect I need to explicitly assign it. Bill Matt M. said: I use Scriptcards for my Attacks and here is the check that I run to see if Hunter's Mark is applied and if so, add the damage from it. &nbsp; --:HuntersMark| &nbsp; --|/Check for marked-2 statusmarker, if not present set Damage4 to 0 &nbsp; --?[*T:t-statusmarkers] -inc "marked-2"|&gt;IsMarked&nbsp; &nbsp; --$Damage4|0&nbsp; &nbsp; --&lt;| &nbsp; --:IsMarked| &nbsp; &nbsp; --&amp;Damage4|yes &nbsp; &nbsp; --+[&amp;damagename4]:|[&amp;damageMod4][r][$Damage4] [&amp;damageType4][/r] &nbsp; &nbsp; --&amp;TotalDamage|[$Damage] + [$Damage4] &nbsp; &nbsp; --&lt;|
Victor B. said: Sigh, I'm not sure why people are you steering you away from this, but that is in the arena of Combat Master.&nbsp; Assign Hunter's marks to an NPC or Player.&nbsp; Build in Macos (through another The Aaron script called On My Turn)&nbsp; or build in API into CM to do this or simply note in the chat that Hunters Mark is in this character for X number of rounds and roll another dice in game.&nbsp; This is what CM does.&nbsp; .&nbsp;&nbsp; Correct me if I am wrong, but this won't do what the OP is asking.&nbsp; He is asking for a way to check if a target has Hunter's Mark on it, and if so, automatically include the additional damage from Hunter's Mark in the Attack.&nbsp; If Combat Master does this, please let me know.&nbsp;
1634761195
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Matt M. said: Victor B. said: Sigh, I'm not sure why people are you steering you away from this, but that is in the arena of Combat Master.&nbsp; Assign Hunter's marks to an NPC or Player.&nbsp; Build in Macos (through another The Aaron script called On My Turn)&nbsp; or build in API into CM to do this or simply note in the chat that Hunters Mark is in this character for X number of rounds and roll another dice in game.&nbsp; This is what CM does.&nbsp; .&nbsp;&nbsp; Correct me if I am wrong, but this won't do what the OP is asking.&nbsp; He is asking for a way to check if a target has Hunter's Mark on it, and if so, automatically include the additional damage from Hunter's Mark in the Attack.&nbsp; If Combat Master does this, please let me know.&nbsp; It could do it, but it would be a bit complicated. You can have a macro run when a token marker is applied or removed. This could use ChatSetAttr to create an attribute on the targeted character with a roll inside. That attribute could be referenced with an attack, using the "target" keyword. When the marker is removed, another ChatSetAttr macro could remove the roll form the attribute. Clunky, but it would work. One of Timmaugh's meta scripts would probably be less convoluted.
Thanks Matt M! That works perfectly. I had forgotten to add&nbsp; libTokenMarkers . Bill Matt M. said: marked-2 is just the statusmarker that I have chosen to use for Hunter's Mark.&nbsp; You would replace this with whatever statusmarker you use to indicate Hunter's Mark (archery-target).&nbsp; This just checks to see if the target token has a particular statusmarker.&nbsp; I use this a lot to check for all sorts of statusmarkers that would change the attack (aid-2 for Advantage, paralyzed for automatic critical hit, etc.).&nbsp; How you get the marker on the target is something different.&nbsp; You could manually mark the target when Hunter's Mark is cast.&nbsp; I give my players a simple macro as a token action that lets them select a target and puts the statusmarker on it.&nbsp;&nbsp; !token-mod --ids @{target|token_id} --set statusmarkers|+marked-2 Try this and see if this does what you are looking for. &nbsp; --?[*T:t-statusmarkers] -inc "archery-target"|=HMARK;1|=HMARK;0 --=Damage|1d8 +@{selected|strength_mod} [STR] + [$HMARK]d6 [HUNTERS MARK]&nbsp; Also, if you don't have libTokenMarkers installed from the OneClick Script Library, this may be why you can't reference your statusmarker.