Hello all!
I am a total newbie in programming, so what I ask may be already somewhere and I can't find it because I don't know how to search for it. I apologise in advance.
I want to write an attack for a monster in 13th Age system. The attack is a macro related to the specific token.
<p><strong>Mandibles</strong></p>
<p>[1d20+5] vs. AC / <strong>[3] damage.</strong></p>
<p>Natural 16+: The target also takes [1d3] ongoing acid damage.</p>
I don't want to auto-calculate if the attack succeeds or anything that advanced, I just want the macro to look at 1d20 result (without the modifier) and then if it's 16 or bigger to show me the last line.
As I understand it (after like two hours of studying the wiki and that's my entire career as a developer) I have to name "1d20" somewhat and then tell the system that if "x" is bigger than 15 then show"<p>Natural 16+: The target also takes [1d3] ongoing acid damage.</p>"
Could you help me?
if statement / help with a macro
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
Re: if statement / help with a macro
well, you were on the right track:
UNTESTED
Code: Select all
[h:result = 1d20]
<p><strong>Mandibles</strong></p>
<p>[result+5] vs. AC / <strong>[3] damage.</strong></p>
[r,if(result > 15), code:{
<p>Natural 16+: The target also takes [1d3] ongoing acid damage.</p>
}]
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
-
- Kobold
- Posts: 5
- Joined: Fri Dec 20, 2013 9:40 am
Re: if statement / help with a macro
You are amazing! Thank you very very much!