MapTools Macros

5 posts / 0 new
Last post
Byzantine Laser Byzantine Laser's picture
MapTools Macros
I know I've seen at least a few mentions of running games via MapTools. Has anybody done so and made custom macros for it? I'm starting to set up MapTools to work for Eclipse Phase, and the more things I can automate, the better. Within reason, at least. So far, I've mainly got initiative tracking set up. Since it was a bit of a pain in the butt, I figured I'd share the macros so that others can use them. [b]These assume that you assign a new token property called "Initiative" to all tokens in the game (easily done through the Campaign Properties menu.)[/b] MapTools tokens have initiative by default, but it's stored separately from the other properties, and after some fiddling around, I couldn't find an easy way to access it. So, I took five seconds to add my own. Both of these macros should probably be added to the Global panel so that players can't hit them. On the Campaign panel, I put a simple Dice macro that rolls 1d100. [collapse collapsed title=Next Initiative] This macro does the following: [list][*] If there is no fight ongoing, a fight begins. The round number becomes 1, and all tokens on the map roll initiative and are added to the Initiative list. If a token has no Initiative assigned to it, it appears to default to 0. Whoever had the highest modified initiative roll receives the initiative.[*] If a fight is ongoing and the creature that currently has initiative isn't the last in the list for this round, the next creature now has the initiative.[*] If a fight is ongoing and the creature that currently has initiative is the last in the list for this round, the round ends, the next round begins, all creatures reroll initiative, and the highest initiative roll among them receives the initiative.[/list] Note that this macro outputs the round number and whose turn it is. In my code, they're bolded to stand out. The boards seem to filter out my HTML tags, so you'll have to add the bold tags in yourself. [code] [r, IF(getCurrentInitiative() +1 == initiativeSize()), CODE: { [h: roundNumber = getInitiativeRound()] [r, IF(roundNumber != 0): "Round over!"] [h:setCurrentInitiative(-1)] [h, IF(roundNumber==-1): roundNumber = 0; roundNumber = roundNumber + 1] [h: setInitiativeRound(roundNumber)] [h: roundNumberConcat = "Round " + roundNumber + " start!"] [r: roundNumberConcat] [h: tokenList = getTokens()] [h,foreach(token, tokenList), CODE: { [h: switchToken(token)] [h: init = getProperty("Initiative", token)] [h: addToInitiative(token)] [h: setInitiative(1d100 + init)] }] [h: sortInitiative()] [h: nextInitiative()] [h: initToken = getInitiativeToken()] [h: initName = getName(initToken)] [h: outputLine = "" + initName + " has the initiative!"] [r: outputLine] }; { [h: nextInitiative()] [h: initToken = getInitiativeToken()] [h: initName = getName(initToken)] [h: outputLine = "" + initName + " has the initiative!"] [r: outputLine] }] [/code] [/collapse] [collapse collapsed title=End Fight] This macro ends the ongoing fight. The initiative list is cleared and the round number is reset to 0. [code] [h: removeAllFromInitiative()] [h: setInitiativeRound(0)] [r: "Fight over!"] [/code] [/collapse]
thelabmonkey thelabmonkey's picture
Re: MapTools Macros
I've been looking at rptools.net and maptool trying to see what it would take to create an Eclipse Phase framework in there... but from what I can tell, the initiative tool doesn't support multi-round initiative turns (like if you have a character with a speed of 2 or 3). Am I wrong? Can your macro handle this?
booga booga's picture
Re: MapTools Macros
Actually it is possible to handle multi-initiative per round per token. Here is a sample macro that can do that (it also assumes that there is an "Initiative" and "Speed" token properties setup in the Campaign properties. This is assuming that the maximum speed reachable would be 4, it can be adjusted for more or less of course. A token with a total initiative of 146 (including dice) and a speed of 3, would have 3 entries in the Initiative, ranked at 4-146, 3-146 and 2-146 (the number before the hyphen allows the proper sorting of the initiatives in the token panel). Here's the code (it can be integrated in the OP's code for automating initiative for all tokens on the map) : [h:removeFromInitiative()] [h:NumAct=Speed)] [h:Init = 1d100+Initiative)] [h:NumAct] [h:if(NumAct>1,"s","")] [h:addToInitiative(1,"4-"+if(Init<10,"0","")+Init)] [h,IF(NumAct>1):addToInitiative(1,"3-"+if(Init<10,"0","")+Init)] [h,IF(NumAct>2):addToInitiative(1,"2-"+if(Init<10,"0","")+Init)] [h,IF(NumAct>3):addToInitiative(1,"1-"+if(Init<10,"0","")+Init)] [h:sortInitiative()] Initiative Initiative: [t:Init] Speed : [t:NumAct]
thelabmonkey thelabmonkey's picture
Re: MapTools Macros
Ooooh. Want. This looks like the seed for a MapTools EP framework... I don't plan on using the actual map as I tend to play fast and loose, but using it to track initiative, damage, and ammo would be very handy.
coloneldork coloneldork's picture
Re: MapTools Macros
If you're not going to use the map, then Init Tool would show your initiative with the 4 rounds for speed better. I'm working on that and a Character Tool generator for my campaign now. I'll post it somewhere when it is ready.