RPTools.net

Discussion and Support

Skip to content

It is currently Thu Aug 17, 2017 1:06 am 






Reply to topic  [ 57 posts ]  Go to page Previous  1, 2, 3, 4  Next

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Giant
 
Joined: Mon Aug 11, 2008 8:24 pm
Posts: 118
 Post subject:
PostPosted: Wed Aug 27, 2008 7:10 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 12:07 am, edited 1 time in total.

Top
 Profile  
 
User avatar  Offline
Kobold
 
Joined: Wed Jul 23, 2008 11:53 pm
Posts: 8
Location: Calgary, AB
 Post subject:
PostPosted: Wed Aug 27, 2008 9:49 pm 
This might be useful to someone... I like files :)

http://gallery.rptools.net/v/contrib/Norwolf/Intro+to+Macro+Prog+in+MapTool.pdf.html


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Mon Jan 07, 2008 10:44 pm
Posts: 438
 Post subject:
PostPosted: Fri Aug 29, 2008 1:44 pm 
Are nested if statements possible?


Top
 Profile  
 
 Offline
Giant
 
Joined: Wed Jul 30, 2008 2:43 pm
Posts: 199
 Post subject:
PostPosted: Fri Aug 29, 2008 2:59 pm 
Plissken wrote:
Are nested if statements possible?


Yes, they are. For example, here's a way to convert a number from 1-3 into the matching ordinal number.
Code:
[h: Num = Enter_Your_Number]
[if(Num==1, "first", if(Num==2, "second", if(Num==3, "third", "Number too big!")))]


You can carry on embedding if() functions like that until you get bored, or until your code becomes an unreadable black hole :)


Top
 Profile  
 
User avatar  Offline
Giant
 
Joined: Thu Feb 28, 2008 5:21 pm
Posts: 201
 Post subject:
PostPosted: Sat Sep 06, 2008 1:24 pm 
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.


Top
 Profile  
 
 Offline
Dragon
 
Joined: Sat Apr 21, 2007 3:51 pm
Posts: 674
 Post subject:
PostPosted: Sun Sep 07, 2008 1:33 am 
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.


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."

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".


Top
 Profile  
 
User avatar  Offline
Giant
 
Joined: Thu Feb 28, 2008 5:21 pm
Posts: 201
 Post subject:
PostPosted: Sun Sep 07, 2008 1:08 pm 
That sounds awesome. I'll be waiting for b42! Thanks!


Top
 Profile  
 
 Offline
Kobold
 
Joined: Sat Sep 20, 2008 8:02 pm
Posts: 19
 Post subject:
PostPosted: Fri Sep 26, 2008 2:46 pm 
Just wanted to give props to the author of this. I spent waaay too many hours trying to parse macros to figure it out, and this has saved me a whole lot of time.

Thanks again!


Top
 Profile  
 
User avatar  Offline
Kobold
 
Joined: Wed Oct 01, 2008 2:45 pm
Posts: 24
 Post subject:
PostPosted: Wed Oct 01, 2008 3:09 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:
Image

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 {}?


Top
 Profile  
 
 Offline
Giant
 
Joined: Fri Aug 01, 2008 8:18 am
Posts: 103
 Post subject:
PostPosted: Wed Oct 01, 2008 3:21 pm 
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 ».


Top
 Profile  
 
User avatar  Offline
Giant
 
Joined: Thu Feb 28, 2008 5:21 pm
Posts: 201
 Post subject:
PostPosted: Wed Oct 01, 2008 6:04 pm 
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:
Code:
[h: myroll=d20]

<b><span>Heavy Mace: [if(myroll>=threatrange, 'CRITICAL', myroll+5)]</span></b>, damage: <b><span>[1d8+1]</b></span>


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)


Top
 Profile  
 
User avatar  Offline
Kobold
 
Joined: Wed Oct 01, 2008 2:45 pm
Posts: 24
 Post subject:
PostPosted: Wed Oct 01, 2008 11:27 pm 
the_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 ».


Thank you


Top
 Profile  
 
 Offline
Kobold
 
Joined: Fri Nov 28, 2008 8:37 pm
Posts: 4
 Post subject:
PostPosted: Fri Nov 28, 2008 9:26 pm 
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:
Code:
[h: myroll=d20]

<b><span>Heavy Mace: [if(myroll>=threatrange, 'CRITICAL', myroll+5)]</span></b>, damage: <b><span>[1d8+1]</b></span>


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)

So, I've been looking to create something like this, then I spot your work here and am inspired:
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:
[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 )]

This shows what you rolled (unexpanded unfortunately) and tells you the weapon's max damage plus any bonus it gets from crits (for being magic etc.) on a critical roll, or just rolls damage if it's a non-crit.

I expect that a lot of the variables could be altered to include token properties too...

Hope this helps.


Top
 Profile  
 
 Offline
Kobold
 
Joined: Sun Jul 27, 2008 8:59 am
Posts: 4
 Post subject: Re: A (long) MapTool macro tutorial
PostPosted: Tue Dec 16, 2008 7:33 pm 
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?


Top
 Profile  
 
 Offline
Kobold
 
Joined: Wed Nov 19, 2008 10:10 pm
Posts: 13
 Post subject: Re: A (long) MapTool macro tutorial
PostPosted: Tue Dec 16, 2008 9:18 pm 
i believe you have to put the ! before and after the code to not print it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 57 posts ]  Go to page Previous  1, 2, 3, 4  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 is 1 user online :: 0 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: No registered users and 1 guest





cron

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

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman