Search found 331 matches
- Sat Mar 26, 2016 10:19 am
- Forum: Macros
- Topic: Distance Macro Help
- Replies: 11
- Views: 1573
Re: Distance Macro Help
This is the code I came up with, but I'm getting an error. [h: ID = arg(0)] [h: targetTokenList = getExposedTokenNames()] [h: newList = ""] [h, foreach(tokenName, targetTokenList): newList = if(getDistance(tokenName,0,ID, "ONE_TWO_ONE")==1 && ID <> tokenName, newList + &q...
- Sun Mar 13, 2016 8:51 am
- Forum: Macros
- Topic: JSON array & lib property
- Replies: 4
- Views: 808
Re: JSON array & lib property
Thanks guys! Yes, the Windows quotes were gumming up the works.
- Sat Mar 12, 2016 9:33 pm
- Forum: Macros
- Topic: JSON array & lib property
- Replies: 4
- Views: 808
Re: JSON array & lib property
Code: Select all
Error in body of roll. Statement options (if any): h Statement Body : meleeWeaponsAll = getLibProperty(“MeleeWeapons”,”Lib:Utility”)
- Sat Mar 12, 2016 3:09 pm
- Forum: Macros
- Topic: JSON array & lib property
- Replies: 4
- Views: 808
JSON array & lib property
Can anyone tell me if they see something wrong with how this JSON array of JSON objects is constructed? [{"Weapon":"Staff","Damage":"1D","AddSTR":"1","Diff":"5","Type":"P"},{"Weapon":"C...
- Sun Feb 28, 2016 10:30 am
- Forum: Campaign Frameworks
- Topic: Revised d6 Star Wars framework ... still in progress
- Replies: 8
- Views: 8758
Re: Revised d6 Star Wars framework ... still in progress
I'd like to re-upload the file as I make progress. Is it OK to simply reply to this thread with a new attachment or should I overwrite the original attachment? i'm not sure how to do the latter.
- Thu Feb 25, 2016 6:35 am
- Forum: Campaign Frameworks
- Topic: Revised d6 Star Wars framework ... still in progress
- Replies: 8
- Views: 8758
Re: Revised d6 Star Wars framework ... still in progress
Given how much help I've gotten from this community, it's nice to finally be able to return the favor in some form. I'm also planning on writing up documentation on how to use the framework, once I get it closer to completion. There's a lot of d6 Star Wars gamers still out there, so I imagine this t...
- Tue Feb 23, 2016 6:19 am
- Forum: Campaign Frameworks
- Topic: Revised d6 Star Wars framework ... still in progress
- Replies: 8
- Views: 8758
Revised d6 Star Wars framework ... still in progress
https://www.amazon.com/clouddrive/share/MVVLd7dnU8GdG27w7xJxQMZNbrSZonVrDdJdZKIiHps I'm sharing this file here because the Campaign Frameworks sub-forum is locked. Someone on here uploaded a basic Star Wars d6 framework. I've taken that, along with a macro from another user to calculate distances f...
- Wed Jan 20, 2016 6:23 am
- Forum: Macros
- Topic: Building a JSON object in code
- Replies: 2
- Views: 545
Building a JSON object in code
If your macro collects values for various fields, how would you then collect and store those fields into a new JSON object? json.merge looks like it might be the answer, except that its arguments are all pre-existing JSON objects. I suppose I could concatenate and build the object via something like...
- Wed Jan 20, 2016 6:18 am
- Forum: Macros
- Topic: Find string within another string?
- Replies: 4
- Views: 1004
Re: Find string within another string?
Yep, indexOf looks exactly what I need. Thanks again!
- Tue Jan 19, 2016 6:09 am
- Forum: Macros
- Topic: Find string within another string?
- Replies: 4
- Views: 1004
Find string within another string?
Any idea which function in Maptool can find matches for strings within another string? I saw strfind(), but it looks like it's for regular expressions. I'm looking for the equivalent to VBA's Instr() function, if it exists.
- Mon Jan 18, 2016 4:48 pm
- Forum: Macros
- Topic: Help requested with a FOREACH loop
- Replies: 7
- Views: 749
Re: Help requested with a FOREACH loop
Awesome!! That got it! Thank you again very very much!!!
- Mon Jan 18, 2016 8:22 am
- Forum: Macros
- Topic: Help requested with a FOREACH loop
- Replies: 7
- Views: 749
Re: Help requested with a FOREACH loop
Let me ask about syntax on another macro I'm building. Do you see anything wrong w/ the syntax in this bit of code? I keep getting an error on this line, too [h, foreach(skill,skills): skillNames = if(json.get("attribute",skill)=="DEX",skillNames + "," + json.get("...
- Mon Jan 18, 2016 8:01 am
- Forum: Macros
- Topic: Help requested with a FOREACH loop
- Replies: 7
- Views: 749
Re: Help requested with a FOREACH loop
Thanks so much for your help, aliasmask. I'm still getting an error, though. Here's my function, which I've taken from you: [H: attackerScale = arg(0)] [H: defenderScale = arg(1)] [H: scaleInfo = json.set( "character",0, "speeder",2, "walker",4, "starfighter",...
- Mon Jan 18, 2016 7:25 am
- Forum: Macros
- Topic: Help requested with a FOREACH loop
- Replies: 7
- Views: 749
Re: Help requested with a FOREACH loop
Hmm .. I still can't get this to work. I used your code verbatim and changed the scale property to this: [{"character":0,"speeder":2,"walker":4,"starfighter":6,"capital":12,"death star":24}] Question .. why should i used json.get instead of...
- Mon Jan 18, 2016 5:42 am
- Forum: Macros
- Topic: Help requested with a FOREACH loop
- Replies: 7
- Views: 749
Help requested with a FOREACH loop
I've a library token with a property which I'm using like a table, and then I wrote a function to access this property and return a computation. It's not working at all, and I can't figure out why. The function is listed in 'onCampaignLoad'. Lib:Utility has the Scale property defined as [{"Scal...