Icon

Create Custom Data Structs

YLivay

You must be logged in to obtain assets

Description

Create you own custom data structs!
Ever wanted to create custom data structs to keep your project organized? Something like ds_vector or ds_button and thought it'd be a pain to keep track and handle all the instances? This framework comes to solve all this by giving you an easy way to define your own types and automatically bind them to IDs similar to how GM generates IDs for it's built-in lists, grids, stacks etc. All you've got to do is define a provider for each data struct you want to create!

Initialize the system by calling:

flags_init();

Call this only once.

Then you have a buttload of functions at your disposal:

// Initialization (optional, by default doesn't suppress errors)
provider_init(suppress errors?)

// Provider handling
provider_create(type, scope?)
provider_exists(type, scope?)
provider_destroy(type, scope?)

// Instances handling
provider_instance_create(type, value, scope?)
provider_instance_exists(type, id, scope?)
provider_instance_destroy(type, id, scope?)
provider_get_instance(type, id, scope?)
provider_get_instances(type, scope?)
provider_get_ids(type, scope?)

You also get a small flags system as a crude alternative to check if something's already been defined (now that variable_local_exists and friends are obsolete):

flags_init()
flag(what)
unflag(what)
is_flagged(what)

Bundled in is a ds_position example to show how easy it is:

ds_position_create(x, y)
ds_position_exists(id)
ds_position_destroy(id)
ds_position_set(id, x, y)
ds_position_setx(id, x)
ds_position_sety(id, y)
ds_position_x(id)
ds_position_y(id)

A complete documentation for all the functions can be found at: http://ylivay.com/game-maker/id-provider#docs
Ok, fine, the site isn't ready yet, no need to get so angry, sheesh! The scripts are properly documented though, so you should be all set.

End User Licence Agreement (EULA).

Age Rating: 4+

Version

GMS1 - Version 1.0.0. Published July 12, 2014

initial commit

Loading, please wait

Package contents

Loading, please wait

What is the issue?

Loading, please wait