# RPTools.net

Discussion and Support

It is currently Mon Dec 09, 2013 9:56 pm

 Page 1 of 3 [ 41 posts ] Go to page 1, 2, 3  Next
Author Message
 Naryt   Dragon Joined: Fri Oct 26, 2007 7:55 amPosts: 523Location: Near a tree, in a cave, under a rock.
 Post subject: [Help] Maptool Macro Help HerePosted: Thu Aug 14, 2008 8:24 am
If you have a macro question, basic or not, feel free to drop it here, trained electrons will then do their best to display the proper answer.

_________________
A wandering lost soul

 Naryt   Dragon Joined: Fri Oct 26, 2007 7:55 amPosts: 523Location: Near a tree, in a cave, under a rock.
 Post subject: Posted: Thu Aug 14, 2008 8:25 am
The first question goes to Dedric:

Dedric wrote:
How would you set this up?

Roll a 1d20+mods (check to see if just the 1d20 was a 20) if true Critical Hit{14+1d6} if not {1d10+4}

Ugly Macro
Code:
[DiceRoll = 1d20]
[DiceRoll + Modifier]
[if(DiceRoll == 20,14+1d6,1d10+4)]
Line by line
1. Rolls 1d20 and stores it in DiceRoll
2. Prompts the user for the Modifier, adds it to DiceRoll
3. Checks the value of DiceRoll, if it is 20 then roll 14+1d6 otherwise roll 1d10+4

Ugly Output
Quote:
« DiceRoll = 1d20 = DiceRoll = 17 = 17 » « DiceRoll + Modifier = 17 + 4 = 21 » « if(DiceRoll == 20,14+1d6,1d10+4) = 6 »
Note that you can verify that the proper dice roll is used for 20s by changing line 1 to be [DiceRoll = 20]

Beautimufied Macro
Code:
<!--[DiceRoll = 1d20]
[Modifier = Modifier]-->
You rolled {DiceRoll} on 1d20 with a {if(Modifier > 0,"+","")}{Modifier} for {DiceRoll + Modifier}.  That's a {if(DiceRoll == 20, "Critical Hit", "Normal Hit")} of {if(DiceRoll == 20,14+1d6,1d10+4)}.
Block by block
Remember that [ ] and { } are both macro blocks
• Use <!-- --> around the ugly bits to hide them
• Set DiceRoll = 1d20 (set it to = 20 to test Critical Hits)
• Get the value of Modifier from the user and store it for later use
• {DiceRoll} prints the value of the 1d20 rolled
• {if(Modifier > 0,"+","")} will print a + if the Modifier is positive and do nothing if it is negative
• {Modifier} shows the value of the Modifier the user entered
• {DiceRoll + Modifier} gives us the total roll
• {if(DiceRoll == 20, "Critical Hit", "Normal Hit")} if DiceRoll was 20 then print Critical Hit otherwise print Normal Hit
• {if(DiceRoll == 20,14+1d6,1d10+4)} if DiceRoll was 20 then roll 14+1d6 otherwise roll 1d10 + 4
Pretty Output
Quote:
You rolled 13 on 1d20 with a +4 for 17. That's a Normal Hit of 8.

_________________
A wandering lost soul

Last edited by Naryt on Thu Aug 14, 2008 10:26 am, edited 1 time in total.

 Sepp   Dragon Joined: Fri Jul 25, 2008 6:41 pmPosts: 648
 Post subject: Posted: Thu Aug 14, 2008 9:13 am
{if(DiceRoll == 20, "Critical Hit", "Normal Hit")}

What would you do to make it show a Critical Miss?
I have been using this, but it's two if statements. How can I make it one?
{if(roll>=20," Critical Hit! ","")}{if(roll<=1," Critical Miss! ","")}

 tektonik   Dragon Joined: Mon Jul 21, 2008 12:21 pmPosts: 616
 Post subject: Posted: Thu Aug 14, 2008 9:20 am
furthermore what happens on a crit range of 19-20

 Naryt   Dragon Joined: Fri Oct 26, 2007 7:55 amPosts: 523Location: Near a tree, in a cave, under a rock.
 Post subject: Posted: Thu Aug 14, 2008 9:26 am
tektonik wrote:
furthermore what happens on a crit range of 19-20

Just change DiceRoll == 20 to DiceRoll > 18

_________________
A wandering lost soul

 Naryt   Dragon Joined: Fri Oct 26, 2007 7:55 amPosts: 523Location: Near a tree, in a cave, under a rock.
 Post subject: Posted: Thu Aug 14, 2008 9:29 am
