Icon

Instance Toolkit

Bart Teunis

You must be logged in to obtain assets

Description

The instance toolkit contains a set of scripts to work with hierarchies of instances in the easiest and cleanest way possible. You can use the scripts and object provided to build your own GUI system, to easily save and load instances with all required variables or simply to serialize an instance using JSON and send and receive it over a network.

Features

  • Easily add, remove and move child instances and hierarchies
  • Inherit properties defined in parent objects
  • Load and save instance hierarchies, including inherited properties of all parent objects
  • JSON support, allowing for serialization of instances
  • Helper scripts for loading and saving GM's built-in instance variables
  • Debug script for displaying an instance tree, including instance properties
  • Clean, well-commented code
  • Extensive documentation, including examples of use: simple, loading/saving & JSON, advanced

Scripts usage

// Create and destroy instances
with(instance) itk_instance_create(x,y,obj_object);    // automatically assigns to calling instance
with(instance) instance_destroy();                     // destroy full instance tree

// JSON encode/decode
var json = itk_json_encode(instance);
var instance = itk_json_decode(json);

// Getting/setting properties using custom events
itk_props[?"x"] = x;    // Get an instance's properties => itk_get_event
itk_props[?"y"] = y;

x = itk_props[?"x"];    // Set an instance's properties => itk_set_event
y = itk_props[?"y"];

// Executing scripts
with(instance) {
    itk_script_execute(script_name,argument0,argument1[,...]);
}

Known bugs

none

Updates/new feature additions

Will be added for free on request.

Links

Docs

Questions, suggestions, remarks

Please feel free to let me know using the Contact Publisher button.

End User Licence Agreement (EULA).

Age Rating: 4+

Versions

GMS2 - Version 2.1.0. Published September 24, 2017

  • Converted to GameMaker Studio 2
  • Converted constants to macros

GMS1 - Version 2.1.0. Published September 24, 2017

  • Added script itk_script_execute that allows to execute a script in all instances, including an example on rotating instances using the script
  • Added override_name to obj_itk_object to save objects with a different name
  • Added call to sprite_set_cache_size() to make the second example work well in HTML5
  • Fixed bug: error when moving instance in tree using itk_instance_move
  • Fixed bug: line count not correctly incremented for multiple levels in itk_draw_tree
  • All known bugs are now fixed
Loading, please wait

Package contents

Loading, please wait

What is the issue?

Loading, please wait