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

Do critical success and failure codes (cs>, cf<) only work with actual dice rolls - not inline rolls that don't involve dice?

I have a formula being calculated inside brackets as an "inline roll", but it doesn't involve any actual dice. It spits out a percentage as a result (in 10&amp; increments) when the macro is used. I'm looking to have the macro still box the result in green if it says "100" and red if it says "50" or less (like bloodied condition, for example).&nbsp; Anyone have thoughts on how I get that to work? I've tried adding the cs100cf&lt;50 in a few different places in the formula, to no success so far. Formula below: /w gm &amp;{template:default} {{name= Bob's Health Status}} {{Health Percentage=[[ [[floor((@{Bob|hitpoints}/@{Bob|hitpoints|max})*10)*10]] ]] Percent}}
1598561158
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Try: /w gm &amp;{template:default} {{name= Bob's Health Status}} {{Health Percentage=[[ [[floor((@{Bob|hitpoints}/@{Bob|hitpoints|max})*10)*10*1d1]] ]] Percent}}
Well, I tried it and was excited at first that something so simple may be the solution, because I had the character's current HP at 50% and when I ran the macro, it did indeed box the result in red as it should based on the intention of the macro. However, when I upped the character's HP to 100% and ran the macro again, it still showed the number boxed in red. Hovering over the result indicated that the "1" result of a 1d1 roll is what it was basing the box color on, not the end result of the whole formula (so, just the dice counted, apparently, and apparently a 1 on a 1d1 is always considered the lowest score possible, not the highest).
1598569543
GiGs
Pro
Sheet Author
API Scripter
I dont think there's any way to do this without using an API script.
Ugh, thanks anyway.
1598570852
GiGs
Pro
Sheet Author
API Scripter
Since you are Pro, you can use API Scripts (if you're the GM). It might be worth asking in the Power Cards API thread if its possible to do it with that script. that script exists specifically to provide formatting options to macros. Here's the thread:&nbsp; <a href="https://app.roll20.net/forum/permalink/9110909/" rel="nofollow">https://app.roll20.net/forum/permalink/9110909/</a>
1598574043

Edited 1598574462
Oosh
Sheet Author
API Scripter
Here you go: /w gm &amp;{template:default} {{name= Bob's Health Status}} {{Health Percentage=[[ {0d0+[[floor((@{Bob|hitpoints}/@{Bob|hitpoints|max})*10)*10]],1d[[floor([[@{bob|hitpoints}/@{bob|hitpoints|max}]]*2)]]cs&gt;1cf0}k1 ]] Percent}} Full of Clunk, just the way GiGs likes it! Oh... rereading your post, 50% was meant to be red? It currently turns red at 40%, could probably change it if you need though. Or you could do an integer percentage rather than rounded to 10's, then it will turn red at 49%. /w gm &amp;{template:default} {{name= Bob's Health Status}} {{Health Percentage=[[ {0d0+[[floor(@{Bob|hitpoints}/@{Bob|hitpoints|max}*100)]],1d[[floor([[@{bob|hitpoints}/@{bob|hitpoints|max}]]*2)]]cs&gt;1cf0}k1 ]] Percent}}
Oosh said: Here you go: /w gm &amp;{template:default} {{name= Bob's Health Status}} {{Health Percentage=[[ {0d0+[[floor((@{Bob|hitpoints}/@{Bob|hitpoints|max})*10)*10]],1d[[floor([[@{bob|hitpoints}/@{bob|hitpoints|max}]]*2)]]cs&gt;1cf0}k1 ]] Percent}} Full of Clunk, just the way GiGs likes it! Oh... rereading your post, 50% was meant to be red? It currently turns red at 40%, could probably change it if you need though. Or you could do an integer percentage rather than rounded to 10's, then it will turn red at 49%. /w gm &amp;{template:default} {{name= Bob's Health Status}} {{Health Percentage=[[ {0d0+[[floor(@{Bob|hitpoints}/@{Bob|hitpoints|max}*100)]],1d[[floor([[@{bob|hitpoints}/@{bob|hitpoints|max}]]*2)]]cs&gt;1cf0}k1 ]] Percent}} Thanks for the attempt Oosh, but that doesn't do it either. Like you said, the first gives red box around any result 40% or lower, but it also gives a green box around 50% or higher. The second gives red box around results of 49% or lower, but green around results of 50% or higher still. The intent is to show, graphically, that a character is completely uninjured (green box - 100%), slightly injured (neither red nor green box - 99%-51%), or "bloodied" (i.e. at half health or below) (red box - 50% or less HP). Although in this case, I'm only trying to give results in increments of 10%, so Green Box = 100%; No Color Box = 90%, 80%, 70%, or 60%; and Red Box = 50%, 40%, 30%, 20%, 10%, or 0%. I suppose I'll just have to dig in and try to learn something about APIs, like GiGs said. I just upped to Pro though, so I don't know squat about them yet. Thanks for the assist though.
Any reason not to just use the token bars for that? They wont change color, but the players can tell the approximate % of hit points.
The scenario is this - I run a cyberpunk genre 5e-based game (Carbon 2185) where everyone has an internal HUD basically. If you only have a Basic HUD, there is not much benefit from it, really. But, if you get an Enhanced HUD, it will show you your vital signs and your remaining ammo (from linked weapons) and such. So, to implement this difference, I keep my character's exact HP secret from them, only telling them how they "feel" and giving them a rough estimate of their health condition in the form of a percentage of their HP (rounded down to the next lowest 10%). This keeps them on their toes about their actual health at times, and makes it so they are inclined to upgrade to the Enhanced HUD when they can afford it. The team has a medic who asked about being able to "link" with other characters in order to keep an eye on their health status, so I homebrewed a cybernetic augmentation that allows him to do that (kind of like the Lieutenant in Aliens who sat back and watched the squad through their bodycams, and also saw their vitals, but this would only show vitals and ammo count and would appear in the medic's own HUD, not on a screen somewhere - like an MMO does with squad stats along the side of the screen).&nbsp; So, if the other members of the team have the aforementioned Enhanced HUD, then their HP and ammo and such would also be visible to the medic who linked their upgraded HUD to them. But if they only have a Basic HUD, that information is not available to either party (the character with the Basic HUD or the medic who linked their upgraded HUD to them). So, I'm trying to make it so that the medic can see the status of the characters who don't have the Enhanced HUD (in the same 10% increments) and be able to tell quickly (by color of the outlining box) whether they are uninjured, slightly injured, or "bloodied" (which I've homebrewed a Condition effect for as well). Regarding your question specifically, Amy - Since I'm also using Dynamic Lighting, the medic wouldn't be able to see the other character's token bars all the time, as they may be out of his vision at various times. This is also the reason why I don't want to give the medic Edit rights to the other characters, as he would then be able to see through their eyes as well (where there token is, what they see/have seen, etc). There may very well indeed be some kind of API scripting that would make this all SO much easier, but as I've only just upped to PRO level, I have no experience with that stuff yet and wouldn't know where to start to find it, honestly.
1598591298

Edited 1598592084
Oosh
Sheet Author
API Scripter
Oh, sorry, I missed the "green at 100% only" bit. I don't think it'll reliably do that.
Actually, your last one seemed to do it all really well, if I didn't want it presented only in 10% increments. Otherwise, it's perfect. It puts the green box only on the 100% results, the red on 50% or less, and no color around the 51%-99% results. Unfortunately, I'm really looking for the 10% increments results (for the reasons I listed above), but otherwise, it is great.&nbsp; Thanks for the assistance so far.&nbsp; It has been really helpful.&nbsp; I'll wrack my brains about it tonight (instead of sleeping probably, ugh) and I'll get after it again tomorrow probably. Thanks again.
1598595431
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Have you looked into the Aura/Tint Health Colors script? That might suit your needs.
1598597321

Edited 1598599136
GiGs
Pro
Sheet Author
API Scripter
Secret Squirrel Gaming said: So, to implement this difference, I keep my character's exact HP secret from them, only telling them how they "feel" and giving them a rough estimate of their health condition in the form of a percentage of their HP (rounded down to the next lowest 10%). This keeps them on their toes about their actual health at times, and makes it so they are inclined to upgrade to the Enhanced HUD when they can afford it.&nbsp; If you were playing this at a game table, not online, would you do it this way? If not, dont try to do it this way in roll20 either. While you can automate a lot of stuff, there's also a lot of stuff you shouldnt. Roll20 isnt a video game, and you'll lose something by trying to treat it as one. Players being ignorant of their character's actual health scores is just a bad idea, and will not have good effects on the game.
GiGs, In answer to your question - Yes, I would do it that way and did before the epidemic. And it hasn't been a problem so far. In fact, my players have found it to add an interesting element of the unknown (along with a certain amount of stress/pressure that comes with that - a good thing for my game's overall dark theme). This element creates a more immersive effect to the overall game and takes away part of the straight number-crunching aspects of it. It makes it feel more organic to have your pain/injury level only given in an approximation and not as a hard number. It also makes healing a little more realistic, since my healer's rolls are also kept secret. I equate it to real life effects. When you are hurt, sometimes you don't know exactly HOW hurt you are. You can take medicine and feel better for awhile, but you don't know exactly HOW effective the medicine truly was, in the sense that sometimes you find out that perhaps you only FELT better for a bit, but once you tried to do something (or took further injury), you realized that you may not have been fully healed before. I am not a fan of the style of games that have become popular in recent years that eschew rules in favor of narrative, but I AM a BIG fan of immersion. I realize that sometimes that immersion comes at a cost (usually paid by me, in the form of a bit more record-keeping), but I'm willing to pay that cost for the heightened experience given to my players. While I prefer games that DO have the numbers-based systems to resolve most important issues, that doesn't mean that I want them to FEEL like they are being resolved by a numbers-based system for my players. I'm not trying to run a mathematics-heavy simulation here. That's where the benefit of a computerized game system like this can come into play. If I can get it to automate some of that extra record-keeping for me, then I can concentrate on the other immersive elements of the game. I prefer to have, and use, rules and game mechanics, rather than strictly "wing it" arbitrarily, but I want those rules (at least in this online setting) to be as much in the background as possible. I don't want my players thinking of their characters as a bunch of numbers, though those numbers DO need to be there. All of that being said, and I don't want to sound defensive/argumentative here, I guess I would ask - do you think that the Roll20 designers asked the same question of the first person (externally or internally) who mentioned Line of Sight, Advanced Fog of War, or Dynamic Lighting effects?&nbsp; Would you classify those as "bad ideas" as well, if they weren't already in the program and only just now being suggested? Those are things that most would have a VERY hard time implementing at the game table, but they are significant features offered by the online platform and they add exponentially higher levels of immersion (and enjoyment, if you prefer their use).&nbsp; They also present situations where the players are ignorant of the maps and other player's locations on them (such as a healer not knowing where the rest of the party is sometimes, even), and this could cause confusion and frustration and may not have "good effects on the game" either. (That being said, I acknowledge that those effects aren't preferred by everyone, as it is. I'm just making a point here.) Online play is missing some elements of immersive gameplay and enjoyment that can only be provided in face-to-face environments, but it offers up some other elements in an easier to use format that would be more "number-crunchy", and would detract from the game, in face-to-face gameplay. I'm not trying to make this a video game at all, but if there are simple coding methods to get some of these effects, I would like to use them.&nbsp; That's all I'm saying. (P.S. - Additionally, I should probably point out that I am currently only running games for my real-life friends who have played face-to-face around the table with me before. I can understand how this sort of game mechanic (keeping actual HP secret) could be disconcerting and could cause an issue with players who aren't already familiar with me or my game style.)
keithcurtis said: Have you looked into the Aura/Tint Health Colors script? That might suit your needs. No, I haven't, as I still don't know anything about APIs yet. I'm intending to start looking into those soon though (after I do some more map prep for upcoming sessions of course - the never-ending cycle of GM-prepping, you know?)&nbsp; From the sound of them, I think they may have some of the same limitations that I'm trying to get past though, since my healer wouldn't be able to see other members of the party (and their tinted tokens) in a Dynamic Lighting setting a lot of the times. TBH, the API aspect seems a little intimidating still and I'm a little hesitant to mess with them, since I don't have any experience with them and I don't want to screw up anything, you know? Thanks for the suggestion though. I'll try to look into that, and other APIs, soon (when I get the opportunity).
1598626746
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
When you do get to it, know that they are not nearly so intimidating as the wiki or Help Center make them sound. Those articles mainly address the writing of APIs, not using them. Using them can be as simple as saying, "yeah, that one sounds cool, add that" Click. Then you have new capabilities, which either just happen automatically, or can be triggered by a chat command. This video shows how simple the process can be: How to Install Roll20 API Scripts
Thanks for the words of encouragement (and the video link), keithcurtis. I haven't looked at Nick Olivo's channel in a while, but I learned a LOT from his videos when I first started GMing on Roll20, I remember that much. Much appreciated.
I'll second what Keith said above - I can't write scripts at all, but I've been able to implement 15 or so in my games with not too much difficulty.&nbsp; One of the ones I use is the Aura/Tint Health Colors script for a 5e D&amp;D game, specifically because my players would often ask, "Is that monster damaged yet?" or "how bad does that player/monster look?" so they'd know which one to target to finish off or to heal.&nbsp; Before using the scripts I would just have to say "He looks very injured and bloodied" or something... now the script gradually changes from green to red based on percentage, which sounds like exactly what you're looking for. The one part that you'll have to figure out is who &nbsp;gets to see a token's health status at any time - if I remember correctly it's kind of an all or nothing thing.&nbsp; You can set PCs and/or NPCs to have health auras visible to players as a whole or not at all... I don't think there was customization built in to specify a token to only be visible to a specific player... but that's certainly something that is &nbsp;possible with a modification to the script. <a href="https://app.roll20.net/forum/post/2139713/script-aura-slash-tint-healthcolor/?pagenum=1" rel="nofollow">https://app.roll20.net/forum/post/2139713/script-aura-slash-tint-healthcolor/?pagenum=1</a>
Thanks for the suggestion. While that does sounds like a very useful script as well, it still sounds a little bit different than what I'm looking for. I will certainly look into it though.