Sepp wrote:
{if(DiceRoll == 20, "Critical Hit", "Normal Hit")}

What would you do to make it show a Critical Miss?
I have been using this, but it's two if statements. How can I make it one?
{if(roll>=20," Critical Hit! ","")}{if(roll<=1," Critical Miss! ","")}

First, I wouldn't use roll as a variable as the parser uses roll internally. It MIGHT not cause you problems but then again.

{if(DiceRoll>=20," Critical Hit! ",if(DiceRoll<=1," Critical Miss! ",""))}

Basically, just put your second if statement into the first one in place of the "" in the false section.

_________________
A wandering lost soul

 Sepp   Dragon Joined: Fri Jul 25, 2008 6:41 pmPosts: 648
 Post subject: Posted: Thu Aug 14, 2008 9:52 am
Oh, I see. Now I have to go change all my macros... *sigh*

Thanks for clearing that up, though.

 torstan   Great Wyrm Joined: Wed Sep 27, 2006 5:50 amPosts: 1897
 Post subject: Posted: Thu Aug 14, 2008 10:22 am
Naryt wrote:
[*]Prompts the user for the Modifier, adds it to DiceRoll and stores that in FullRoll

No FullRoll mentioned in the macro. Just thought I'd point it out to avoid confusion.

 Naryt   Dragon Joined: Fri Oct 26, 2007 7:55 amPosts: 523Location: Near a tree, in a cave, under a rock.
 Post subject: Posted: Thu Aug 14, 2008 10:26 am
torstan wrote:
Naryt wrote:
[*]Prompts the user for the Modifier, adds it to DiceRoll and stores that in FullRoll

No FullRoll mentioned in the macro. Just thought I'd point it out to avoid confusion.

Doh...thanks, I took it out for simplicity and then forgot to remove it from the list.

_________________
A wandering lost soul

 jfrazierjr   Deity Joined: Tue Sep 11, 2007 6:31 pmPosts: 5360
 Post subject: Posted: Thu Aug 14, 2008 4:42 pm
Sepp wrote:
{if(DiceRoll == 20, "Critical Hit", "Normal Hit")}

What would you do to make it show a Critical Miss?
I have been using this, but it's two if statements. How can I make it one?
{if(roll>=20," Critical Hit! ","")}{if(roll<=1," Critical Miss! ","")}

Can't. This is not a true scripting language, so you have to do the extra work and step by step manually.

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

 jfrazierjr   Deity Joined: Tue Sep 11, 2007 6:31 pmPosts: 5360
 Post subject: Posted: Thu Aug 14, 2008 4:46 pm
Naryt wrote:
tektonik wrote:
furthermore what happens on a crit range of 19-20

Just change DiceRoll == 20 to DiceRoll > 18

Better: Assuming you are using some type of properties to store weapon damage, modifiers, etc, add a property for the CritRangeMin and test for that INSTEAD of hard coding into the macro itself. This gives you flexibility. This is especially useful if you have properties for storing the "current" weapon(in which case you need a similar property for each weapon and the "current" variant) so when you switch weapons, your crit range just works. At least thats what I do.

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

 Naryt   Dragon Joined: Fri Oct 26, 2007 7:55 amPosts: 523Location: Near a tree, in a cave, under a rock.
 Post subject: Posted: Thu Aug 14, 2008 5:01 pm
jfrazierjr wrote:
Sepp wrote:
{if(DiceRoll == 20, "Critical Hit", "Normal Hit")}

What would you do to make it show a Critical Miss?
I have been using this, but it's two if statements. How can I make it one?
{if(roll>=20," Critical Hit! ","")}{if(roll<=1," Critical Miss! ","")}

Can't. This is not a true scripting language, so you have to do the extra work and step by step manually.

Sure you can jfrazier, see my post above where I do combine them into one nested statement.

_________________
A wandering lost soul

 kat2cute   Dragon Joined: Wed Jan 30, 2008 3:46 pmPosts: 297
 Post subject: Posted: Thu Aug 14, 2008 11:57 pm
So I am trying to create a table format that takes the skill roll and then does math functions to it later in the macro. Seems easy, but it keeps asking me to input the value of alchemyroll every time it appears in the token macro. What am I doing wrong so that it doesn't ask for ANY user input?

