Hello,
I'm working on a Diablo II style skill tree prototype and running into problems loading data from either an XML file or a JSON file. Here's what I am trying to do:
1) System: On start of layout/Ajax: Request .json project file
2) Ajax: On load of .json file/Dictionary: Load from JSON string "json project file name"
3) Mouse: On left click on sprite object/System: Set Global Variable to match Instance Variable on the sprite object.
4) Have the various text objects load specific lines of data from the JSON data. Below is the JSON data I am loading:
[{"PowerName":"Heavy Slash","Requirements":"Long Sword","Keywords":"Sword, Long Sword, Technique, Focus Builder, Accurate, Mandatory","Power":"1(W),Special","Type":"Technique","PlusResource":"+1 Focus","MinusResource":"N/A","Target":"Single","Range":"1","Splash":"N/A","Resist":"Physical","Duration":"Instant","Cooldown":"At Will","Description":"Accurate: +5 Precision. Deals 1*Weapon Damage to target. Builds 1 Focus. If caster has no Focus at time of usage, damage is boosted to 1.5*Weapon Damage."},
{"PowerName":"Runthrough","Requirements":"Long Sword","Keywords":"Sword, Long Sword, Technique, Focus Consumer, Accurate, Mandatory","Power":"1(W), +.5(W) per Focus","Type":"Technique","PlusResource":"N/A","MinusResource":"-All Focus","Target":"Single","Range":"1","Splash":"N/A","Resist":"Physical","Duration":"Instant","Cooldown":"At Will","Description":"Requires at least 1 Focus, consumes all Focus. Accurate: +5 Precision. Deals 1*Weapon Damage (plus .5 Weapon Damage per Focus consumed). Reduces the target's Toughness by 10 (plus 2 per Focus consumed) for 2 rounds. Actionless if user has 3 or more Focus."},
{"PowerName":"Defensive Strike","Requirements":"Long Sword","Keywords":"Sword, Long Sword, Technique, Focus Builder, Accurate, Offhand, Actionless, Accurate","Power":"1(W)","Type":"Technique","PlusResource":"+2 Focus","MinusResource":"N/A","Target":"Single","Range":"1","Splash":"N/A","Resist":"Physical","Duration":"1 round","Cooldown":"2 rounds","Description":"Accurate: +5 Precision. Deals 1*Weapon Damage to target. Builds 2 Focus. Boosts Toughness by 10 (plus Sword Proficiency Level) until end of next round."}]
I am trying to call a specific "PowerName" text (for example, the first one) into a text object.
You can see how far I've gotten by looking at this this project.
TL;DR, how do I load up a JSON data file into a dictionary and then call up a specific bit of data from that JSON file?
Thanks in advance, I am pretty stumped!
Phil