Create a persistent variable on a token.

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
Shadow Wizard
Giant
Posts: 182
Joined: Mon Apr 11, 2011 8:11 pm

Create a persistent variable on a token.

Post by Shadow Wizard »

Just a simple one, I need a macro to simply remember a variable between other macros on the SAME token. This variable will be different among other tokens.
Basically I am looking to set up the hit die, dice, etc of a token, so I can use another button to role the tokens hit points.
Make an orc (1d8+1 hp). Add the variables 1, 8 and 1 to the token. Copy the token 20 times. Run this macro on all the tokens at once, and they all have random hit points.
I don't want to use global properties.

User avatar
aliasmask
RPTools Team
Posts: 9023
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Create a persistent variable on a token.

Post by aliasmask »

Lets assume all your tokens have a "hp" property. If you set the property in your macro to [H: hp = 1d8+1] it will initialize that property. How you get the hp info is up to you. You can have a json that has the data based on the token name or you can put it in manually. ie copy 20 tokens, select 20 tokens, run macro to set hp to 1d8+1. There's a lot of room for how user friendly you want to make it, which make the coding more complicated.

Post Reply

Return to “Macros”