RPTools.net

Discussion and Support

Skip to content

It is currently Fri May 24, 2013 8:39 pm 






Reply to topic  [ 8 posts ] 

Previous topic | Next topic 

  Print view

Author Message
 Offline
Kobold
 
Joined: Wed Jul 21, 2010 10:26 pm
Posts: 20
 Post subject: Known Issues Importing Macros?
PostPosted: Wed May 02, 2012 10:16 am 
I'll come back and update this topic later when I get home - my machine has stopped letting me remote into it - but...

Are there any considerations I need to understand with importing macros from one campaign file into another?

I'm stitching together my own framework for OD6, taking pieces I like from the others available out there, and one of the ones I brought over this morning is throwing a syntax error in my framework only. The process was:

1) Try macro in original framework. Works great, and I like it. (It was a 4e-something. Highlighting tokens. I'll add that detail when I have access to it...)

2) Export to file.

3) Import into my framework.

4) Test, get error in chat.

5) Switch back to other framework, still working.

From what I can see, no libs are being used, nor anything else referenced. It 'should' run in either framework, right? Or is there some kind of trust I need to set on the imported macro first? I've seen the notion of 'trusted macro', but I'm not clear on how to interact with that.

Again, more detail later, but if there's anything obvious that I'm missing, I'd love to learn more about this excellent tool.

EDIT1: More detail...

The macro is from 'rfw-dnd-v513.cmpgn' and contains this code:

Code:
[h:assert(isGM(), "Only the GM can use this macro.",0)]

[h:filter = json.set("{}", "pc", 1)]
[h:tokenList = getTokens(",", filter)]

[h,foreach(token,tokenList),CODE:
{
   [switchToken(token)]
   [state.PCHalo = 1 - state.PCHalo]
}]

[h:abort(0)]


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Tue Aug 23, 2011 10:41 am
Posts: 776
Location: Cornwall, UK
 Post subject: Re: Known Issues Importing Macros?
PostPosted: Wed May 02, 2012 10:56 am 
'trusted macro' is a macro run from a library token or campaign (afaik), with "players can edit macro" unticked.

_________________
I'm working on adapting the Alternity game for MapTool, but it's on the back burner unless anyone shows any interest except for me. Current release & support thread: [Alternity] v0.2 *BETA*


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Sat Feb 13, 2010 2:35 am
Posts: 965
Location: California
 Post subject: Re: Known Issues Importing Macros?
PostPosted: Wed May 02, 2012 2:18 pm 
mcbobbo wrote:
Are there any considerations I need to understand with importing macros from one campaign file into another?


Based on the code piece below there are some custom States
Code:
state.PCHalo
that are being referred to. So you may need to include any states that the code refers to or change the code. The code may also refer to campaign properties that you may not have in your framework.
It would also help if you posted the error you received then we could be more specific about our responses.

_________________
DCI/RPGA# 7208328396 Skype ID mfrizzell77
Characters:
Strabor - Dwarf Avenger 5th Level
Tikkanan - Human Warlock 2nd Level
----------------------------------------------------
"People are more violently opposed to fur than leather because it's safer to harass rich women than motorcycle gangs."


Top
 Profile  
 
 Offline
Kobold
 
Joined: Wed Jul 21, 2010 10:26 pm
Posts: 20
 Post subject: Re: Known Issues Importing Macros?
PostPosted: Thu May 03, 2012 9:02 am 
mfrizzell wrote:
It would also help if you posted the error you received then we could be more specific about our responses.


True, true - here is the output:

Code:
Error in body of roll.       Statement options (if any): h,foreach(token,tokenList),CODE       Statement Body : { [switchToken(token)] [state.NPCHalo = 1 - state.NPCHalo] }


Top
 Profile  
 
 Offline
Kobold
 
Joined: Wed Jul 21, 2010 10:26 pm
Posts: 20
 Post subject: Re: Known Issues Importing Macros?
PostPosted: Thu May 03, 2012 9:17 am 
Here's what I changed to fix it:

Code:
[h:assert(isGM(), "Only the GM can use this macro.",0)]

[h:filter = json.set("{}", "npc", 1)]
[h:tokenList = getTokens(",", filter)]

[h,foreach(token,tokenList),CODE:
{
   [switchToken(token)]
   [h, if (getHalo()=="None"): setHalo("Red"); setHalo("None")]
}]

[h:abort(0)]


I still need to learn 'why' that happened, but I assume that the other framework used a state to control halos and it isn't in maptool by default?


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Wed Nov 15, 2006 9:03 am
Posts: 991
 Post subject: Re: Known Issues Importing Macros?
PostPosted: Tue May 08, 2012 11:41 am 
Right, for the most part, theres only a handful of "universal" states that are in the default campaign properties. Anything else you'd have to add yourself. I'm not sure if importing campaign properties adds, or overwrites, so make sure if you do it that way you test first, you may need to copy things by hand


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 5495
Location: Netherlands
 Post subject: Re: Known Issues Importing Macros?
PostPosted: Tue May 08, 2012 2:37 pm 
aku wrote:
Right, for the most part, theres only a handful of "universal" states that are in the default campaign properties. Anything else you'd have to add yourself. I'm not sure if importing campaign properties adds, or overwrites, so make sure if you do it that way you test first, you may need to copy things by hand


overwrites!

_________________
My stuff
Excel Tools: Table editor and Illumination Generator
MT Tools: Dungeon Builder Tool, Bag of Tricks: Teleport pads, Pits, Traps and Warded Areas and onMouseOverEvent
Framework: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade and Only War
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow

My dropbox referral. If you use this then both you and me get 500Mb extra space. 2.5Gb total.


Top
 Profile  
 
User avatar  Online
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 5306
Location: Bay Area
 Post subject: Re: Known Issues Importing Macros?
PostPosted: Tue May 08, 2012 2:51 pm 
A merge option would be nice for campaign properties. It would make packaging more complicated drop-ins easier, mostly for new states, imo.

I suppose you could do it with an xml merge tool and dragging all the assets together, but that wouldn't be intuitive or easy for the casual user.

_________________
Downloads:


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 8 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 0 users online :: 0 registered, 0 hidden and 0 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 0 guests





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

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman