Shared Macros

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. :)
Post Reply
User avatar
applekor
Giant
Posts: 154
Joined: Thu Jul 03, 2008 3:52 pm
Location: Not Here

Shared Macros

Post by applekor »

I've been tinkering around with the token macros a bit and decided that they ALMOST work for me as a DM.

I could set up several tokens with the same macro (say to roll a Listen check).

I could select said tokens as a group and then go to the macro box and roll Listen checks for all of them simultaneously.

I could even make all of the rolls secret using /rollsecret in the macro.

BUT...

What I could NOT do was find a way to tell me which token rolled which result without going in and manually editing each creature individually (thus reducing the benefit of copy/pasting myself a quick army of baddies).

As a result, I got creative with the code. By placing an innocuous "|s|" (for "s"ecret) at the beginning of a token macro, the result of said macro will now display with the avatar and token name in the chat box as if it were published via a /say. Unlike /say, however, none of the players can see the result.

I also changed the variable resolver popup box to include the name of the token in case different members of the selected group are under different modifiers. Now, when I put a variable into a macro, the box that shows up to ask me for a value tells me who's asking for it.

In the end, this allows me to easily roll a mass, secret save/check/etc. for my minions and quickly figure out who passed or failed, all without time intensive macro personalization.

@rptools team:

Is this something you guys would be interested in making part of the next release? If so, let me know. I'm new to the whole subversioning thing, so you'd have to instruct me on how to do it. Alternatively, I can send you the modified .java files. Thanks to your reasonable framework, the code changes are quite minor.

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

Post by trevor »

Thinking through the |s|, your primary interest is to make the token name/avatar show up when doing a mass /tmacro or something ?

In other words, in which context are you running the macros that you want the avatar to show up ? I think a simple solution would be to make that loop temporarily impersonate the token while it runs, then you don't need the |s| but instead use the regular mechanisms.

I like the other two additions. Feel free to email the patch to me at trevor at croftfamily dot net
Dreaming of a 1.3 release

User avatar
applekor
Giant
Posts: 154
Joined: Thu Jul 03, 2008 3:52 pm
Location: Not Here

Post by applekor »

I'm not sure which context you're in when you hit a macro button under the "Common" section of the "Selection" tab of the macro box. It seems to me after watching the results and browsing the ui code that it already runs each one under the impersonation context.

Therein lay the problem for me since the standard /im automatically posted the result as a "say" instead of a "me" or a "gm". Whether or not the avatar showed up was not critical. It helps visually from a recognition time standpoint if you have a mixed group of NPC's to deal with (pictures register faster with me than printed names). The critical part was getting individual result identification.

I guess that I am unfamiliar with the macro phrasing you're suggesting.

For example, say that I have a token named "Wolf 1". Inside of "Wolf 1" I have defined the following macro (named Listen):

rolls a Listen check: [1d20+floor(Wisdom-10)/2+ListenRanks+Mod]

Let's say that I then copy and paste another wolf.

Both tokens now have the same macro.

If I go to the "Selection" tab of the macro box, find the "Common" section and hit the button labeled "Listen", the chat box populates with avatars and names for "Wolf 1" and Wolf 2", as well as the results of their listen checks. However, now my players also now automatically know how their Move Silently checks faired against the wolves, since the results were broadcast over the say channel.

If I had originally specified the macro like this:

/rollsecret rolls a Listen check: [1d20+floor(Wisdom-10)/2+ListenRanks+Mod]

The players don't see the results, but I can't be certain which result belonged to which wolf. If I have specific reasons not to arbitrarily assign the results, I have a problem deciding which wolf rolled which result, since the chat box informs me that "you" rolled both results.

If I had originally specified the macro like this:

/rollsecret Wolf 1 rolls a Listen check: [1d20+floor(Wisdom-10)/2+ListenRanks+Mod]

I have to manually open up Wolf 2 and change the macro to read:

/rollsecret Wolf 2 rolls a Listen check: [1d20+floor(Wisdom-10)/2+ListenRanks+Mod]

