B49 Macro Additions

Doc requests, organization, and submissions

Moderators: dorpond, trevor, Azhrei

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Re: B49 Macro Additions

Post by jfrazierjr »

jfrazierjr wrote:Errr... Ok...

I saved the campaign file and opened it back up in b50 dev and it works... :roll: :roll:
Ok... so I went back to my b50 release and loaded the same campaign and it does not work. So... I have to assume that the problem is something that Craig fixed???
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

Craig
Great Wyrm
Posts: 2107
Joined: Sun Jun 22, 2008 7:53 pm
Location: Melbourne, Australia

Re: B49 Macro Additions

Post by Craig »

jfrazierjr wrote:
jfrazierjr wrote:Errr... Ok...

I saved the campaign file and opened it back up in b50 dev and it works... :roll: :roll:
Ok... so I went back to my b50 release and loaded the same campaign and it does not work. So... I have to assume that the problem is something that Craig fixed???
Its been a while so I can't be sure but my guess it was the tendency for MapTool to want to treat the value in Targets as an evaluated property. You can test this by doing

Code: Select all

[h: Tar = getProperty("Targets")]
[h: foo = json.get(Tar, "Target1")]
I made some fixes b49 - b50 with regards to this...
Even more b50 - b51.

Lindharin
Dragon
Posts: 668
Joined: Sat Apr 21, 2007 4:51 pm

Re: B49 Macro Additions

Post by Lindharin »

That's right, I didn't think of it when I saw the original post yesterday, but I could never get properties with json content to work directly. I always needed to do [ var = getProperty(Targets) ] first, then use var in the subsequent code.

Also, since getProperty did not return a default property in b50 (it will in b51), you would need to temporarily follow it up with another line:

[IF( json.type(var) != "OBJECT" ): var = getDefaultProperty(Targets) ]

I don't have MT open so I'm not 100% sure I have that syntax down, but it should be pretty close. See the wiki for json.type if it doesn't work as written.

Post Reply

Return to “Documentation Requests/Discussion”