MapTool 1.3 Development Build 41

New build announcements plus site news and changes.

Moderators: dorpond, trevor, Azhrei, Craig

User avatar
lmarkus001
Great Wyrm
Posts: 1867
Joined: Sat Mar 29, 2008 12:30 am
Location: Layfayette Hill, PA

Post by lmarkus001 »

From this thread ( http://forums.rptools.net/viewtopic.php ... c&start=85 ) these are the Initiative Panel functions I am aware of:
jay wrote:I've just added a bunch of macro functions and variable support. The following macro variables 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.
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:
  • 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.
I am unclear where I get the token GUID from for these functions.

User avatar
UntoldGlory
Great Wyrm
Posts: 1649
Joined: Sun Mar 16, 2008 8:12 pm

Post by UntoldGlory »

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?

Krattack
Kobold
Posts: 18
Joined: Tue Aug 19, 2008 11:01 am
Location: Tampere, Finland

Post by Krattack »

Replace the outermost () with {}, that should fix it. Or use eval(DexBonus) in the macro instead of just DexBonus.

knizia.fan
Giant
Posts: 197
Joined: Wed Jul 30, 2008 3:43 pm

Post by knizia.fan »

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

User avatar
trevor
Codeum Arcanum (RPTools Founder)
Posts: 11311
Joined: Mon Jan 09, 2006 4:16 pm
Location: Austin, Tx
Contact:

Post by trevor »

Mr. Pokeylope wrote:
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.
Okay, I know why it's doing that and it's a simple fix. I'll send Trevor a patch for it.
Received.

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

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Post by Azhrei »

lmarkus001 wrote:From this thread ( http://forums.rptools.net/viewtopic.php ... c&start=85 ) these are the Initiative Panel functions I am aware of:
Wow, that's great stuff!

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. :)

User avatar
Sir Flak
Dragon
Posts: 344
Joined: Thu Sep 28, 2006 4:20 pm
Location: Oklahoma, US

Post by Sir Flak »

knizia.fan wrote:
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?
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.
It also appears broken to me. Several of my macros aren't working with default properties anymore. For instance:

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.

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Post by RPTroll »

So far I can't get
{addAllPCsToInitaitive(0)}
to work. I get the message

Code: Select all

Could not execute the command: Undefined function: addAllPCsToInitaitive
Same message for removeAllPCsFromInitaitive(), removeAllFromInitaitive(), removAllNPCsFromInitaitive(), addAllToInitaitive(), addAllNPCsToInitaitive()

nextInitiative() only works if the init has already started otherwise it gives

Code: Select all

Could not execute the command: -1
I'll play with it more and update as I find more stuff

User avatar
Pyroman
Cave Troll
Posts: 68
Joined: Wed Dec 26, 2007 12:42 pm
Location: Tampa, FL

Post by Pyroman »

RPTroll wrote:So far I can't get
{addAllPCsToInitaitive(0)}
to work. I get the message

Code: Select all

Could not execute the command: Undefined function: addAllPCsToInitaitive
Same message for removeAllPCsFromInitaitive(), removeAllFromInitaitive(), removAllNPCsFromInitaitive(), addAllToInitaitive(), addAllNPCsToInitaitive()

nextInitiative() only works if the init has already started otherwise it gives

Code: Select all

Could not execute the command: -1
I'll play with it more and update as I find more stuff
I'm sure that you would have seen it eventually but you have misspelled initiative in the commands that you listed.
Last edited by Pyroman on Wed Aug 27, 2008 12:22 pm, edited 1 time in total.

User avatar
Orchard
Great Wyrm
Posts: 1852
Joined: Fri May 09, 2008 10:45 am
Location: Doylestown PA
Contact:

Post by Orchard »

RPTroll wrote:So far I can't get
{addAllPCsToInitaitive(0)}
to work. I get the message

Code: Select all

Could not execute the command: Undefined function: addAllPCsToInitaitive
Same message for removeAllPCsFromInitaitive(), removeAllFromInitaitive(), removAllNPCsFromInitaitive(), addAllToInitaitive(), addAllNPCsToInitaitive()

nextInitiative() only works if the init has already started otherwise it gives

Code: Select all

Could not execute the command: -1
I'll play with it more and update as I find more stuff
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.

Jay, if you could clarify these, it might help.
0+0=1, for very unstable CPUs.

User avatar
Mr. Pokeylope
Giant
Posts: 118
Joined: Mon Aug 11, 2008 9:24 pm

Post by Mr. Pokeylope »

knizia.fan wrote:Mr. Pokeylope, another issue for you to look at. Smileys are breaking the output.

Code: Select all

[s=2]....[x=s]
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.
Yep, working on a fix.
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).
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: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?
That should be doable, yeah.

Keterys
Kobold
Posts: 19
Joined: Sat Jun 14, 2008 9:46 pm

Post by Keterys »

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.

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Post by Full Bleed »

RPTroll wrote:So far I can't get
{addAllPCsToInitaitive(0)}
to work.
I'm using:

[addAllPCsToInitiative(0)]

And that seems to work.
nextInitiative() only works if the init has already started otherwise it gives
I'm using a combat announcement macro that adds all the PC's and sets the init.round to 1 at the same time.

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?

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Post by RPTroll »

Pyroman wrote:
RPTroll wrote:So far I can't get
{addAllPCsToInitaitive(0)}
to work. I get the message

Code: Select all

Could not execute the command: Undefined function: addAllPCsToInitaitive
Same message for removeAllPCsFromInitaitive(), removeAllFromInitaitive(), removAllNPCsFromInitaitive(), addAllToInitaitive(), addAllNPCsToInitaitive()

nextInitiative() only works if the init has already started otherwise it gives

Code: Select all

Could not execute the command: -1
I'll play with it more and update as I find more stuff
I'm sure that you would have seen it eventually but you have misspelled initiative in the commands that you listed.
I cut and pasted them out of the section above. I'll try them properly spelled and see what happens. :-)

User avatar
Orchard
Great Wyrm
Posts: 1852
Joined: Fri May 09, 2008 10:45 am
Location: Doylestown PA
Contact:

Post by Orchard »

Full Bleed wrote:
RPTroll wrote:So far I can't get
{addAllPCsToInitaitive(0)}
to work.
I'm using:

[addAllPCsToInitiative(0)]

And that seems to work.
nextInitiative() only works if the init has already started otherwise it gives
I'm using a combat announcement macro that adds all the PC's and sets the init.round to 1 at the same time.

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?
hmmm....I take it you don't want it to send anything at all to the chat window? That's probably more tricky...

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.

Post Reply

Return to “Announcements”