Simple macro update request

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
User avatar
AidyBaby
Dragon
Posts: 383
Joined: Tue Feb 07, 2006 12:55 pm
Contact:

Simple macro update request

Post by AidyBaby »

[EDIT: Just realised this should have gone in the Macro subforum - maybe someone can move it?]

I hope I can get a simple solution to my very simple macro that I'm using in my framework. I'm sure I've borrowed most of this from elsewhere and as it's ages since I've done any macro writing (which always was very limited) I am hoping someone can easily set me straight on this and save me some frustration.

I have a simple next initiative macro that shows the GM a token handout in a frame for the next initiative token (a picture of the monster statblock). I'm trying to alter the macro to only update the frame for NPCs and not PC tokens, see the end of the code:

Code: Select all

[h:ID = getInitiativeToken()]
[h:switchToken(ID)]
[h:state.Current = 0]
[h:nextInitiative()]
[h:ID = getInitiativeToken()]
[h:switchToken(ID)]
[h,if (getLayer() == "TOKEN") : state.Current = 1]
[h:state.Delay = 0]
[h:state.Ready = 0]

[Frame("Statblock"): {
<img src="[r:getTokenHandout()]"></>
}]
I've tried using:

Code: Select all

[h,if (isNPC()), code : 
{
[Frame("Statblock"):{<img src="[r:getTokenHandout()]"></>]
}]
but can't get it to work. Anyone want to take pity on me and put me out of my misery for this simple request?

Cheers,

AidyBaby
Last edited by wolph42 on Mon Mar 20, 2017 6:27 pm, edited 1 time in total.
Reason: moved topic to macro section
D&D qualities are related inversely to those of Poker... and I love both.
http://www.yorkpoker.co.uk

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

Re: Simple macro update request

Post by aliasmask »

Try removing the "h" from the if statement, adding ;{} to the if and get rid of the extra >/< and add } for the frame.

Code: Select all

[if(isNPC()), code: {
   [Frame("Statblock"):{<img src="[r:getTokenHandout()]" />}]
};{}]


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

Re: Simple macro update request

Post by AidyBaby »

Thank you both for this - I don't know how many times I checked opening and closing brackets and still couldn't see it!
D&D qualities are related inversely to those of Poker... and I love both.
http://www.yorkpoker.co.uk

Post Reply

Return to “Macros”