RPTools.net

Discussion and Support

Skip to content

It is currently Tue Oct 17, 2017 4:32 am 






Reply to topic  [ 5 posts ] 

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Cave Troll
 
Joined: Sun Mar 22, 2015 2:57 pm
Posts: 31
 Post subject: Help with an Initiative Macro
PostPosted: Wed Oct 11, 2017 5:59 pm 
For my Pathfinder game, I have a fairly basic framework that works as a battle mat and basic combat manager. I have an "Add to Initiative" macro that handles the start of a combat.

The first step is to select the combatants. Then the macro runs a FOREACH loop to generate a form with the characters' names and an input window that defaults to "1d20+<initiative modifier>", but that can also take a specific value so my players can roll their own initiatives. This all works great.

My problem is I want to skip characters that are "connected" to specific PCs. Animal companions, for instance, go on their master's initiative turn. It happens that this group is lousey with these connected characters - two different animal companions, one follower with a mount, and often times mounts for the other PCs as well. This means I'm having to individually click all the combatants to make sure I don't include the tokens that don't roll initiative.

I have added a new property called "Companion" that I am giving a True/False (1/0) value. What I would like is to add a step in the macro that takes the first collection of names, runs a FOREACH to check the status of the Companion property, then spits out a new list that strips the companions and feeds that new list into the existing code. This would allow me to sweep the mouse over the battle field to select everything at once.

The problem is it has been so very long since I worked with this macro that I can't quite figure out how to do this. I'm sure it's got to be pretty easy, but everything I've tried is screwing things up. Ah, the joys of an old brain...


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9410
Location: Netherlands
 Post subject: Re: Help with an Initiative Macro
PostPosted: Thu Oct 12, 2017 2:01 am 
Hard to say without the code but it probably something like this

Code:
[filteredToks ""]
[foreach (
toktoks),  if(!getProperty("companion"tok)):filteredToks listAppend(filteredTokstok)] 

_________________
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  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1680
Location: Chicagoland
 Post subject: Re: Help with an Initiative Macro
PostPosted: Thu Oct 12, 2017 11:53 am 
I'll tell you how I handle it in my Pathfinder Framework.

Instead of setting the property Companion to true/false, instead set it to the 'Master's Name".

On your first loop, skip any tokens that have Companion != ""

On your second loop, get the "Master's init" like:
[token(Companion): masterInit = getInitiative()] *note: here I'm using Companion as a variable, so Companion is actually == to Master's name.

And then set the companion's initiative to masterInit (or masterInit - 0.001) if you want then to act just before the master.

Of course you could also set "Companion's name" on the Master token and set the companion's init when you set the master's init on the first pass. I do it the other way so you can have multiple companions to a master vs 1:1.

_________________
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
More information here: MapTool Nerps! Fork | TokenTool Nerps! Fork
Custom TokenTool (version 1.0b33): TokenTool.exe


Top
 Profile  
 
User avatar  Offline
Cave Troll
 
Joined: Sun Mar 22, 2015 2:57 pm
Posts: 31
 Post subject: Re: Help with an Initiative Macro
PostPosted: Thu Oct 12, 2017 5:01 pm 
@Jamz - That's an interesting idea. Is your framework posted online somewhere? I'd like to take a look at it if that's okay.


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1680
Location: Chicagoland
 Post subject: Re: Help with an Initiative Macro
PostPosted: Fri Oct 13, 2017 2:54 pm 
It is, but you will need my latest fork to open it...

https://drive.google.com/file/d/0B2c01Y ... sp=sharing

I just finished overhauling my timers so now you can put any condition/mod/buff/poison/disease on a token with a timer and it will let you know when it ticks off or expires (in or out of combat).

I use a unix style calendar counting seconds since 4716 (or when ever you set your campaign to start) so it's pretty robust. I also just added Mythic Dual Initiative and redid some of my other init system (delayed actions/ready actions) etc.

_________________
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
More information here: MapTool Nerps! Fork | TokenTool Nerps! Fork
Custom TokenTool (version 1.0b33): TokenTool.exe


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 5 posts ] 

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