Obviously, this becomes inconvenient as I move from two wolves to ten.

Those are the iterations I tried before I dove into the code. How should I instead have written them to work with what was there?
Last edited by applekor on Fri Jul 11, 2008 1:47 pm, edited 1 time in total.

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

Post by UntoldGlory »

I like the |s| proposal. I've had issues figuring out exactly how to easily handle NPC rolls without my players knowing whats going on. I think I currently use /self, but I think I've had issues with that. I can't think of any right this very second, but I know I've had them.

User avatar
kat2cute
Dragon
Posts: 297
Joined: Wed Jan 30, 2008 3:46 pm

Post by kat2cute »

Yeah, an auto-avator/name on even secret rolls would be useful. For my macros, I define a property called Name and made the property and macro:
Name: " Wolf 1 "

/togm [Name] rolls a Listen check: [1d20+floor(Wisdom-10)/2+ListenRanks+Mod]

Of course, then you get some garbaldy goop before from the [Name] portion because it was expecting a value, not a string. but it still (eventually) displays out their Name property without having to change the actual macro.
Quote from an underwater D&D fight:
Alright fighter, it's your turn. What do you do?
Fighter: What do you think I do? I FAIL MY F**KING SWIM CHECK

User avatar
applekor
Giant
Posts: 154
Joined: Thu Jul 03, 2008 3:52 pm
Location: Not Here

Post by applekor »

Wouldn't you still have to change the contents of the "Name" property for every copy of that token that you made, though, or does MT automatically change the property when the token's name changes?

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Post by jfrazierjr »

I would prefer a much more generic item. I was actually thinking this exact same thing the other day. What I would like to see is something "like" this:


/rollsecret ${tokenname} rolls perception check: [d20+Perception]

or something along that lines. I DONT thing that it needs to be specifically secret, we just need a way to get the token name in some way from the variable resolver. I can also see this generically used in many places within macros. Another example usage is modifying the flavor text in the 4E powers to include the token name as part of the text as an extra bit of fluff.

With the above said, the exact format is up for discussion, but being able to get the token name (and GM name) would be a really good addition to the product.



Joe
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

User avatar
applekor
Giant
Posts: 154
Joined: Thu Jul 03, 2008 3:52 pm
Location: Not Here

Post by applekor »

@jfrazierjr

Would you settle for:

/rollsecret #tokenname# rolls perception check: [d20+Perception]

It choked quite a bit on the ${} nomenclature, but I got the above working without issues.

User avatar
applekor
Giant
Posts: 154
Joined: Thu Jul 03, 2008 3:52 pm
Location: Not Here

Post by applekor »

OK, I take it back.

/me works as well. The avatar doesn't show up, but the token name does.

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

Post by Azhrei »

Yeah, I thought there was a command that displayed the result to You and the GM. If the GM executes the command, they're the only one that sees the result.

Is that what /me does?

User avatar
applekor
Giant
Posts: 154
Joined: Thu Jul 03, 2008 3:52 pm
Location: Not Here

Post by applekor »

Yuppers

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Post by jfrazierjr »

applekor wrote:@jfrazierjr

Would you settle for:

/rollsecret #tokenname# rolls perception check: [d20+Perception]

It choked quite a bit on the ${} nomenclature, but I got the above working without issues.
Yea, I really don't give a hoot about what the delimiter is, since hopefully, I well enter then ONE time and leave it alone after that and it will just work...

the only thing about a single character delimiter is the propensity for someone to put that data into the "text" and having it misinterpreted.

Joe
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

User avatar
applekor
Giant
Posts: 154
Joined: Thu Jul 03, 2008 3:52 pm
Location: Not Here

Post by applekor »

Yeah, that crossed my mind, and that was why I used pipes.

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Post by Phergus »

Or you could do what the developer suggested. Just update the loop that processes the macros when multiple tokens are selected and add in the couple lines of code it would take to impersonate the current token, process the macro, remove the impersonate.

Post Reply

Return to “MapTool”