Skip to content

Instantly share code, notes, and snippets.

View BenjaminUrquhart's full-sized avatar
🚩
Ball Game

Benjamin Urquhart BenjaminUrquhart

🚩
Ball Game
View GitHub Profile
@BenjaminUrquhart
BenjaminUrquhart / revive.js
Created October 20, 2024 09:49
Very dirty JS portion of an In Stars and Time mod that makes the Memory of Emptiness function in every act.
// Helper stuff
// Learning Javascript using Notepad++ is not ideal but it works I guess.
// Could be worse.
clone = function(obj) {
return JSON.parse(JSON.stringify(obj))
}
var ReviveMod = {}
@BenjaminUrquhart
BenjaminUrquhart / BU_FixOliviaAnimatedPictures.js
Last active December 2, 2024 06:02
Plugin to fix the dreaded "Cannot read property 'width' of null." crash for "In Stars And Time"
/*:
@plugindesc Fix 'cannot read property "width" of null' crash in Olivia_AnimatedPictures.
@author Benjamin Urquhart
*/
{
// Add functions that causes the crash here.
let functions = ["resetFrame", "updateAnimatedPictureFrame"]
@BenjaminUrquhart
BenjaminUrquhart / ObjectEventProbing.gml
Created December 20, 2024 09:38
I will not elaborate. Requires Gamemaker 2022.5 or later as-is.
__get_default_datafile = function() {
switch(os_type) {
case os_windows: return "data.win";
case os_linux: return "game.unx";
default: throw $"Unsupported OS {os_type}";
}
}
__get_event_table = function() {
static event_table = undefined;
@BenjaminUrquhart
BenjaminUrquhart / ObjectFixer.script
Created May 20, 2025 23:16
ZERO Sievert 1.1.16 mod to fix ObjectGetAllInstances and InstanceCreate
-- You are about to witness war crimes.
-- I stopped commenting at some point because I myself
-- can't fully explain what's going on without writing a
-- whole essay on the topic (which I'll probably do in the near future anyway).
ObjectCreate("patcher")
ObjectSetScript("patcher", "create_event", func(obj) {
let check = ObjectGetAllInstances(obj_mod_generic)
if ArrayLength(check) > 0 {
ShowDebugMessage("Functions are already working, no need to patch")
@BenjaminUrquhart
BenjaminUrquhart / downloader_init.script
Last active August 7, 2025 16:28
Devlog TV - a ZERO Sievert mod that adds a video feed of the most recent devlog to the bunker
escape = InstanceContext()
funcs = escape.funcs
obj_news = funcs.asset_get_index("obj_news")
obj_example = funcs.asset_get_index("obj_example")
obj_sprite_downloader = funcs.asset_get_index("obj_sprite_downloader")
startDownload = escape.getScript("spr_sprite_downloader_fetch")
downloadFile = func(url, progressCallback, finishCallback) {
if !funcs.os_is_network_connected() {
@BenjaminUrquhart
BenjaminUrquhart / GMExtensionExtension.gml
Created November 14, 2025 09:28
A Gamemaker script to parse and retrieve detailed extension information from the game WAD at runtime.
#macro GMEE_PRELOAD true
// This script references UndertaleModTool for data file parsing
// https://github.com/UnderminersTeam/UndertaleModTool/blob/master/UndertaleModLib/Models/UndertaleExtension.cs
/// Parses a Gamemaker game WAD for extension information
///
/// @param [filepath] the path to the WAD. If not provided, one is guessed based on platform/command-line arguments.
///
/// @returns {Array<Struct>} an array containing extension information parsed from the WAD