I am unclear where I get the token GUID from for these functions.jay wrote:I've just added a bunch of macro functions and variable support. The following macro variables are available:The list of functions is below. Arguments that are in italics are optional. For token arguments to be optional the macro must be a token macro. The token argument is the GUID of the token. The following functions are available:
- token.init Get the initiative value of the first instance of a token in the initiative list and set the initiative value for all instances of a token in the initiative list.
- token.initHold Get the initiative hold value of the first instance of a token in the initiative list and set the initiative value for all instances of a token in the initiative list. The value is 0 to clear the hold flag and 1 to set it.
- init.roundGet and set the initiative round. Only the GM can set the initiative round.
- init.currentGet and set the current initiative index. Only the GM can get and set the current initiative index.
- getInitiative(token) Get the initiative value of the first instance of a token in the initiative list.
- setInitiative(token, value) Set the initiative value for all instances of a token in the initiative list.
- getInitiativeHold(token) Get the initiative hold value of the first instance of a token in the initiative list. The value is a 0 if false and 1 if true.
- setInitiative(token, value) Set the initiative hold value for all instances of a token in the initiative list. The value can be a number (0 == false, all others true) or a string (true == true, all others false ignoring case).
- addToInitiative(token, allow-duplicates, initiative) Add a token to the initiative list. If the allow-duplicates flag is false (default is false) then the macro will not add the token if it is already in the initiative list. If the initiative value argument is passed then the value of the initiative will be set for the token whether it was actually added or not. To set the initiative argument you must set the allow-duplicates argument.
- removeFromInitiative(token) Removes all instances of a token from the initiative list. This method can only be executed by the GM.
- addAllToInitaitive(allow-duplicates) Add all tokens to the initiative panel. If the allow-duplicates flag is false (default is false) then the macro will not add a token if it is already in the initiative list.
- addAllPCsToInitaitive(allow-duplicates) Add all PC tokens to the initiative panel. If the allow-duplicates flag is false (default is false) then the macro will not add a token if it is already in the initiative list.
- addAllNPCsToInitaitive(allow-duplicates) Add all NPC tokens to the initiative panel. If the allow-duplicates flag is false (default is false) then the macro will not add a token if it is already in the initiative list.
- nextInitiative() Move to the next item in the initiative list. This function can only be executed by the GM.
- sortInitiative() Sort the items in the initiative list by their initiative value. May only be executed by the GM.
- initiativeSize() Get the number of items in the initiative list.
- removeAllFromInitaitive() Remove all tokens from the initiative panel, reset the round counter and clear the current token.
- removeAllPCsFromInitaitive() Remove all PC tokens from the initiative panel, reset the round counter and clear the current token.
- removAllNPCsFromInitaitive() Remove all NPC tokens from the initiative panel, reset the round counter and clear the current token.
- getInitiativeRound() Get the initiative round.
- setInitiativeRound(value) Set the initiative round. Only the GM can call this function.
- getCurrentInitiative() Get the index of the item that currently has initiative. This function can only be called by the GM.
- setCurrentInitiative(value) Set the index of the item that currently has initiative. Only the GM can call this function.
MapTool 1.3 Development Build 41
Moderators: dorpond, trevor, Azhrei, Craig
- lmarkus001
- Great Wyrm
- Posts: 1867
- Joined: Sat Mar 29, 2008 12:30 am
- Location: Layfayette Hill, PA
From this thread ( http://forums.rptools.net/viewtopic.php ... c&start=85 ) these are the Initiative Panel functions I am aware of:
- UntoldGlory
- Great Wyrm
- Posts: 1649
- Joined: Sun Mar 16, 2008 8:12 pm
Okay, this was probablly answered in b39, but I haven't messed with macros since b38.
What do I have to do again to equations in stats so I can use them in macros?
For instance, currently for "DexBonus" I have: (floor((Dexterity-10) / 2))
But if I use "DexBonus" in a macro it just prints out (floor((Dexterity-10) / 2)). I've tried it enclosed in {}, [] and with "eval" in front. What am I missing?
What do I have to do again to equations in stats so I can use them in macros?
For instance, currently for "DexBonus" I have: (floor((Dexterity-10) / 2))
But if I use "DexBonus" in a macro it just prints out (floor((Dexterity-10) / 2)). I've tried it enclosed in {}, [] and with "eval" in front. What am I missing?
-
- Giant
- Posts: 197
- Joined: Wed Jul 30, 2008 3:43 pm
I just tried setting DexBonus to {floor(Dexterity/2 - 5)} and it's working. If you're still having trouble, please start a thread with more details of what you're doing and I'm sure we'll track it down quickly.UntoldGlory wrote:Okay, this was probablly answered in b39, but I haven't messed with macros since b38.
What do I have to do again to equations in stats so I can use them in macros?
For instance, currently for "DexBonus" I have: (floor((Dexterity-10) / 2))
But if I use "DexBonus" in a macro it just prints out (floor((Dexterity-10) / 2)). I've tried it enclosed in {}, [] and with "eval" in front. What am I missing?
- trevor
- Codeum Arcanum (RPTools Founder)
- Posts: 11311
- Joined: Mon Jan 09, 2006 4:16 pm
- Location: Austin, Tx
- Contact:
Received.Mr. Pokeylope wrote:Okay, I know why it's doing that and it's a simple fix. I'll send Trevor a patch for it.knizia.fan wrote:There's a bug with the new expression output. If a [] expression contains a line break, the output now is completely bare -- no highlight, no << >> quotes, no tooltip. Also, the equal sign is missing at the end.
Keep up the great testing, lets see if there's anything else messed up that can get fixed today so we can make another build tonight or tmrw with the fix.
Dreaming of a 1.3 release
Wow, that's great stuff!lmarkus001 wrote:From this thread ( http://forums.rptools.net/viewtopic.php ... c&start=85 ) these are the Initiative Panel functions I am aware of:
Can we get (one of?) the people who are working to keep the wiki docs up to date to add this information to the wiki? If we can keep the wiki (reasonably) up to date, we can point people there when they have questions.
To be honest, I haven't been reviewing the documentation work that has been going on. I'll take a look over there right now and start a thread with feedback, if I think of any.
It also appears broken to me. Several of my macros aren't working with default properties anymore. For instance:knizia.fan wrote:I just tried setting DexBonus to {floor(Dexterity/2 - 5)} and it's working. If you're still having trouble, please start a thread with more details of what you're doing and I'm sure we'll track it down quickly.UntoldGlory wrote:Okay, this was probablly answered in b39, but I haven't messed with macros since b38.
What do I have to do again to equations in stats so I can use them in macros?
For instance, currently for "DexBonus" I have: (floor((Dexterity-10) / 2))
But if I use "DexBonus" in a macro it just prints out (floor((Dexterity-10) / 2)). I've tried it enclosed in {}, [] and with "eval" in front. What am I missing?
The property
Bloodied:{floor(MaxHP/2)}
If i impersonate and type [E: Bloodied]
I get « Bloodied = »
My macros in B40 work, in this build if i try to run say a UG's damage macro without filled in bloodied value I get:
Could not execute the command: Illegal argument type java.lang.String, expecting java.math.BigDecimal
If i type in the bloodied formula into the token it works fine.
Heres the macro code if your wondering
Code: Select all
<span style="font-size:0"> [DamageTaken = ChangeHP] [TempHP = TempHP - DamageTaken] [HP = HP + min(0, TempHP)] [TempHP = max(0,TempHP)] [state.Dying = 1 - max(0,min(1,HP))][state.Bloodied = 1 - max(0, min(1,HP - Bloodied))] [state.Prone = state.Dying + state.Prone]</span> <b> [DamageTaken]! </b> [HP] remaining.
So far I can't get
{addAllPCsToInitaitive(0)}
to work. I get the message
Same message for removeAllPCsFromInitaitive(), removeAllFromInitaitive(), removAllNPCsFromInitaitive(), addAllToInitaitive(), addAllNPCsToInitaitive()
nextInitiative() only works if the init has already started otherwise it gives
I'll play with it more and update as I find more stuff
{addAllPCsToInitaitive(0)}
to work. I get the message
Code: Select all
Could not execute the command: Undefined function: addAllPCsToInitaitive
nextInitiative() only works if the init has already started otherwise it gives
Code: Select all
Could not execute the command: -1
I'm sure that you would have seen it eventually but you have misspelled initiative in the commands that you listed.RPTroll wrote:So far I can't get
{addAllPCsToInitaitive(0)}
to work. I get the messageSame message for removeAllPCsFromInitaitive(), removeAllFromInitaitive(), removAllNPCsFromInitaitive(), addAllToInitaitive(), addAllNPCsToInitaitive()Code: Select all
Could not execute the command: Undefined function: addAllPCsToInitaitive
nextInitiative() only works if the init has already started otherwise it gives
I'll play with it more and update as I find more stuffCode: Select all
Could not execute the command: -1
Last edited by Pyroman on Wed Aug 27, 2008 12:22 pm, edited 1 time in total.
I get the same (essential) error for setInitiative(), so I think there are some problems EITHER with my implementation or the function list. What's going on here.RPTroll wrote:So far I can't get
{addAllPCsToInitaitive(0)}
to work. I get the messageSame message for removeAllPCsFromInitaitive(), removeAllFromInitaitive(), removAllNPCsFromInitaitive(), addAllToInitaitive(), addAllNPCsToInitaitive()Code: Select all
Could not execute the command: Undefined function: addAllPCsToInitaitive
nextInitiative() only works if the init has already started otherwise it gives
I'll play with it more and update as I find more stuffCode: Select all
Could not execute the command: -1
Jay, if you could clarify these, it might help.
0+0=1, for very unstable CPUs.
- Mr. Pokeylope
- Giant
- Posts: 118
- Joined: Mon Aug 11, 2008 9:24 pm
Yep, working on a fix.knizia.fan wrote:Mr. Pokeylope, another issue for you to look at. Smileys are breaking the output.This produces a mess in the output. It's because the =s is being interpreted as a smiley, which inserts an <img> tag in the middle of the output. Build 40 also (annoyingly) puts a smiley in the output, but your new output code is more sensitive to garbage like that.Code: Select all
[s=2]....[x=s]
Hmm, that's a much simpler solution that what I was trying (disabling smiley parsing within roll output, which is tricky to do). It wouldn't fix the problem completely, but it should fix the majority of cases. Would anyone get too upset if the = versions of the smileys stopped working?knizia.fan wrote:I'll leave the fix for you to include in your patch to fix the newline problem. A more drastic solution is to eliminate the option for smileys like =s and only accept the colon versions like :s (in smileyMap.xml).
That should be doable, yeah.knizia.fan wrote:Hm, would it be possible to fix all these problems by replacing quotes with HTML character codes (i.e. ' for single quotes) when you create the tooltip text?
Awesome stuff, yet again. I have to admit, though... it'd be really nice to get an interim release that was _just_ bug fixes as a sorta 'stable' build. I think b34 was the last build that felt truly stable.
I'm guessing we're closing in on the final 1.3 release, though?
Anyhow, once again impressed at how much this program continually improves and grows and how well it compares to any other options, free or paid, out already or still under production.
I'm guessing we're closing in on the final 1.3 release, though?
Anyhow, once again impressed at how much this program continually improves and grows and how well it compares to any other options, free or paid, out already or still under production.
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
I'm using:RPTroll wrote:So far I can't get
{addAllPCsToInitaitive(0)}
to work.
[addAllPCsToInitiative(0)]
And that seems to work.
I'm using a combat announcement macro that adds all the PC's and sets the init.round to 1 at the same time.nextInitiative() only works if the init has already started otherwise it gives
That makes my "Next Init" macro work, but every time I click it on my GM Token (where I keep a lot of my macros), it sends a return to the chat window. :/
Edit:
My [h:sortInitiative()] macro sends a blank return to the chat window too. Any way around that?
I cut and pasted them out of the section above. I'll try them properly spelled and see what happens.Pyroman wrote:I'm sure that you would have seen it eventually but you have misspelled initiative in the commands that you listed.RPTroll wrote:So far I can't get
{addAllPCsToInitaitive(0)}
to work. I get the messageSame message for removeAllPCsFromInitaitive(), removeAllFromInitaitive(), removAllNPCsFromInitaitive(), addAllToInitaitive(), addAllNPCsToInitaitive()Code: Select all
Could not execute the command: Undefined function: addAllPCsToInitaitive
nextInitiative() only works if the init has already started otherwise it gives
I'll play with it more and update as I find more stuffCode: Select all
Could not execute the command: -1
hmmm....I take it you don't want it to send anything at all to the chat window? That's probably more tricky...Full Bleed wrote:I'm using:RPTroll wrote:So far I can't get
{addAllPCsToInitaitive(0)}
to work.
[addAllPCsToInitiative(0)]
And that seems to work.
I'm using a combat announcement macro that adds all the PC's and sets the init.round to 1 at the same time.nextInitiative() only works if the init has already started otherwise it gives
That makes my "Next Init" macro work, but every time I click it on my GM Token (where I keep a lot of my macros), it sends a return to the chat window. :/
Edit:
My [h:sortInitiative()] macro sends a blank return to the chat window too. Any way around that?
You are right--executing anything with the [H:] modifier sends an empty line to the chat window if that's the only thing you do... That said, if you are including that as part of a macro, it doesn't add another line. (I tested it).
0+0=1, for very unstable CPUs.