A (long) MapTool macro tutorial
Moderators: dorpond, trevor, Azhrei
- Mr. Pokeylope
- Giant
- Posts: 118
- Joined: Mon Aug 11, 2008 9:24 pm
Okay, well, as it stands there is code that tries to do the replacement but it's slightly wrong, so it doesn't work. I'm fine with it not doing it, it just looks like its supposed to.
Last edited by Mr. Pokeylope on Thu Aug 28, 2008 1:07 am, edited 1 time in total.
This might be useful to someone... I like files
http://gallery.rptools.net/v/contrib/No ... l.pdf.html
http://gallery.rptools.net/v/contrib/No ... l.pdf.html
-
- Giant
- Posts: 197
- Joined: Wed Jul 30, 2008 3:43 pm
Yes, they are. For example, here's a way to convert a number from 1-3 into the matching ordinal number.Plissken wrote:Are nested if statements possible?
Code: Select all
[h: Num = Enter_Your_Number]
[if(Num==1, "first", if(Num==2, "second", if(Num==3, "third", "Number too big!")))]
I love this macro in the explanation, it's what I was looking for to use in maptool.
But I see it doesn't work unless you make it as a token macro.
I'd prefer to have it as a campaign macro, for me to use with any token I select at that time.
I think it would require some major tweaking along the lines of using setting and reading token properties, but I haven't been able to do that succesfully (I'm new to scripting).
What I mean is so that I don't have to manually enter the macro in each token I make. I see there's no way to default this.
Also I'd prefer to have separate "Heal" and "Hurt" buttons.
Any pointers as to how to do these?
Edit: It makes a lot more sense to me to have positive numbers entered be interpreted as Healing, where negative ones would Hurt. It's more intuitive.
So I tweaked it into this (I don't use TempHP for now):
(hmm, can't post Code correctly, this eats some lines where I use color format)
Anyway, what I changed was pretty basic. Now positive numbers heal, negative numbers hurt.
But I see it doesn't work unless you make it as a token macro.
I'd prefer to have it as a campaign macro, for me to use with any token I select at that time.
I think it would require some major tweaking along the lines of using setting and reading token properties, but I haven't been able to do that succesfully (I'm new to scripting).
What I mean is so that I don't have to manually enter the macro in each token I make. I see there's no way to default this.
Also I'd prefer to have separate "Heal" and "Hurt" buttons.
Any pointers as to how to do these?
Edit: It makes a lot more sense to me to have positive numbers entered be interpreted as Healing, where negative ones would Hurt. It's more intuitive.
So I tweaked it into this (I don't use TempHP for now):
(hmm, can't post Code correctly, this eats some lines where I use color format)
Anyway, what I changed was pretty basic. Now positive numbers heal, negative numbers hurt.
You can do this now, though it is slightly annoying. Put the macro in a campaign button. Then select the token or tokens. Then RIGHT CLICK on the campaign macro button and in the pop-up context menu choose the option "Run as each selected". That will loop through all the selected tokens and run the macro as if it were a token macro. It is a little annoying but feasible. CAVEAT: Be VERY careful! The option right next to "Run as each selected" is DELETE, if I recall correctly. I've deleted a number of campaign macros by mistake by misplacing my mouse when I was trying to click on "Run as each selected."FdL wrote:But I see it doesn't work unless you make it as a token macro. I'd prefer to have it as a campaign macro, for me to use with any token I select at that time.
In the next release, b42, this will no longer be necessary. There will be a new checkbox on the campaign and global macro config panels that will let you automatically apply the macro to selected tokens. If you check that checkbox, then you can just normally click the button and it will do the exact same thing as the current "Run as each selected".
- fuleng6021
- Cave Troll
- Posts: 29
- Joined: Wed Oct 01, 2008 3:45 pm
Hello
I discovered maptool some time ago and also i had some difficulties inthe beginning now it seams at most is working. I also started to use macros. with them i have a problem, which is maybe too simple, but i did not find anyt solution on the forum.
a macro in [] like the one in the tutorial
Simple HTML example:
Code:
<b>Initiative roll:</b>
<br>My initiative is <span>[1d20+3]</span>.
should be output in the chat as:
but my output only shows the
My initiative is = "final sum"
the only differents to a code with {} is the light blue backround.
Did i set some basic properties wrong or why is my [] macro output like the {}?
I discovered maptool some time ago and also i had some difficulties inthe beginning now it seams at most is working. I also started to use macros. with them i have a problem, which is maybe too simple, but i did not find anyt solution on the forum.
a macro in [] like the one in the tutorial
Simple HTML example:
Code:
<b>Initiative roll:</b>
<br>My initiative is <span>[1d20+3]</span>.
should be output in the chat as:
but my output only shows the
My initiative is = "final sum"
the only differents to a code with {} is the light blue backround.
Did i set some basic properties wrong or why is my [] macro output like the {}?
The rolls were changed somewhat a few builds back. If you mouseover your shaded output in the chat window, you'll get a tooltip showing the expanded roll. If you want the roll expanded in chat, you need to specify that in the roll, like this:
<b>Initiative Roll:</b><br>
My initiative is [E: 1d20+3].
to get:
Initiative Roll:
My initiative is « d20+3 = 13 + 3 = 16 ».
<b>Initiative Roll:</b><br>
My initiative is [E: 1d20+3].
to get:
Initiative Roll:
My initiative is « d20+3 = 13 + 3 = 16 ».
I think there should be an option to set the default mode of display for rolls to solve that. I mean, it's hard for me as a DM to tell when the roll was a critical.
But anyway, I wanted some basic help or links to threads where I can learn to manipulate the health bar with scripts like the "Heal/Hurt" one I got.
Edit:
For criticals this seems to work (as pointed here http://forums.rptools.net/viewtopic.php?p=62405#62405)
My example application of this:
This has the disadvantage that I can't get to see the result of the roll, nor I can add the bonus to it. I just tried this, I'm not great at scripting so it should be something dumb I'm not doing. (I don't remember how to output the roll AND a bit of text together for example :s I tried [something] & "text" but doesn't work)
But anyway, I wanted some basic help or links to threads where I can learn to manipulate the health bar with scripts like the "Heal/Hurt" one I got.
Edit:
For criticals this seems to work (as pointed here http://forums.rptools.net/viewtopic.php?p=62405#62405)
My example application of this:
Code: Select all
[h: myroll=d20]
<b><span>Heavy Mace: [if(myroll>=threatrange, 'CRITICAL', myroll+5)]</span></b>, damage: <b><span>[1d8+1]</b></span>
- fuleng6021
- Cave Troll
- Posts: 29
- Joined: Wed Oct 01, 2008 3:45 pm
Thank youthe_meek wrote:The rolls were changed somewhat a few builds back. If you mouseover your shaded output in the chat window, you'll get a tooltip showing the expanded roll. If you want the roll expanded in chat, you need to specify that in the roll, like this:
<b>Initiative Roll:</b><br>
My initiative is [E: 1d20+3].
to get:
Initiative Roll:
My initiative is « d20+3 = 13 + 3 = 16 ».
So, I've been looking to create something like this, then I spot your work here and am inspired:FdL wrote:I think there should be an option to set the default mode of display for rolls to solve that. I mean, it's hard for me as a DM to tell when the roll was a critical.
But anyway, I wanted some basic help or links to threads where I can learn to manipulate the health bar with scripts like the "Heal/Hurt" one I got.
Edit:
For criticals this seems to work (as pointed here *no linky for a poor n00b*)
My example application of this:This has the disadvantage that I can't get to see the result of the roll, nor I can add the bonus to it. I just tried this, I'm not great at scripting so it should be something dumb I'm not doing. (I don't remember how to output the roll AND a bit of text together for example :s I tried [something] & "text" but doesn't work)Code: Select all
[h: myroll=d20] <b><span>Heavy Mace: [if(myroll>=threatrange, 'CRITICAL', myroll+5)]</span></b>, damage: <b><span>[1d8+1]</b></span>
I still can't get the "if()" statement to take combinations of dicerolls easily, but it will accept variables as arguments.
The following seems to get most of the way there, but I am still new to maptool and macros in general, so it probably needs some refinement.
Code: Select all
[h: critbonus=d6]
[h: mydamage=d10+1]
[h: roll=d20]
<b>Longbow +1:</b> [myroll=roll+9] [if(roll>=20, 'CRITICAL HIT! Deals 11 damage +' +critbonus , 'damage:' +mydamage )]
I expect that a lot of the variables could be altered to include token properties too...
Hope this helps.
Re: A (long) MapTool macro tutorial
I have a question. I notice that when you mouse over the calculation results of a macro that is set in a field in the token properties menu. The results of the calculation are show in edition to the numbers added together. I realize that simply mousing over the single digit number will briefly display the same calculation so it seems kinda redundant to have it all display in the chat window. I simply want to see My attack rolls end results and damage displayed. Not necessarily the entire calculation.
How can I code my macro ...say my wp damage [1d8]+ whatever code is in my macro for the given ability combat bonuses ect... in my token property so it doesn't display the entire calculation in the chat window?
How can I code my macro ...say my wp damage [1d8]+ whatever code is in my macro for the given ability combat bonuses ect... in my token property so it doesn't display the entire calculation in the chat window?
Re: A (long) MapTool macro tutorial
i believe you have to put the ! before and after the code to not print it.