polponero's Forum Posts

  • Hi,

    I'd like to work on a scale-9 plugin (what is scale-9? this might help), and found out there's a jquery and css3 way. Is it possible to implement them with C2 JS SDK?

    thanks

  • Hi crhatfield,

    Can you add another appendText right after the Hash load from JSON string? Just output the Ajax.LastData to make sure the data is loaded.

    For the looks of it, it should be working. From my experience, most silent errors happen due to the incorrect JSON data, like forgetting a comma or putting a string value within "".

  • I usually put the for each item of hashtable as a sub-event for ajax on complete.. haven't tried hash on created, so not sure if that's the problem.

  • Wow.. that would be awesome too :D

  • Hi rexrainbow,

    Do you mean something like JSONPath (http://goessner.net/articles/jsonPath/)? That would be great.. :D

  • Oh.. nevermind.. I found that PickKeys "equip" works, and inserts the indexes to an Array... AWESOME!

  • Hi rexrainbow,

    Want to ask another thing, is it possible to 'for each item' of an array value?

    For data something like:

    {
    "equip":[
        { "type": "weapon", "id": "SWORD-0000", "amount": 1 },
        { "type": "material", "id": "ORE-0000", "amount": 10 },
        { "type": "potion", "id": "HEAL-0000", "amount": 20 }
    ]
    }
    

    I found that using "At" works if I include the index of array on the key:

    HashTableChar.At("equip.1.type")
    

    shows the correct entry ('material').

    I also notice that for each item works if I include the index of array:

    For each item in "equip.2"
    

    Puts out the correct key and value.

    But if I try:

    For each item in "equip"
    

    Nothing shows.

    Thanks

  • awesome! thanks!

  • Thanks! Both updates would be very useful :)

    About my initial idea, instead of checking the value type (esp if it's an object), how about an action to list keys per 'layer' to an Array?

    Let's say for data

    {
      "a": { "b":1, "c":2 },
      "d"
    }
    

    The action works something like:

    If 'listKeys("", Array.X)' will insert "a" and "d" to Array, and if 'listKeys("a", Array2.X)' will insert "b" and "c" to Array2?

    Thanks again :)

  • Yeah, the problem is, in my data, root keys all have object values, so this will look like an error (nothing to show)

    I'd also like to have a conditional to check if curKey has object value.. this would be helpful, so I can store the ids on an array and fetch the data directly from HashTable.

    thanks!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I made a small modification on my own, the current purpose is to just show that the value is an object, so I can add a sub-event to detect and handle it properly

                this.exp_CurKey = key;
                this.exp_CurValue = value;
                
                if ((typeof value != "number") && (typeof value != "string"))
                    this.exp_CurValue = "[!OBJECT]";
    
  • Nice plugin, thanks for sharing :)

    Question: for keys with object values, is it possible to get the key on each item? This is crucial for me because I have a list of items with keys for item id, something like:

    {
      "SWORD-000" : { "name": "rusty sword", "stat": { "DMG": 100 } },
      "SWORD-001" : { "name": "dull blade", "stat": { "DMG": 200 } },
      "SWORD-002" : { "name": "iron blade", "stat": { "DMG": 300 } }
    }
    

    thanks

  • Hi all,

    I'm Guntur. I've been doing indie gamedev since 2007 with my studio called SoybeanSoft. Most games developed with AS3, but up till 2011, we shifted using ShiVa3D and developed a 3D casual RPG. Now after a year using ShiVa3D, I wanted to refresh and start small social games with HTML5. After searching through the options, Construct 2 seems like the most easiest to boot and robust with it's plugin system, which is awesome.

    Looking forward in releasing a facebook game with this baby :)

    That's all for now,

    Guntur