RPTools.net

Discussion and Support

Skip to content

It is currently Sat Sep 23, 2017 6:40 pm 






Reply to topic  [ 4 posts ] 

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Dragon
 
Joined: Tue Feb 07, 2006 12:55 pm
Posts: 383
 Post subject: Simple macro update request
PostPosted: Mon Mar 20, 2017 2:59 pm 
[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:
[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:
[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

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


Last edited by wolph42 on Mon Mar 20, 2017 5:27 pm, edited 1 time in total.
moved topic to macro section


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7860
Location: Bay Area
 Post subject: Re: Simple macro update request
PostPosted: Mon Mar 20, 2017 3:55 pm 
Try removing the "h" from the if statement, adding ;{} to the if and get rid of the extra >/< and add } for the frame.

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

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9380
Location: Netherlands
 Post subject: Re: Simple macro update request
PostPosted: Mon Mar 20, 2017 5:28 pm 
what AM said. The core issue though was a missing }

</>]

must be

</>}]

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Tue Feb 07, 2006 12:55 pm
Posts: 383
 Post subject: Re: Simple macro update request
PostPosted: Tue Mar 21, 2017 5:08 am 
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 4 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 2 guests





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman