RPTools.net

Discussion and Support

Skip to content

It is currently Wed Sep 20, 2017 11:35 am 






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

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12102
Location: Tampa, FL
 Post subject: Re: A (long) MapTool macro tutorial
PostPosted: Wed Dec 17, 2008 1:05 am 
Lyve1 wrote:
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?

Read the first post again, in the section under What Macros Can Do. Note that some functions are built in and other functions might require you to write HTML that produces the effect you're looking for.


Top
 Profile  
 
 Offline
Kobold
 
Joined: Sat Feb 24, 2007 5:37 am
Posts: 2
 Post subject: Re: A (long) MapTool macro tutorial
PostPosted: Mon Jan 26, 2009 11:24 pm 
I know that other scripting and programming languages support labels and or functions, is that a possibility with Macros? I.E.

Code:
<!-- Reset Variables to be safe. -->
     [DiceRolled=0]
     [Successes=0]
     [Botch=0]

<!-- Get number of Dice to Roll [LoopControlVariable=Dice_to_roll] -->

<!-- Get the Difficulty or number to beat [Difficulty=What_is_the_difficulty] -->

<!-- Have label at start of code where you would like everything that follows to be able to be repeated by being called. -->
     [Label:MyLabel]

<!-- Start Loop -->
     if(LoopControlVariable>0, <!-- Increment DiceRolled [DiceRolled = DiceRolled + 1] -->, <!-- Do nothing if false -->)

<!-- Display Roll and save it to a variable for comparisions -->
     if(LoopControlVariable>0, "Die " + {DiceRolled} " = " + [RollVal=1d10], <!-- Do nothing if false -->)

<!-- What is the roll, success, failure, one, or ten? -->
     if(RollVal>=Difficulty,[Successes=Successes+1], if(RollVal==1 [Successes=Successes-1], <!-- Do Nothing -->))

<!-- Is it a success and thus canceled out all botching? -->
     if(RollVal>=Difficulty,[Botch=Botch+1], <!-- Do Nothing -->)
     if(RollVal==10,[Successes=Successes+1], if(RollVal==1,[LoopControlVariable = LoopControlVariable + 1]))

<!-- Decrement LoopControlVariable -->
      [LoopControlVariable = LoopControlVariable - 1]

<!-- Go back up to MyLabel -->
      [Goto MyLabel]

<!-- Comma Delineating False Code -->
     ,
      [Insert Code that outputs all that stuff here])
[Move on to more code since the Loop has finished]

Most of my experience comes from PASCAL so my thoughts and ideas on scripting might be a little bit off. I'm just looking for a way to cut down on macro code and not have to copy and paste and repeat. My ideal usage would be for an Old World of Darkness game like Werewolf: The Apocalypse. You could have one roll die function that would repeat for the number of dice you had (prompted for number of dice at the beginning and the difficulty) and that would keep track of the number of dice rolled then spew the information out at the end of it all.

I kind of lost concentration on what i was writing, and I don't need to put all the code up there that I was thinking of for this post to get the idea across I don't think. I'll save us all the headache hehehe.


Top
 Profile  
 
 Offline
Great Wyrm
 
Joined: Sun Jun 22, 2008 6:53 pm
Posts: 2102
Location: Melbourne, Australia
 Post subject: Re: A (long) MapTool macro tutorial
PostPosted: Mon Jan 26, 2009 11:35 pm 
There is no Label/goto Label like functionality. But there is looping
http://lmwcs.com/maptool/index.php?title=Macros:Branching_and_Looping
There are while/for/foreach/count loops. Unfortunately there are no continue/break analogues so you must go through the whole loop, but in a lot of cases that is not that big a problem.


Top
 Profile  
 
 Offline
Kobold
 
Joined: Thu Feb 19, 2009 4:07 pm
Posts: 12
 Post subject: Re: A (long) MapTool macro tutorial
PostPosted: Thu Feb 19, 2009 4:10 pm 
Is there a way to alter the token's health bar via script?

I.e. is there a token variable to access that health bar setting?


Top
 Profile  
 
 Offline
Kobold
 
Joined: Thu Feb 19, 2009 4:07 pm
Posts: 12
 Post subject: Re: A (long) MapTool macro tutorial
PostPosted: Thu Feb 19, 2009 4:15 pm 
Oop.. .posted too soon. I found it:

setBar(name, percentage)

http://lmwcs.com/maptool/index.php?titl ... ons:setBar


Top
 Profile  
 
 Offline
Kobold
 
Joined: Tue Aug 03, 2010 9:43 pm
Posts: 1
 Post subject: Re: A (long) MapTool macro tutorial
PostPosted: Sun Aug 08, 2010 6:15 pm 
I'm trying to make a simple macro that will detect critical hits. I think I can do that on my own, but I've been running into major problems trying to make everything simple. Basically, I use {} for my roll commands because I don't want to see the whole thing, and I want it to be able to detect critical hits because I cant see the entire result.

I am trying to modify this macro, and once I do that, I can adapt it to all other attack macro commands.

Serraziel tries to capture her opponent in her jaws!
<br>She rolls: <b>{1d20+4}</b>

This makes it simple and easy to read, but unfortunately, if left like this, I would have to remember the attack bonus and manually subtract it from each result to see if it is a critical hit. Can anyone help? I have looked in many tutorials on how to use critical hits but most of them either give me a box asking me to enter the roll result, or simply give me an error, saying I have invalid commands.


Top
 Profile  
 
 Offline
Kobold
 
Joined: Wed Oct 06, 2010 9:35 am
Posts: 24
 Post subject: Re: A (long) MapTool macro tutorial
PostPosted: Wed Oct 06, 2010 9:42 am 
You can detect critical hits pretty easily.
Just use this to make your d20 roll and set an Attack Bonus:

[h: Roll=d20]
[h: AttackBonus=4]

Then you use this to set the Critical Hit threshold, I will assume a natural 20 for this:

[h: CriticalHit = 20]

Then use this:

[if(Roll>=CriticalHit),CODE:{Critical Hit ([Roll+AttackBonus])!};{[Roll+AttackBonus]}]

That should do it for you. So your example would go from this:

Serraziel tries to capture her opponent in her jaws!
<br>She rolls: <b>{1d20+4}</b>

To this:

Serraziel tries to capture her opponent in her jaws!
[h: Roll=d20]
[h: CriticalHit = 20]
[h: AttackBonus=4]
<br>She rolls: <b>[if(Roll>=CriticalHit),CODE:{Critical Hit ([Roll+4])!};{[Roll+4]}]</b>

Hope that helps.


Top
 Profile  
 
 Offline
Kobold
 
Joined: Thu Mar 31, 2011 3:17 pm
Posts: 13
 Post subject: Re: A (long) MapTool macro tutorial
PostPosted: Sat Apr 16, 2011 5:10 pm 
Hello Everybody

I am totaly new to all this, I started to work Image and Pog files into the Gametable app. a couple of months ago and ran across Maptool app. about a month ago, and have to say it's alot better, but alot more advanced. I love the idea of Macros to play out commands but don't have the first idea about scripting.I have begun by looking into these Macro Scripts and it dosn't seem too difficult,and even got the couple I've found running, but rather than "Reinvent the Wheel" I was wondering where I might find a comprehensive list of basic and/or general Macros Scrips that could be copied and pasted. As this can be quite time consuming and I want to start Playing as soon as possible.

I Have tried a couple of the frameworks and they seem great but I'm unsure of how to apply the existing Macros to the tokens, or which do what exactally.

Exellent tutorial, It really gave a good grasp on What Macros are and what they an do. Thank You for making such resources available.


Top
 Profile  
 
 Offline
Kobold
 
Joined: Sun Jul 24, 2011 10:47 pm
Posts: 1
 Post subject: Re: A (long) MapTool macro tutorial
PostPosted: Sun Jul 24, 2011 10:51 pm 
I am confused as to how you can macro out one token doing something to another token. For example, Alice wants to hit Bill with a sword. How does one macro out Alice's attack roll and damage, then compare it to Bill's AC and subtract the damage from his hit points if it succeeds?

Once I grok that, I have a feeling that maptools is going to find its way to even my tabletop games (not just my internet games!) because it will be so incredibly handy!


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12102
Location: Tampa, FL
 Post subject: Re: A (long) MapTool macro tutorial
PostPosted: Mon Jul 25, 2011 9:11 pm 
You want something called "Library tokens". Macros on a Lib: token can be executed in a trusted mode if everything is set up correctly. In that mode they can modify properties on other tokens, not just the token that invoked the Lib: macro in the first place.

Start at the Main Page of the wiki.


Top
 Profile  
 
 Offline
Kobold
 
Joined: Mon Apr 22, 2013 12:56 pm
Posts: 2
 Post subject: Re: A (long) MapTool macro tutorial
PostPosted: Mon Apr 29, 2013 1:10 am 
So, I just want a simple macro that displays damage and attack rating. However, this seems to be the most difficult thing I've ever had to do in my life. I type in this in the command section of the macro:

I make an attack roll!<br>
<b>Attack</b>: [1d20+7]<br>
<b>Damage</b>: [1d8+5]

I get this as a display:
I make an attack roll!
Attack: 23 Damage:Attack: 23
Damage:: 23
Damage:Damage:: 12

Even worse, I enter this:
I attack [1d20] and deal [1d8] damage.

And I see this:
I attack 16 and dealand deal 5 damage.

Forgive me if this has been addressed, but I can't seem to find an answer anywhere.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9375
Location: Netherlands
 Post subject: Re: A (long) MapTool macro tutorial
PostPosted: Tue Apr 30, 2013 3:28 pm 
J0fSpades wrote:
So, I just want a simple macro that displays damage and attack rating. However, this seems to be the most difficult thing I've ever had to do in my life....

this is really asking for some snappy comments now is it :mrgreen:
Quote:
I make an attack roll!<br>
<b>Attack</b>: [1d20+7]<br>
<b>Damage</b>: [1d8+5]

please use the 'code' tags, which you can find at the top of the post edit window.

ok to help you out:
first of all you've encountered a bug thats currently active in b89 of MT. turn off the smileys in the settings and you won't get the 'double post' 'double post' anymore :wink:
second, start reading theroll options in the wiki. Especially: r,s,h and g. These used most.
your example then becomes (per example):
Code:
I make an attack roll!<br>
 <b>Attack</b>: [r:1d20+7]<br>
 <b>Damage</b>: [r:1d8+5]

or
Code:
I make an attack roll!<br>
 <b>Attack</b>: [r,g:1d20+7]<br>
 <b>Damage</b>: [r,g:1d8+5]

or
Code:
I make an attack roll!<br>
 <b>Attack</b>: [r,s:1d20+7]<br>
 <b>Damage</b>: [r,s:1d8+5]

or you can leave it as you did (but then turn off the smiley in the settings).

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS


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

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 2 users online :: 0 registered, 0 hidden and 2 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 2 guests





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

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman