State Loader [behavior] - devlog, ideas, etc

0 favourites
  • 6 posts
From the Asset Store
State Machine
$10.99 USD
State Machine is a great tool for managing the state of anything in your game.
  • This State Loader behavior allows you to paste-in json strings of a saved object to override the object's initial parameters at layout start time. It works with Sprites, Particles, TiledBackgrounds and Tilemaps. Unfortunately I don't believe it is possible (yet?) for the layout editor properties to be changed at edit time, so there is no update of object position etc in the editor.

    Additional feature. As I tinkered with tilemap I thought it would be useful to add support for a Tiled tilemap json save. Any compression option is acceptable, and (as above) the tilemap will be updated at the start of the layout.

    Properties:

    State Json: the object save as.json string.

    Set world state: choose whether the world info parameters should be loaded (position, angle, etc).

    Set runtime state: choose if the runtime parameters should be loaded (frame, particles, etc).

    Tilemap tiles json. Load the tilesJSON from a save of tile status.

    Tiled json. Load a Tiled output json (multi-layers compatible).

    Tiled layer name. The name of the layer to load into the tilemap object.

    I've also added an action so that Tiled json strings and/or alternative layer names can be set during runtime. Final bug testing is ongoing and this should be ready very soon.

  • Same here:

    construct.net/en/forum/construct-3/general-discussion-7/discussion-possible-feature-148280

    Question is can we load behavior preferences as well?

    Im fine with it not adding anything to the object if they aren't setup for it already.

  • newt - Editor hooks would be amazing but I don't see any progress in that direction by the team, so I expect it will be a long way off, if it ever happens.

    This loader plugin will support the standard behaviors, so now I've done a basic save for the main objects I now have to experiment with each one to learn its specifics... This'll take me a few days and I'll post a progress report when I'm done.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • newt - Which behaviors would you be interested in directly loading this way? The game-save jsons only contain obscure numerical editor references to the object's behaviors (editor id number) - so the only way to identify a particular behavior in this plugin would be by checking the names of the saved keys. I don't think I have it in me to figure them out for all of the possible behaviors due to a mild lack of interest, but if there are one or two that are worth supporting then I'll give them a look.

  • Id say Los, Physics, Pathfinding, Bullet, Platform. There's probably more.

    One thought as an alternative is the system save slots. Rather than do each object, save the entire layout with No Save behaviors on the ones you don't want.

  • I played around with the system save slot system, and I'm kind of torn between the two.

    The only issue with the save slot is that it would load all objects, even those that have the No Save behavior, since its just about the state of that object. Of course we're talking about the editor rather than run-time, so that's different. If the objects in the json didn't exist, they couldn't be placed in the editor, and I'm guessing that if they existed in the project, and didn't exist in the current layout, they would not get created by loading by json. My opinion on that anyways.

    Then as a single object.. you would have to load each one separately.

    To be honest I kinda think if you wanted to go down the path of pre-loading, you would most likely do more

    than one.

    Edit:

    Also I'm not sure how instances should be handled in the save state load. I mean by my definition you would have to have the exact amount of instances if the save had multiples, which is kinda ehh.

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