Code:
Per day roll: AlchemyRoll*DC > Cost in coppers<br>
alchemyroll=[1d20+Alchemy+2]
<table width=400><tr><td>Acid: </td><td>{alchemyroll*15}>1000</td><td>{alchemyroll/1000*100}% done</td></tr>
<tr><td>Alchemist Fire/SmokeStick:</td><td> {alchemyroll*20}>2000</td><td>{alchemyroll/2000*100}% done</td></tr>
<tr><td>Tindertwig:</td><td> {alchemyroll*20}>100</td><td>{alchemyroll/100*100}% done</td></tr>
<tr><td>Sunrod: </td><td>{alchemyroll*25}>200</td><td>{alchemyroll/200*100}% done</td></tr>
<tr><td>Thunderstone:</td><td> {alchemyroll*25}>3000</td><td>{alchemyroll/3000*100}% done</td></tr>
<tr><td>Tanglefoot bag:</td><td> {alchemyroll*25}>5000</td><td>{alchemyroll/5000*100}% done</td></tr></table>

_________________
Quote from an underwater D&D fight:
Alright fighter, it's your turn. What do you do?
Fighter: What do you think I do? I FAIL MY F**KING SWIM CHECK

 Dedric   Cave Troll Joined: Fri Jul 04, 2008 12:31 pmPosts: 41
 Post subject: Posted: Fri Aug 15, 2008 5:27 am
I'm breaking my skull with a critical hit setup.

What I'm trying to do.
Roll a 1d20+StrBonus+EnhancementBonus+LevelBonus

Check to see if the 1d20 is a critical hit (20)

If true: CriticalHit
Show the roll in full and MaxDamage1(stored in properties) after a line break.
If False
Show the roll in full and Weapon1Damage.(stored in properties) after a line break.

 Mrugnak   Dragon Joined: Mon Jul 21, 2008 6:38 pmPosts: 717
 Post subject: Posted: Fri Aug 15, 2008 7:21 am
Dedric wrote:
I'm breaking my skull with a critical hit setup.

What I'm trying to do.
Roll a 1d20+StrBonus+EnhancementBonus+LevelBonus

Check to see if the 1d20 is a critical hit (20)

If true: CriticalHit
Show the roll in full and MaxDamage1(stored in properties) after a line break.
If False
Show the roll in full and Weapon1Damage.(stored in properties) after a line break.

Try this:
Code:
<!-- [DieRoll = 1d20]  -->
[Result=Dieroll+StrBonus+EnhancementBonus+LevelBonus]<br>
[if(DieRoll>19,eval(MaxDamage1),eval(Weapon1Damage))]

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 3 [ 41 posts ] Go to page 1, 2, 3  Next

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

 Search for: Jump to: Select a forum ------------------ General    Announcements    Ideas for New Applications    General Discussion    Developer Notes       Java Programming Info    User Creations       Requests for HELLLLP!       Tilesets, Token Libraries, and Complete Maps          Token Libraries          Tilesets/Graphics for Map-making          Complete Maps       Campaign Frameworks          D&D 4e Frameworks          [D&D3.5 + Pathfinder] Campaign Macros          Shadowrun 4e Frameworks          Savage Worlds Frameworks       Published Module Support       Tutorials          Graphics, Images, Tokens, Maps          Drop-In Macros and Scripts          Campaign Frameworks       Drop-In Macro Resources    Links & External Resources    Looking For Group       "Living" Campaigns       Dungeons and Dragons       Savage Worlds       WoD       Wargaming    Documentation Requests/Discussion    Session Report-Back Tools    MapTool       How To       Macros       Feature Requests          Resolved       Bug Reports          Resolved       WIP - User FAQ       Testing    TokenTool    DiceTool    InitiativeTool    CharacterTool       Support: d20 D&D       Support: D&D 4e       Support: Hero System       Support: Savage Worlds       Support: GURPS Other    RPTools Sightings    Running Campaigns       Thiera's College of Adventurers       Age of Might       Scales of War       Renwold       Dead Men Walking       Dark Sun - 4th Edition       Warhammer Fantasy Roleplay       Return of Uchly Namen       Insert Campaign Here       Antium       The Mystic Moon       World of Lagal       GangerRun       FB Scales of War       Sellswords of Eberron          Archive       Orbs of Chaos       World of Omegus       Keep on the Shadowfell - 4E       Rise of the Runelords       Aurith In The Age Of Steam       Widdershins       Nos's Pathfinder Campaign       Falcons Hollow       Verwirrte Welten       With it or on it

### Who is online

In total there are 2 users online :: 1 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: Bing [Bot] and 1 guest