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

Adding args for type of Critical with Critical Script

Hello, I'm using the Critical Script and I thank you for it I would like to know how can I add args after !critical to choose which type of critical ? (Like !critical pierce if I want the pierce one). The script is manually installed because I changed some rules. Thank you :) Brandys
1579789721
GiGs
Pro
Sheet Author
API Scripter
I think you'd need to edit the script to be able to do that. Can you post your edited version of the script (maybe in a gist or pastebin), so we can give pointers on what needs changing.
Hello, here you are ! <a href="https://gist.github.com/Brandysve/1a2c272b4ad65380deb28cac26c98371" rel="nofollow">https://gist.github.com/Brandysve/1a2c272b4ad65380deb28cac26c98371</a> Thx :)
1579796198

Edited 1579796496
GiGs
Pro
Sheet Author
API Scripter
Is this printout code correct? '/direct &lt;div style="border: 1px solid rgba(0, 0, 0, 0.125); border-radius: 0.25rem;"&gt;' + '&lt;h3 style="background-color:#28a745;color:white;padding:0.75rem 1.25rem;"&gt;' + 'Réussite Critique (' + rolled . toString ( ) + ')&lt;/h3&gt;' + '&lt;div style="padding:1rem;"&gt;' + &nbsp;&nbsp;&nbsp;&nbsp; '&lt;b&gt;Contondant: &lt;/b&gt;' + smash . contondant + '&lt;div style="padding-top:1rem;"&gt;&lt;/div&gt;' + &nbsp;&nbsp;&nbsp;&nbsp; '&lt;b&gt;Perforant: &lt;/b&gt;' + smash . perforant + '&lt;div style="padding-top:1rem;"&gt;&lt;/div&gt;' + &nbsp;&nbsp;&nbsp;&nbsp; '&lt;b&gt;Tranchant: &lt;/b&gt;' + smash . tranchant + '&lt;div style="padding-top:1rem;"&gt;&lt;/div&gt;' + &nbsp;&nbsp;&nbsp;&nbsp; '&lt;b&gt;Magique: &lt;/b&gt;' + smash . magique + '&lt;/div&gt;' + '&lt;/div&gt;' You have a bunch of empty divs there in the last few rows? Edit: &nbsp;looks like the &lt;/div&gt; and &lt;div&gt; ordering is simply backwards.
I know that is not the best method to do but I don't know how to insert CSS with API script. Anyway, it works, empty div put a padding-top space between "types of effect".
1579819229

Edited 1579819252
GiGs
Pro
Sheet Author
API Scripter
You dont use CSS with sendChat - you have to use inline styles the way you have been doing. You shouldnt need the /direct statement at the start. In order to get the specific damage type for printout, you'll need to edit the way the script deals with inputs. At the moment the script accepts chat commands like !cr or !cr 87 You need to modify the code to accept another parameter, so you can do something like (not necessarily exactly this): !cr magique !cr 87 magique !cr magique 87 Then when you have that keyword, you need to modify the printout part (which is why I was looking at that section), so you replace the middle section &nbsp;&nbsp;&nbsp;&nbsp; '&lt;b&gt;Perforant: &lt;/b&gt;' + smash . perforant + '&lt;div style="padding-top:1rem;"&gt;&lt;/div&gt;' + &nbsp;&nbsp;&nbsp;&nbsp; '&lt;b&gt;Tranchant: &lt;/b&gt;' + smash . tranchant + '&lt;div style="padding-top:1rem;"&gt;&lt;/div&gt;' + &nbsp;&nbsp;&nbsp;&nbsp; '&lt;b&gt;Magique: &lt;/b&gt;' + smash . magique + with an if statement that checks if a single damage type is declared, and if so, prints out just one of those. If not, it prints out all three in the standard way. It's not too hard to do those - I'll post the simplest code tweaks to achieve this as soon as I get time (probably wont be today).
1582108579
GiGs
Pro
Sheet Author
API Scripter
Another post just reminded me of this question. Do you still need this?
GiGs said: Another post just reminded me of this question. Do you still need this? Hi ! Sorry, I forgot to post here, lots of works. Anyway, my players doesn't care about this feature. Pick a card and read what they need it's ok for them so, basically, no but I thank you for your help, sincerely !
1582125901
GiGs
Pro
Sheet Author
API Scripter
That's great, saves me some work, hehe :)