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 w/ Players Hunter Marking their own targets?

I come once again to the mighty api gurus asking for assistance.  Is there a way to give a player the ability to set statusmarkers on NPC's/Monsters? Something like the healing script that I have below. What I'm looking for player clicks script. Gets asked whom (their target) they click on the monster. get prompted for what status i.e. Hunter's Marked, Charmed with a drop down. and the correct status marker be applied to their target.  And maybe a message stating target is now Hunter's Marked (though message totally doesn't need to happen) Thank you oh wise ones! !token-mod {{   --set     bar1_value|+[[ { @{target|Whom|bar1|max}, [[ ?{Select Potion|Healing Kit 1d6+4+@{target|Whom|hit_dice|max},1d6+4+@{target|Whom|hit_dice|max}|Standard 2d4+2,2d4+2|Greater 4d4+4,4d4+4|Superior 8d4+8,8d4+8|Supreme 10d4+20,10d4+20} ]] }kl1 ]]!   --report     all|"***{name}*** has been healed for ***{bar1_value:abschange}HP***, now at ***{bar1_value}***"   --ids     @{target|Whom|token_id} }}
1666034226
The Aaron
Roll20 Production Team
API Scripter
You can add the mark with TokenMod: !token-mod {{ --set statusmarkers|!archery-target --ids @{target|token_id} }} That will let a player toggle the archery target marker on and off, prompting them to click a token.  Note: You will need to toggle on Players Can IDS in the help to allow it. You could look at the --report functionality in the help to provide a message about toggling hunters mark on the target.
Thank you The Aaron! this works great.  Was wondering if it is possible to make it a dropdown so the player could chose another status.  I'm trying to make one now but just not getting it. Thanks for your help!
1666062899

Edited 1666062927
timmaugh
Forum Champion
API Scripter
What have you tried so far? If you pull up the TokenMod help (either in chat or the handout), you should be able to find the appropriate names of the markers in your game. Then it's just a matter of the proper syntax so as to not break your roll query. So is it that you don't know the name of the markers? Or that you're not sure how to build the query? Or that the query you're building breaks or doesn't return the correct value?
1666100344

Edited 1666100382
Sorry, I know the names of the markers but I am unsure how to write the query.  ?{Set Status|Hunters Mark, !token-mod {{ --set statusmarkers|!Marked --ids @{target|token_id} }}|Blessed, !token-mod {{ --set statusmarkers|!Blessed --ids @{target|token_id} }}} It prompts for a target then nothing happens and chat shows !token-mod {{ --set statusmarkers}|Blessed, !token-mod {{ --set statusmarkers|!Blessed --ids -NCQr2Ith08Bdi3JjRbr }}}
1666101720
The Aaron
Roll20 Production Team
API Scripter
The issue is the space after the , in your version.  Mod commands must start with a !, having the space after the , makes them start with a space, " !token-mod ...", which treats them as just chat text.  Additionally, I'd suggest putting the query just around the marker for simplicity: !token-mod {{ --set statusmarkers|!?{Set Status|Hunters Mark,Marked|Blessed,Blessed} --ids @{target|token_id} }} Incidentally, the {{ }} are just to let TokenMod operate across multiple lines.  You could write the above on a single line like: !token-mod --set statusmarkers|!?{Set Status|Hunters Mark,Marked|Blessed,Blessed} --ids @{target|token_id} If you do find you want to put multiple things in the Roll Query, you could do something like: !token-mod ?{Set Status|Hunters Mark,--set statusmarkers#!Marked --report all#"Toggled Hunter's Mark on {name}" |Blessed,--set statusmarkers#!Blessed --report all#"Toggled Bless on {name}" Blessed} --ids @{target|token_id} }} You can use # instead of | for TokenMod commands to allow you to embed them in Roll Queries and the like more easily.
OMG this is what I was looking for thank you so much! I was trying to add way more then I needed to. !token-mod {{ --set statusmarkers|!?{Set Status|Hunters Mark,Marked|Blessed,Blessed} --ids @{target|token_id} }}
1666113699
The Aaron
Roll20 Production Team
API Scripter
No problem!