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???jfrazierjr wrote:Errr... Ok...
I saved the campaign file and opened it back up in b50 dev and it works...
B49 Macro Additions
Moderators: dorpond, trevor, Azhrei
- jfrazierjr
- Deity
- Posts: 5176
- Joined: Tue Sep 11, 2007 7:31 pm
Re: B49 Macro Additions
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..
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..
Re: B49 Macro Additions
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 doingjfrazierjr wrote: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???jfrazierjr wrote:Errr... Ok...
I saved the campaign file and opened it back up in b50 dev and it works...
Code: Select all
[h: Tar = getProperty("Targets")]
[h: foo = json.get(Tar, "Target1")]
Even more b50 - b51.
Re: B49 Macro Additions
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.
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.