RPTools.net

Discussion and Support

Skip to content

It is currently Tue May 21, 2013 9:45 am 






Reply to topic  [ 41 posts ]  Go to page 1, 2, 3  Next

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Dragon
 
Joined: Fri Oct 26, 2007 7:55 am
Posts: 523
Location: Near a tree, in a cave, under a rock.
 Post subject: [Help] Maptool Macro Help Here
PostPosted: 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. :lol:

_________________
A wandering lost soul


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Fri Oct 26, 2007 7:55 am
Posts: 523
Location: Near a tree, in a cave, under a rock.
 Post subject:
PostPosted: 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.

Top
 Profile  
 
 Offline
Dragon
 
Joined: Fri Jul 25, 2008 6:41 pm
Posts: 648
 Post subject:
PostPosted: 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! ","")}


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Mon Jul 21, 2008 12:21 pm
Posts: 616
 Post subject:
PostPosted: Thu Aug 14, 2008 9:20 am 
furthermore what happens on a crit range of 19-20


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Fri Oct 26, 2007 7:55 am
Posts: 523
Location: Near a tree, in a cave, under a rock.
 Post subject:
PostPosted: 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


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Fri Oct 26, 2007 7:55 am
Posts: 523
Location: Near a tree, in a cave, under a rock.
 Post subject:
PostPosted: 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


Top
 Profile  
 
 Offline
Dragon
 
Joined: Fri Jul 25, 2008 6:41 pm
Posts: 648
 Post subject:
PostPosted: 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.


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Wed Sep 27, 2006 5:50 am
Posts: 1897
 Post subject:
PostPosted: 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.

_________________
Fantasy Map Gallery | Fantastic Maps on RPGNow | My Maps on Paizo | Fantastic Maps on Twitter | Fantastic Maps on G+ | Food Illustrations


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Fri Oct 26, 2007 7:55 am
Posts: 523
Location: Near a tree, in a cave, under a rock.
 Post subject:
PostPosted: 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


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5228
 Post subject:
PostPosted: 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..


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5228
 Post subject:
PostPosted: 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..


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Fri Oct 26, 2007 7:55 am
Posts: 523
Location: Near a tree, in a cave, under a rock.
 Post subject:
PostPosted: 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


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Wed Jan 30, 2008 3:46 pm
Posts: 297
 Post subject:
PostPosted: 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


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Fri Jul 04, 2008 12:31 pm
Posts: 41
 Post subject:
PostPosted: 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.


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Mon Jul 21, 2008 6:38 pm
Posts: 714
 Post subject:
PostPosted: 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))]


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 41 posts ]  Go to page 1, 2, 3  Next

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

Search for:

Who is online

In total there are 0 users online :: 0 registered, 0 hidden and 0 guests (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: No registered users and 0 guests





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman