GameMaker (2.0 - 2.2.x)
Icon

CE Core - Essential Scripts

Patrik Kraif

You must be logged in to obtain assets

Description

Ever-growing all-in-one package of GML essentials. The package currently contains over 200 scripts and it's still growing! Every script documented. Documentation available online for free. Has a dedicated Discord server to help you out.

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);

LINKS

Forum

Discord

Documentation

End User Licence Agreement (EULA).

Age Rating: None

Version

GMS2 - Version 1.0.3. Published May 13, 2019

  • Added new script ce_draw_sprite_nine_slice for drawing 9-slice sprites.
  • A lot of scripts optimized for YYC (the math library especially).
  • Fixed a lot of documentation errors.
  • Created an online documentation, available at https://kraifpatrik.com/docs/ce.
Loading, please wait

Package contents

Loading, please wait

What is the issue?

Loading, please wait