Updating existing token macrosets automatically

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
megaper
Kobold
Posts: 7
Joined: Sat Aug 15, 2009 5:54 pm

Updating existing token macrosets automatically

Post by megaper »

Hi guys,

I have a collection of 20 tokens with the same macroset on each one, but while im using them i am discovering things that i woud like to change in those macros. The problem is that if I change a macro in a specific token I have to:
-Export that macroset
-delete the macroset of each one of the 20 tokens
-Import the previously exported macroset that contain the change to each one of the 20 tokens...

And all the previous steps every time I discover something that i would like to change!!

Is there any way to update the macroset for all the tokens automatically?
Should I rewrite my code in some specific way to achieve that?
Any advise, example or wiki link that would help me in this terrible time? :wink:

An example of how the macros in the tokens are written (literal text in spanish):

Code: Select all

[ if(input("Enemigos|2,3,4,5,6,7,8|Entre cuantos enemigos?|list")),

CODE:{
     
     [h:Enemigos = Enemigos + 2]
     
     BD = BD / Nº Enemigos <br>
     BD = [r,g,s:BD] / [r:Enemigos] <br>
     [h: BD=BD/Enemigos]
     BD = [r,g,s:BD]

};{

};]
Thanks!

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: Updating existing token macrosets automatically

Post by Rumble »

The easiest course of action might be to move that particular macro to a Campaign Macro, and let it be accessible to any player (so if you run a server, check "Players Receive Campaign Macros"), and check "Apply to Selected Tokens" in the macro editing dialog. Then, if you ever change the macro, you can change it in one place, and players can click on it.

Another option is to place the macros themselves on a Library Token, and have the macros on the individual character tokens simply call that library macro instead.

So if you created a token called Lib:Example, and on it placed a macro called Attack which contained:

Code: Select all

[ if(input("Enemigos|2,3,4,5,6,7,8|Entre cuantos enemigos?|list")),

CODE:{
     
     [h:Enemigos = Enemigos + 2]
     
     BD = BD / Nº Enemigos <br>
     BD = [r,g,s:BD] / [r:Enemigos] <br>
     [h: BD=BD/Enemigos]
     BD = [r,g,s:BD]

};{

};]
and then on the character tokens, you had a macro called Launch Attack that contained:

Code: Select all

[macro("Attack@Lib:Example"):""]
you would only ever need to edit the macro on the Lib:Example token when you made changes - the character tokens just call that macro when they need to use it.

megaper
Kobold
Posts: 7
Joined: Sat Aug 15, 2009 5:54 pm

Re: Updating existing token macrosets automatically

Post by megaper »

Thanks Rumble!

I think I will use the first option (campaign macros) since it looks the fastest one, but i will take a look to the Library token which would be very useful as well.

Post Reply

Return to “MapTool”