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

Marvel RPG Macro Help

I downloaded a FASERIP macro for the old TSR Marvel Superheroes RPG and I can't figure out how it actually works.  I'm trying to modify it into a scriptcard but I can't get my head around it.  Could someone explain how this is working? &{template:default} ?{Ability| Fighting, [Fighting] (@{selected|Fighting}) | Agility, [Agility] (@{selected|Agility}) | Strength, [Strength] (@{selected|Strength}) | Endurance, [Endurance] (@{selected|Endurance}) | Reason, [Reason] (@{selected|Reason}) | Intuition, [Intuition] (@{selected|Intuition}) | Psyche, [Psyche] (@{selected|Psyche}) } {{name=FEAT Roll }} {{=**?{Ability}** **Column [[ [[{?{CS|0}+{1,3,5,8,16,26,36,46,63,88,126,176,351,1e3,3e3,5e3}<[[?{Ability} + {0}]], {0,0}>1}kh1, {17} }kl1]] ]]** *(?{CS}CS)* }} {{Result:=[[ 1d100cf>[[100 - ({0,3,5,7}<[[{{?{CS}+{1,3,5,8,16,26,36,46,63,88,126,176,351,1e3,3e3,5e3}<[[?{Ability} + {0}]], {0,0}>1}kh1, {17} }kl1]] * ({0,3,5,7}<[[{{?{CS}+{1,3,5,8,16,26,36,46,63,88,126,176,351,1e3,3e3,5e3}<[[?{Ability} + {0}]], {0,0}>1}kh1, {17} }kl1]] + 1) - 2) / 2 - 5 * {9,11,13,15,16,17}<[[{{?{CS}+{1,3,5,8,16,26,36,46,63,88,126,176,351,1e3,3e3,5e3}<[[?{Ability} + {0}]], {0,0}>1}kh1, {17} }kl1]]]]cf<[[{65 - 5 * [[{{?{CS}+{1,3,5,8,16,26,36,46,63,88,126,176,351,1e3,3e3,5e3}<[[?{Ability} + {0}]], {0,0}>1}kh1, {17} }kl1]] + ({12,13,14}<[[{{?{CS}+{1,3,5,8,16,26,36,46,63,88,126,176,351,1e3,3e3,5e3}<[[?{Ability} + {0}]], {0,0}>1}kh1, {17} }kl1]] * ({12,13,14}<[[{{?{CS}+{1,3,5,8,16,26,36,46,63,88,126,176,351,1e3,3e3,5e3}<[[?{Ability} + {0}]], {0,0}>1}kh1, {17} }kl1]] + 1)) / 2, 1+{0,0}>1}kh1]]cs<[[{95 - 5 * ([[{{?{CS}+{1,3,5,8,16,26,36,46,63,88,126,176,351,1e3,3e3,5e3}<[[?{Ability} + {0}]], {0,0}>1}kh1, {17} }kl1]] - {12,14}<[[{{?{CS}+{1,3,5,8,16,26,36,46,63,88,126,176,351,1e3,3e3,5e3}<[[?{Ability} + {0}]], {0,0}>1}kh1, {17} }kl1]]), 94+{0,0}>1}kl1]] ]] }}
1638210576
timmaugh
Forum Champion
API Scripter
Breaking it down... &{template:default} Default template declaration. Everything that happens between a closing brace of one component and the opening of the next will be dropped from the final output, so the next part isn't actually seen, but you establish which attribute to draw from: ?{Ability| Fighting, [Fighting] (@{selected|Fighting}) | Agility, [Agility] (@{selected|Agility}) | Strength, [Strength] (@{selected|Strength}) | Endurance, [Endurance] (@{selected|Endurance}) | Reason, [Reason] (@{selected|Reason}) | Intuition, [Intuition] (@{selected|Intuition}) | Psyche, [Psyche] (@{selected|Psyche}) } It will obviously require a selected token (see SelectManager metascript if you run into problems, but with a basic ScriptCard, this should work fine). Next comes the template name: {{name=FEAT Roll}} And then the part that you're probably interested in: {{=**?{Ability}** **Column [[ [[{?{CS|0}+{1,3,5,8,16,26,36,46,63,88,126,176,351,1e3,3e3,5e3}<[[?{Ability} + {0}]], {0,0}>1}kh1, {17} }kl1]] ]]** *(?{CS}CS)* Double asterisks is bolding, single is italics. The math says to add the CS value: ?{CS|0} ...to the number of values from the long list which are less than (or equal to) the attribute you have chosen (the ability): {1,3,5,8,16,26,36,46,63,88,126,176,351,1e3,3e3,5e3}<[[?{Ability} + {0}]] (The adding of 0 there is a trick for the roll parser.) So if the attribute value was an 11, the total successes from that list would be 4 (1, 3, 5, and 8 are all below 11). The next part rolls that figure up in a keep-high-1 check, where you are either keeping the value you have just derived or 0: , {0,0}>1}kh1 Since neither 0 in that list will be greater than or equal to 1, it will always be a 0. At this point, I would guess that the point was to make sure the initial value could never be negative. Finally, now that we have at least a 0, we make sure that the number can't go above 17, by wrapping up everything and comparing it to a 17 with a keep-low-1: , {17} }kl1 So the whole process uses a CS value from the player and the chosen ability, and derives a number which it then coerces to be between 0 and 17 (inclusive). By the way, I think you're missing an opening brace in there, though the macro compiler doesn't seem to mind. The last part of this section of the roll template is just formatting and presenting the number of CS the player entered. *(?{CS}CS)* That should hopefully get you close enough to see the rest. The syntax of {#,#,#,#}<# is a check for successes, and wrapping things in [[ ]] is a way to get a number. So, for instance with the next roll, you're going to roll a d100 with a critical fumble/fail point:  [[ 1d100cf> The failure point is going to determined by a number subtracted from 100. [[100 - Hopefully you begin to see mechanics of the game, because from this point it gets more complex. The following takes the number of successes from a list of {0, 3, 5, 7} that are below the original roll equation (above, replicated in this equation): ({0,3,5,7}<[[{{?{CS}+{1,3,5,8,16,26,36,46,63,88,126,176,351,1e3,3e3,5e3}<[[?{Ability} + {0}]], {0,0}>1}kh1, {17} }kl1]] So whatever number you achieved between 0 and 17, you could have as many as 4 successes here, depending on the value. You would have at least 1. That number is multiplied by... a similar set of successes... etc., etc. * ({0,3,5,7}<[[{{?{CS}+{1,3,5,8,16,26,36,46,63,88,126,176,351,1e3,3e3,5e3}<[[?{Ability} + {0}]], {0,0}>1}kh1, {17} }kl1]] + 1) - 2) / 2 - 5 * {9,11,13,15,16,17}<[[{{?{CS}+{1,3,5,8,16,26,36,46,63,88,126,176,351,1e3,3e3,5e3}<[[?{Ability} + {0}]], {0,0}>1}kh1, {17} }kl1]]]]cf<[[{65 - 5 * [[{{?{CS}+{1,3,5,8,16,26,36,46,63,88,126,176,351,1e3,3e3,5e3}<[[?{Ability} + {0}]], {0,0}>1}kh1, {17} }kl1]] + ({12,13,14}<[[{{?{CS}+{1,3,5,8,16,26,36,46,63,88,126,176,351,1e3,3e3,5e3}<[[?{Ability} + {0}]], {0,0}>1}kh1, {17} }kl1]] * ({12,13,14}<[[{{?{CS}+{1,3,5,8,16,26,36,46,63,88,126,176,351,1e3,3e3,5e3}<[[?{Ability} + {0}]], {0,0}>1}kh1, {17} }kl1]] + 1)) / 2, 1+{0,0}>1}kh1]]cs<[[{95 - 5 * ([[{{?{CS}+{1,3,5,8,16,26,36,46,63,88,126,176,351,1e3,3e3,5e3}<[[?{Ability} + {0}]], {0,0}>1}kh1, {17} }kl1]] - {12,14}<[[{{?{CS}+{1,3,5,8,16,26,36,46,63,88,126,176,351,1e3,3e3,5e3}<[[?{Ability} + {0}]], {0,0}>1}kh1, {17} }kl1]]), 94+{0,0}>1}kl1]] ]] }} Again, hopefully you can map the game mechanics over the rest, because it's just a matter of replicating the set comparison with the keep-high and keep-low syntax to get the rest.