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

Fallout 2d20 - Need help with Custom Skill Test

I want to add 2 new skills to my Fallout2d20 campaign, right now I'm having issues with getting the skill test macro to work as well as I've hoped. Thanks to some help, here's what I go so far. &{template:fallout_skills} {{assist=assist}} {{playerName=Jona Tán}}  {{skillName=Melee Weapons}} {{strength=STRENGTH}} {{skillValue=0}} {{target=[[0 + 4(Melee Weapons) + STRENGTH)]]}} {{attributeValue=4}} {{num_rolls=2}} {{roll1=$[[1.computed]]}} {{roll2=$[[2.computed]]}} {{successes=[[{[[1d20cs1cf20]],[[1d20cs1cf20]]}<[[0 + 4(Melee Weapons) + STRENGTH)]]]]}} {{tag=}} It's one of those systems where you need to roll below your Test Number to succeed. The Test Number is a combination of your Skill Rank, and SPECIAL attribute. Rolling below that number counts as a "Success". However, you can have a skill "tagged" which means if you roll below your rank in that skill, then it counts as 2 successes, rather than 1. e.g. Your Test Number is 10, but your skill rank is 5 for this test, so rolling a 10 or lower counts as 1 success, but rolling a 5 or lower counts as 2. I was hoping if there was a way for the macro to reconize if the skill is rolled below the skill rank so that it can count it as an additional success.
1743396637

Edited 1743400614
Gauss
Forum Champion
Some background,  It appears that the original template from the sheet (see below) is not complete, that the sheetworker is doing some behind the scenes work.  It is determining whether the rolls are successes or failures. As a result the output of the template below is stuck on "2 successes" all the time.  As a result I gave them the macro above, but that only gets us part of the way there. It does not count criticals as successes.  Template:  &{template:fallout_skills} {{assist=assist}} {{playerName=Jona Tán}}  {{skillName=Melee Weapons}} {{strength=STRENGTH}} {{skillValue=0}} {{target=[[0 + 4(Melee Weapons) + STRENGTH)]]}} {{attributeValue=4}} {{num_rolls=2}} {{roll1=[[1d20cs1cf20]]}} {{roll2=[[1d20cs1cf20]]}} {{successes=[[2 (max)]]}} {{tag=}} As the GM has a Pro account I figure this can be handled by one of the scripts, then the values  for the rolls and the successes  from the script plugged  into the template in the proper places.  Alternately, perhaps someone has some magic (calling RainbowEncoder!) that can calculate the critical successes/failures and add them to the successes. 
1743427844
timmaugh
Forum Champion
API Scripter
Here is a metascript solution... but the explanation wasn't exactly clear, so I had to make some assumptions. Assumptions 1) In the target roll equation, 0 represents the "Melee Weapons" skill, and 4 represents the value of the STRENGTH attribute. 2) Successes are counted across both d20s (that is, each die is individually compared to the skill rank and to the total target number; the number of successes generated from each die are added together for the total number of successes. 3) Critical successes (a 1) and critical failures (a 20) do not affect the overall number of successes. 4) There is ... apparently... no way to reference the skill rank or the attribute by attribute retrieval syntax from the sheet; that is, if you could refer to... @{CharacterName|MeleeWeapons} ...it would be better than hard-coding... 4 ...into the command line, since you'll have to change every instance of that number when the character trains another rank. If there is a way to reference the skill and/or attribute from the sheet, then I would use it in my final command line (it would alter slightly the solution, below). Solution For all of those assumptions, here is how you can do this with the MetascriptToolbox: !&{template:fallout_skills}  [[[[10]][Melee Weapons] + [[4]][STRENGTH])]]  {{assist=assist}} {{playerName=Jona Tán}}  {{skillName=Melee Weapons}} {{strength=STRENGTH}} {{skillValue=$[[0]]}} {{target=$[[2]]}} {{attributeValue=$[[1]]}} {{num_rolls=2}} {{roll1=[[1d20cs1cf20]]}} {{roll2=[[1d20cs1cf20]]}} {{successes={&r}{&if $[[3]] <= $[[0]]}2{&elseif $[[3]] <= $[[2]]}1{&else}0{&end} + {&if $[[4]] <= $[[0]]}2{&elseif $[[4]] <= $[[2]]}1{&else}0{&end}{&/r} }} {{tag=}} {&simple} Explanation Here's a quick explanation so you know why I made the choices I did. They'll match the assumptions, above, so if one of the assumptions is incorrect, hopefully this section will tell you where to go to change it. 1) I rewrote your target roll to be: [[[[10]][Melee Weapons] + [[4]][STRENGTH])]] This closely associates the label "Melee Weapons" with the part of the roll that seemed associated with that base number, and the label "STRENGTH" with the portion of the roll that seemed to derive from that attribute. Further, I wrapped the skill rank number (in this case, the 10) in its own inline roll brackets, and the attribute rank (in this case, the 4) in its own inline roll brackets. That lets us refer to these numbers by their roll indices elsewhere in the command, and will minimize the number of places you have to change this command should the character train up (or should you want to copy this command line as a starting point for another skill). Finally, but importantly, I altered your roll to change the skill rank from a value of 0 to be a value of 10... this was so that I had a number I could actually roll beneath in order to test the logic of what I was trying to produce. Once you've validated that this command line works for you (that is, that it produces the correct number of successes for each roll outcome), you can change this 10 back to a 0 (or to whatever the skill rank is) to apply it in your game. Again, because of the way this command line is structured, that should be the only place you have to change it. 2) I moved the roll between template parts just to eliminate the need for ".computed" syntax 3) Success - in the successes field, I run an IF check for both roll $[[3]] and roll $[[4]]. These are the d20 rolls. They each get compared against roll $[[0]] (the skill rank) to see if they should earn 2 successes. If not, they get compared against roll $[[2]] (the overall target number -- the attribute value takes up roll $[[1]], so the target number is $[[2]]) to see if they should earn 1 success. If neither of these cases pass, 0 success are earned for our d20 roll. Whatever numbers are produced by those two IF checks are wrapped in... {&r} ... {&/r} ...which are metascript tags representing inline roll brackets. Basically, this lets us disguise from the Roll20 parsers the final roll totaling the number of successes until those successes have been derived from the IF blocks . In other words, if we used normal inline roll brackets, here, the roll would try to resolve the first time Roll20 saw the message, before the metascripts had a chance to do their work and evaluate the number of successes.
Wouldn't something like  {{Successes=[[2+{[[1d20cs1cf20]],[[1d20cs1cf20]]}<[[(skill + attribute)]]f>[[(skill+1)]] ]]}} work? I'm not sure how the tagging is set up in the sheet, but if it is a checkbox, it should be possible to call it as an attribute and multiply the skill value in the f part, to make it conditional on it being checked. Edit: Realised I had an error in there, fixed it.