1.0.5 - a GMS2.3 version


This update brings TJSON to GMS 2.3.

Instead of using a custom array-based type for storing JSON objects, it now uses structs (lightweight objects), meaning that you can do

function scr_test(){
    var a = {
        arr: [1, 2, 3],
        str: "hi!",
        num: 1,
        boo: bool(true),
    };
    var s = tj_encode(a, "\t");
    show_debug_message(s);
    var b = tj_decode(s);
    show_debug_message(b);
}

As an experiment, the extension is also compiled into a singular script-package that you can import / look at comfortably.

The API remains backwards-compatible.

Files

TJSON-for-GMS2.3.zip 5 kB
Apr 28, 2020

Get TJSON for GameMaker

Buy Now$3.95 USD or more

Comments

Log in with itch.io to leave a comment.

Deleted 2 years ago

Add it as a script, not as an extension - 2.3 extensions are in an odd spot for now since they can't declare constructors.

Deleted 2 years ago

Uploaded a new version that fixes this.

Also, as a general note, when posting sample projects for replicating issues with paid extensions, either send them by email, or remove paid assets from the project.

Deleted 2 years ago

It's strange but it seems that ALL of the usual macros such as tj_true, etc are straight up missing from this release. It was imported as a script instead of an extension (as an "experiment" I guess) but are we to define the API macros ourselves? Look's like it's either that or stay on 1.04 for the time being. Great extension in general though there's just not front end for the api in this version unless I'm missing something.

Hello! I have now updated the 2.3 version - the variables were named g_<name>, but that should not have been so outside of extension version.