JSON array & lib property

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
ziltmilt
Dragon
Posts: 331
Joined: Sun Apr 29, 2007 9:28 pm
Contact:

JSON array & lib property

Post by ziltmilt »

Can anyone tell me if they see something wrong with how this JSON array of JSON objects is constructed?

Code: Select all

[{"Weapon":"Staff","Damage":"1D","AddSTR":"1","Diff":"5","Type":"P"},{"Weapon":"Club","Damage":"1D","AddSTR":"1","Diff":"5","Type":"P"},{"Weapon":"Spear","Damage":"1D+1","AddSTR":"1","Diff":"10","Type":"P"},{"Weapon":"Gaderffii","Damage":"1D","AddSTR":"1","Diff":"5","Type":"P"},{"Weapon":"Knife, poor","Damage":"0D+1","AddSTR":"1","Diff":"5","Type":"P"},{"Weapon":"Knife, avg","Damage":"0D+2","AddSTR":"1","Diff":"5","Type":"P"},{"Weapon":"Knife, excellent","Damage":"1D","AddSTR":"1","Diff":"5","Type":"P"},{"Weapon":"Hatchet","Damage":"0D+2","AddSTR":"1","Diff":"10","Type":"P"},{"Weapon":"Bayonet","Damage":"1D","AddSTR":"1","Diff":"10","Type":"P"},{"Weapon":"Vibro-axe, poor","Damage":"2D","AddSTR":"1","Diff":"15","Type":"P"},{"Weapon":"Vibro-axe, standard","Damage":"2D+1","AddSTR":"1","Diff":"15","Type":"P"},{"Weapon":"Vibro-axe, avg","Damage":"2D+2","AddSTR":"1","Diff":"15","Type":"P"},{"Weapon":"Vibro-axe, good","Damage":"3D","AddSTR":"1","Diff":"15","Type":"P"},{"Weapon":"Vibro-axe, excellent","Damage":"3D+1","AddSTR":"1","Diff":"15","Type":"P"},{"Weapon":"Vibroblade, poor","Damage":"1D+2","AddSTR":"1","Diff":"15","Type":"P"},{"Weapon":"Vibroblade, standard","Damage":"2D","AddSTR":"1","Diff":"15","Type":"P"},{"Weapon":"Vibroblade, avg","Damage":"2D+1","AddSTR":"1","Diff":"15","Type":"P"},{"Weapon":"Vibroblade, good","Damage":"2D+2","AddSTR":"1","Diff":"15","Type":"P"},{"Weapon":"Vibroblade, excellent","Damage":"3D","AddSTR":"1","Diff":"15","Type":"P"},{"Weapon":"Force Pike","Damage":"2D","AddSTR":"1","Diff":"15","Type":"P"},{"Weapon":"Lightsaber","Damage":"5D","AddSTR":"0","Diff":"20","Type":"E"}]
I've got this variable stored as a property in a library token and I'm getting an error when I try to access it:

Code: Select all

[h: meleeWeaponsAll = getLibProperty(“MeleeWeapons”,”Lib:Utility”)]
I'm really scratching my head on this one .. I don't see anything wrong.


ziltmilt
Dragon
Posts: 331
Joined: Sun Apr 29, 2007 9:28 pm
Contact:

Re: JSON array & lib property

Post by ziltmilt »

Code: Select all

 Error in body of roll.       Statement options (if any): h       Statement Body : meleeWeaponsAll = getLibProperty(“MeleeWeapons”,”Lib:Utility”)
Not very helpful to me, at least.

User avatar
aliasmask
RPTools Team
Posts: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: JSON array & lib property

Post by aliasmask »

I notice you have windows quotes rather than normal quotes. Are you using MS word to edit? I recommend using a plain text editor like notepad or notepad++ (in sig).

ziltmilt
Dragon
Posts: 331
Joined: Sun Apr 29, 2007 9:28 pm
Contact:

Re: JSON array & lib property

Post by ziltmilt »

Thanks guys! Yes, the Windows quotes were gumming up the works.

Post Reply

Return to “Macros”