[Help] Maptool Macro Help Here
Moderators: dorpond, trevor, Azhrei, Gamerdude
- Naryt
- Dragon
- Posts: 517
- Joined: Fri Oct 26, 2007 8:55 am
- Location: Near a tree, in a cave, under a rock.
[Help] Maptool Macro Help Here
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
- Posts: 517
- Joined: Fri Oct 26, 2007 8:55 am
- Location: Near a tree, in a cave, under a rock.
The first question goes to Dedric:
Line by line
Beautimufied MacroBlock by block
Remember that [ ] and { } are both macro blocks
Ugly MacroDedric 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}
Code: Select all
[DiceRoll = 1d20]
[DiceRoll + Modifier]
[if(DiceRoll == 20,14+1d6,1d10+4)]
- Rolls 1d20 and stores it in DiceRoll
- Prompts the user for the Modifier, adds it to DiceRoll
- Checks the value of DiceRoll, if it is 20 then roll 14+1d6 otherwise roll 1d10+4
Note that you can verify that the proper dice roll is used for 20s by changing line 1 to be [DiceRoll = 20]« DiceRoll = 1d20 = DiceRoll = 17 = 17 » « DiceRoll + Modifier = 17 + 4 = 21 » « if(DiceRoll == 20,14+1d6,1d10+4) = 6 »
Beautimufied Macro
Code: Select all
<!--[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)}.
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
You rolled 13 on 1d20 with a +4 for 17. That's a Normal Hit of 8.
Last edited by Naryt on Thu Aug 14, 2008 11:26 am, edited 1 time in total.
A wandering lost soul
- Naryt
- Dragon
- Posts: 517
- Joined: Fri Oct 26, 2007 8:55 am
- Location: Near a tree, in a cave, under a rock.
First, I wouldn't use roll as a variable as the parser uses roll internally. It MIGHT not cause you problems but then again.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! ","")}
{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
- Naryt
- Dragon
- Posts: 517
- Joined: Fri Oct 26, 2007 8:55 am
- Location: Near a tree, in a cave, under a rock.
Doh...thanks, I took it out for simplicity and then forgot to remove it from the list.torstan wrote:No FullRoll mentioned in the macro. Just thought I'd point it out to avoid confusion.Naryt wrote: [*]Prompts the user for the Modifier, adds it to DiceRoll and stores that in FullRoll
A wandering lost soul
- jfrazierjr
- Deity
- Posts: 5176
- Joined: Tue Sep 11, 2007 7:31 pm
Can't. This is not a true scripting language, so you have to do the extra work and step by step manually.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! ","")}
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..
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
- Posts: 5176
- Joined: Tue Sep 11, 2007 7:31 pm
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.Naryt wrote:Just change DiceRoll == 20 to DiceRoll > 18tektonik wrote:furthermore what happens on a crit range of 19-20
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..
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
- Posts: 517
- Joined: Fri Oct 26, 2007 8:55 am
- Location: Near a tree, in a cave, under a rock.
Sure you can jfrazier, see my post above where I do combine them into one nested statement.jfrazierjr wrote:Can't. This is not a true scripting language, so you have to do the extra work and step by step manually.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! ","")}
A wandering lost soul
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: Select all
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
Alright fighter, it's your turn. What do you do?
Fighter: What do you think I do? I FAIL MY F**KING SWIM CHECK
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.
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: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.
Code: Select all
<!-- [DieRoll = 1d20] -->
[Result=Dieroll+StrBonus+EnhancementBonus+LevelBonus]<br>
[if(DieRoll>19,eval(MaxDamage1),eval(Weapon1Damage))]