Initiative: What am I doing wrong?

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
DevoDog
Dragon
Posts: 456
Joined: Sat Jul 12, 2008 9:56 am

Initiative: What am I doing wrong?

Post by DevoDog »

Code: Select all

<INIT>
...gets {INIT} on Initiative Roll.
That's the token macro I have. I'm trying to set the initiative for the token in the panel. I saw an example before, but can't find it now.
Last edited by DevoDog on Thu Aug 21, 2008 12:11 am, edited 1 time in total.

Lindharin
Dragon
Posts: 668
Joined: Sat Apr 21, 2007 4:51 pm

Post by Lindharin »

*snip out first post*

I think you forgot to check the Disable HTML in this post box when you submitted your post, which totally messes up your example.

Can you repost it?

DevoDog
Dragon
Posts: 456
Joined: Sat Jul 12, 2008 9:56 am

Post by DevoDog »

Doh! And double-doh! (I didn't save the macro.)

Basically, I want a macro where the character makes an initiative roll (d20+InitBonus) which displays the character's initiative in the chat window and sets the initiative for the Initiative window.

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

Post by knizia.fan »

If you edit your original post, I think you can check the "Disable HTML in this post" option. Then we'll be able to see your code.

User avatar
AidyBaby
Dragon
Posts: 383
Joined: Tue Feb 07, 2006 12:55 pm
Contact:

Post by AidyBaby »

How about:

Code: Select all

<!--
[diceroll=1d20]
[token.init=diceroll + InitBonus]
-->
{token.name} rolls initiative: {diceroll} + {InitBonus} = <b>{token.init}</b>
Edit: Don't forget you have to have the token added in the initiative pane before using this macro.

I use it by selecting all my tokens and running it from global.

--AidyBaby--
D&D qualities are related inversely to those of Poker... and I love both.
http://www.yorkpoker.co.uk

DevoDog
Dragon
Posts: 456
Joined: Sat Jul 12, 2008 9:56 am

Post by DevoDog »

AidyBaby wrote:How about:

Code: Select all

<!--
[diceroll=1d20]
[token.init=diceroll + InitBonus]
-->
{token.name} rolls initiative: {diceroll} + {InitBonus} = <b>{token.init}</b>
Thanks! That worked perfectly!

User avatar
AidyBaby
Dragon
Posts: 383
Joined: Tue Feb 07, 2006 12:55 pm
Contact:

Post by AidyBaby »

Glad to help.
D&D qualities are related inversely to those of Poker... and I love both.
http://www.yorkpoker.co.uk

dorpond
RPTools Team
Posts: 5534
Joined: Thu Jun 01, 2006 2:05 pm
Location: Buffalo, NY

Post by dorpond »

AidyBaby wrote:How about:

Code: Select all

<diceroll>
{token.name} rolls initiative: {diceroll} + {InitBonus} = <b>{token.init}</b>
I use it by selecting all my tokens and running it from global.
Really?
I just tried adding the macro to global and then selecting my tokens but it doesn't work - it prompts me for values instead of just executing like it does if I create the same macro in the Selected Macro Window. Interesting... Something broken perhaps?

Lindharin
Dragon
Posts: 668
Joined: Sat Apr 21, 2007 4:51 pm

Post by Lindharin »

dorpond wrote: Really?
I just tried adding the macro to global and then selecting my tokens but it doesn't work - it prompts me for values instead of just executing like it does if I create the same macro in the Selected Macro Window. Interesting... Something broken perhaps?
I'm just guessing, but I assume he originally meant "I use it by selecting all my tokens and right clicking on the global button and choosing Run For Each Selected" (or whatever that context menu choice is).

I'm submitting a patch (in about 2 minutes) that will let you configure a global or campaign button to always run against the selected tokens so that you can just click on it normally instead of using the right-click option.

dorpond
RPTools Team
Posts: 5534
Joined: Thu Jun 01, 2006 2:05 pm
Location: Buffalo, NY

Post by dorpond »

Lindharin wrote:
dorpond wrote: Really?
I just tried adding the macro to global and then selecting my tokens but it doesn't work - it prompts me for values instead of just executing like it does if I create the same macro in the Selected Macro Window. Interesting... Something broken perhaps?
I'm just guessing, but I assume he originally meant "I use it by selecting all my tokens and right clicking on the global button and choosing Run For Each Selected" (or whatever that context menu choice is).

I'm submitting a patch (in about 2 minutes) that will let you configure a global or campaign button to always run against the selected tokens so that you can just click on it normally instead of using the right-click option.
Heh, man, MT is growing so fast that I didn't even know that right click option was available. Man.. We so need to make stuff more obvious. :P

Yeah, that patch you are talking about will be cool. You ight need to have the button look diferent or something so that we know at a glance it is for all selected.

Thanks for educating me. :)

