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

Scriptcards - Reading statusmarker from target token

Note: This is for a 1st edition game, so the spells rules are a bit different than 5e I am creating a Mirror Image script for one of my players mages.    I have made it so than when the script figures out how many mirror images are created, it adds a statusmarker of red:#     So 4 images would be red:4 All of that works great..   what I would like to do now is take it a step further and add it into the attack scripts that I have so that when someone hits, it looks to see if they have a statusmarker of red: #.  So if they have red:1,  it would roll to see if it hits the image or the player and then deduct 1 from the status if it hits the image. I can this easily if that is the only status they have.. (if status = red) or whatever.. but what if they have more than 1 status? I am not good at arrays, so I am not sure how I look to see (if status contains red) Any help is appreciated.. thank you in advance
1676000570
timmaugh
Pro
API Scripter
Not sure about a ScriptCards answer, but maybe Fetch can help? @(selected.status.red.is) ...will give you a 'yes' or a 'no'... ...or... @(selected.status.red[0]) ...will give you the value of the red marker (the first red marker, if there's more than one), or default it to be 0.
Thanks Tim...  I was able to figure it out with Scriptcards, but you have introduced me to a new one that I am adding immediately!  Thank you for the work on that
1676232980
Kurt J.
Pro
API Scripter
If you use the System Neutral Library (just posted) it includes the functions from the StatusMarkerFunctions sample so you can easily get information about status markers, increment/decrement their numbers, etc. The System Neutral Library is available on the GitHub Here
Thanks Kurt.. read that on your Discord.  Great stuff!