Addon/Plugin with JSON/objects

0 favourites
  • 2 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • Hi,

    i created a plugin with an action called "TrackEvent", the 2nd param should be an object with key-value pairs, for example: {level: 10, score: 20, stars: 2}. The keys can change, so the structure must be variable.

    How to solve this properly? I mean you only can use string, number and boolean as data types.

    Maybe using the type "object" and then work with the JSON of C3?

    But then how i access the data in my plugin action method? console.log shows me "C3.ObjectClass" for this parameter. How I should proceed?

    Or is there a better way?

    Thanks in advance!

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well, I am a step further.

    Using "object" as type and JSON as object, I can access to instance variables via _instVars. At least i get the keys and their type. But how do i access their values?

    Thanks!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)