dorpond
RPTools Team
Posts: 5534
Joined: Thu Jun 01, 2006 2:05 pm
Location: Buffalo, NY

Post by dorpond »

Lindharin wrote:
dorpond wrote: Really?
I just tried adding the macro to global and then selecting my tokens but it doesn't work - it prompts me for values instead of just executing like it does if I create the same macro in the Selected Macro Window. Interesting... Something broken perhaps?
I'm just guessing, but I assume he originally meant "I use it by selecting all my tokens and right clicking on the global button and choosing Run For Each Selected" (or whatever that context menu choice is).

I'm submitting a patch (in about 2 minutes) that will let you configure a global or campaign button to always run against the selected tokens so that you can just click on it normally instead of using the right-click option.
Heh, man, MT is growing so fast that I didn't even know that right click option was available. Man.. We so need to make stuff more obvious. :P

Yeah, that patch you are talking about will be cool. You ight need to have the button look diferent or something so that we know at a glance it is for all selected.

Thanks for educating me. :)

dorpond
RPTools Team
Posts: 5534
Joined: Thu Jun 01, 2006 2:05 pm
Location: Buffalo, NY

Post by dorpond »

Now that I think about it, why do we even have a right click -> Run Macro for Each Selected? Shouldn't that just be assumed? I mean, if I have 3 tokens selected and click on a macro button, I would expect it to run for each - wouldn't I?

Having a right menu option just seems overcomplicated and makes the feature less obvious to new users.

User avatar
AidyBaby
Dragon
Posts: 383
Joined: Tue Feb 07, 2006 12:55 pm
Contact:

Post by AidyBaby »

dorpond wrote:Now that I think about it, why do we even have a right click -> Run Macro for Each Selected? Shouldn't that just be assumed? I mean, if I have 3 tokens selected and click on a macro button, I would expect it to run for each - wouldn't I?

Having a right menu option just seems overcomplicated and makes the feature less obvious to new users.
I was wondering that too. I couldn't think of a case where if you have a token selected you wouldn't want to run a macro for the token. I'm sure someone out there can educate me though.

--AidyBaby--
D&D qualities are related inversely to those of Poker... and I love both.
http://www.yorkpoker.co.uk

Lindharin
Dragon
Posts: 668
Joined: Sat Apr 21, 2007 4:51 pm

Post by Lindharin »

dorpond wrote:Now that I think about it, why do we even have a right click -> Run Macro for Each Selected? Shouldn't that just be assumed? I mean, if I have 3 tokens selected and click on a macro button, I would expect it to run for each - wouldn't I?

Having a right menu option just seems overcomplicated and makes the feature less obvious to new users.
Well, I think it partly comes down to who appears to do the talking in the chat window.

At the moment, the default for a global/campaign button is that it comes from the current user. But that means the macro can't access properties in the selected token.

The right-click option actually makes you impersonate each selected token in turn, running the macro once for each. That lets you access their properties, but the chat output looks like it is coming from them, not you.

A longer term solution would be to split that up. If you click a global/campaign button while tokens are selected, run it once per token using the token's properties but still have the actual user shown as the originator in the chat window. Then have a checkbox in the button editor that says "Impersonate selected tokens" so that the chat results look like they came from each token directly. But that was too much for my initial foray into Java and MapTools. :D

User avatar
AidyBaby
Dragon
Posts: 383
Joined: Tue Feb 07, 2006 12:55 pm
Contact:

Post by AidyBaby »

Lindharin wrote:If you click a global/campaign button while tokens are selected, run it once per token using the token's properties but still have the actual user shown as the originator in the chat window. Then have a checkbox in the button editor that says "Impersonate selected tokens" so that the chat results look like they came from each token directly.
This would be perfect.

--AidyBaby--
D&D qualities are related inversely to those of Poker... and I love both.
http://www.yorkpoker.co.uk

Post Reply

Return to “MapTool”