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

Problem with a Basic Attack Macro (13th Age)

1707170519
Enrique E.
Pro
Marketplace Creator
Hello everyone! I've a problem and I've been banging my head against the (code) wall for two days, so please looks if someone can help me here. In the 13th Age Oficial Sheet, a Basic Attack macro can looks like this: &{template:default} {{name= Basic Attack}} {{Weapon= @{selected|MWEAP-name1} }} {{Attack= [[1d20 + [[ (@{selected|STR-mod} * @{selected|LVL-multiplier}) ]] [STR] + @{selected|level} [LVL] + @{selected|MWEAP-mod1} [WEAP] + ?{Modifiers|0} [MOD] + @{selected|E-DIE} ]] }} {{Damage= [[@{selected|level}d[[@{selected|MWEAP1}]] + @{selected|MWEAP-mod1} [WEAP] + [[(@{selected|M-BAMOD} * @{selected|LVL-multiplier})]] [STR] ]] }} So far so good, simple and straigtforward, isn't it? OK, my problem: There's a variable in the sheet called MWEAP-sel . This variable is a number (1, 2 or 3) that depends on what weapon you have selected in the Sheet, as you have 3 slots for weapons that can have different Magic Modifiers (MWEAP-modX) and use different dice sizes for damage (MWEAPX). As you can see in the code above, you can have MWEAP-mod1, MWEAP-mod2 and MWEAP-mod3, and the same with MWEAP1, MWEAP2 and MWEAP3 and others. I'm trying to make a Basic Attack macro that takes the chosen weapon modifiers and damage dice, using the MWEAP-sel value. If nothing make sense, the attack part of the code should look something like this (?): {{Attack= [[1d20 + [[ (@{selected|STR-mod} * @{selected|LVL-multiplier}) ]] [STR] + @{selected|level} [LVL] + @{selected|MWEAP-mod@{selected|MWEAP-sel}} [WEAP] + ?{Modifiers|0} [MOD] + @{selected|E-DIE} ]] }} The underlined part is what I'm trying to achieve: Take the MWEAP-sel value and use it to modify the MWEAP-modX to get the proper modifiers, etc. I've been trying and trying different things for two days, please tell me there's a solution!
1707180675

Edited 1707180728
Gauss
Forum Champion
Hi Enrique E., I think this thread contains the information you need. 
1707185291
Andrew R.
Pro
Sheet Author
Seconding Gauss’ advice to look at the MetaScriptToolbox. I have it loaded in all my games now. I can also recommend ScriptCards for 13th Age monster abilities. My entire bestiary is coded in ScriptCards for 13th Age & 13th Age Glorantha. 
1707185756

Edited 1707185931
Gauss
Forum Champion
Actually, my advice had more to do with Timmaugh's explanation of the problem. :) Such as "@{selected|attrstart}selected|HasteNote@{selected|Haste}}" I think a non-API solution could work, but the construction Enrique needs to use is different. However, since Enrique has a Pro account you could do it with an API solution if you are the Campaign Owner. 
1707212756
Enrique E.
Pro
Marketplace Creator
YES!  Thank you Gauss and Andrew R., it takes me a little to see what was going on, but I could solve it. I'll take a look at the MetaScriptToolbox, looks pretty useful indeed! I was looking for a non-API solution just based on lazyness, but I'll look Fetch and the other tools too. Andrew R. Where I can go to learn more about ScriptCards? Very interested in what you say about bestiary, as there's no NPC/Monster sheet in 13th Age I'm just rolling my monsters manually... Again, thank you!!