Code Snippets Game Maker Language

Short texts Game Maker Language 🧑‍💻 Code snippets Game Maker Language ✍️ Reading lists Game Maker Language 👀

A UUID4 String Generator for GML

function generate_uuid4_string() { //As per https://www.cryptosys.net/pki/uuid-rfc4122.html //FIXME – Do this without random()/choose() calls var _UUID = sha1_string_utf8(string(current_time) + string(date_current_datetime()) + string(random(0xFFFFFF))); _UUID = string_set_byte_at(_UUID, 9, 0x2D) _UUID = string_set_byte_at(_UUID, 14, 0x2D) _UUID = string_set_byte_at(_UUID, 19, 0x2D) _UUID = string_set_byte_at(_UUID, 24, 0x2D) _UUID = string_delete(_UUID, 37, 4) _UUID = string_upper(_UUID) _UUID = string_set_byte_at(_UUID, 15, 0x34); _UUID […]