Description

Ever-growing all-in-one package of GML essentials. The package currently contains near 300 scripts and it's still growing! Every script documented. Documentation available online for free. Has a dedicated Discord server to help you out. You can also check out the development progress on Trello.

EXAMPLES

Assert

A collection of scripts for checking whether certain values or variables meet given conditions. If not, the program ends with your specified error message. Super handy when creating test for checking correctness of your code.

ce_assert_equal(add(1, 1), 2, "Something went horribly wrong.");

Custom Events

A collection of scripts that allow you to trigger GM's user event with additional data and optionally return result from it.

// Inside user event 0
switch (ce_get_event())
{
case EV_GOT_HIT:
    var _attack = ce_get_event_data();
    hp -= _attack / defense;
    ce_event_return("Ouch!");
    break;
}

Macros

Handy macros for stuff like ensuring that given script is executed at most once, no matter how many times you call it.

/// @func init_global()
/// @desc Initializes global variables.
gml_pragma("global", "init_global();");
CE_PRAGMA_ONCE; // As easy as that!
global.gameLaunchedAt = date_current_datetime();

Math

GameMaker by default misses a lot of useful math functions. This library targets just that. It contains matrix functions, vector math, quaterions and more.

// Rotate 3D object towards target
var _vec = [target.x, target.y, target.z];
ce_vec3_subtract(_vec, [x, y, z]);
var _quat = ce_quaternion_create_look_rotation(_vec, [0, 0, 1]);
var _mat = ce_quaternion_to_matrix(_quat);
matrix_set(matrix_word, _mat);

Utils

Library of miscellaneous utility scripts for things like manipulating data structures, color conversions, hexadecimals, string and char utils, UUID 4 generator and more.

// Generate random indices
var _indices = ce_array_create_range(0, _size - 1);
ce_array_shuffle(_indices);
for (var i = 0; i < _size; ++i)
{
    var _index = _indices[i];
    var _object = objects[| _index];
    ...
}

XML

Library for reading and writing XML files.

var _enemies = ce_xml_elem_find_all(_elemCharacters, "enemy");
var _size = ds_list_size(_enemies);
for (var i = 0; i < _size; ++i)
{
    var _enemy = _enemies[| i];
    instance_create_depth(
        ce_xml_elem_get_attribute(_enemy, "x"),
        ce_xml_elem_get_attribute(_enemy, "y"),
        ce_xml_elem_get_attribute(_enemy, "depth"),
        obj_enemy);
}
ds_list_destroy(_enemies);

Serialize

Enables you to serialize object instances into data structures which can be then for example saved on the disk or sent over network and then loaded and deserialized back into instances.

// Save level
var _buffer = buffer_create(1, buffer_grow, 1);
buffer_seek(_buffer, buffer_seek_start, 0);
ce_buffer_write(_buffer, buffer_u32, instance_number(OGameObject));
with (OGameObject)
{
    ce_serialize_to_buffer(id, _buffer);
}
var _compressed = buffer_compress(_buffer);
buffer_delete(_buffer);
buffer_save(_compressed, "save1.sav");
buffer_delete(_compressed);

// Load level
var _compressed = buffer_load("save1.sav");
var _buffer = buffer_decompress(_compressed);
buffer_delete(_compressed);
buffer_seek(_buffer, buffer_seek_start, 0);
var _instanceCount = buffer_read(_buffer, buffer_u32);
repeat (_instanceCount)
{
    ce_deserialize_from_buffer(_buffer);
}
buffer_delete(_buffer);

LINKS

Forum

Discord

Documentation

Trello

End User Licence Agreement (EULA).

Age Rating: 4+

Version

GMS2 - Version 1.3.1. Published August 19, 2019

  • Added new script ce_parse_real which parses a real number from a string. This function returns NaN if given string does not represent a number instead of ending the game with an error.
  • Added new script ce_real_to_string which converts a real value to a string without generating trailing zeros after a decimal point.
  • Updated ce_xml_read to use the new ce_parse_real script for parsing element attributes.
  • Updated ce_xml_string to use the new ce_real_to_string script.
  • Moved Types folder from Core back to Utils, since it contains only ce_is_nan, which GML already supports.
Loading, please wait

Package contents

Loading, please wait

What is the issue?

Loading, please wait

Back to Top