A downloadable asset pack

Google Sheets Loader for GameMaker

A simple, powerful & type-smart CSV loader
that fetches data directly from published Google Sheets

๐Ÿš€ GameMaker โ€ข ๐Ÿ“Š Google Sheets โ€ข ๐Ÿ”ง Type-Safe โ€ข โšก Async


Table of Contents

  • Features
  • Why use this?
  • Installation
  • Quick Start Example
  • Basic Usage
  • Executable Functions
  • Debug & Utility Functions
  • Supported Data Types
  • Troubleshooting
  • Tips & Best Practices

Features

  • Load data directly from published Google Sheets using only Sheet ID
  • Smart automatic type detection & conversion
  • Supports executable function callbacks in cells
  • Async / non-blocking loading
  • Can load specific tabs (using gid)
  • Built-in debug & inspection tools

Why use this?

Old classic way (hard-coded):

items[0] = { name: "Banana",  color: "yellow", price: 12 };
items[1] = { name: "Apple",   color: "red",    price: 10 };
// ... painful to edit & maintain

Modern way with Google Sheets Loader:

obj_GMGSL.load_sheet("YOUR_SHEET_ID", "", function(data) {
    global.items = data;     // โ† done!
});
Perfect for: items, enemies, levels, dialogue, localization, balancing, live events, non-programmer content updates...

Installation

  1. Download GMGSL.yymps from Releases
  2. GameMaker โ†’ Tools โ†’ Import Local Package
  3. Select file โ†’ choose obj_GMGSL โ†’ Import
  4. Drag obj_GMGSL into any room (persistent object)
Important โ€“ Google Sheet publishing:
File โ†’ Share โ†’ Publish to web โ†’ Web page (NOT CSV!)
Copy the Sheet ID from the published link

Quick Start Example

namepricedescription
Sword100A sharp blade
Shield50Protects from harm
Potion25Restores health
obj_GMGSL.load_sheet("YOUR_SHEET_ID", "", function(data) {
    _gmgsl_debug_sheet_data_compact(data); // quick visual check
    
    for (var i = 0; i < array_length(data); i++) {
        var item = data[i];
        show_debug_message(item.name + " costs " + string(item.price) + " gold");
    }
});

Basic Usage

// Whole first sheet
obj_GMGSL.load_sheet("YOUR_SHEET_ID", "", function(data) { ... });
// Specific tab
obj_GMGSL.load_sheet("YOUR_SHEET_ID", "123456789", function(data) { ... });

Executable Functions (very powerful!)

namecallback
Bananaon_collect("banana", 12)
SpeedUpactivate_powerup("speed", 5)
if (_gmgsl_is_function_object(item.callback)) {
    item.callback.call();                 // run with original params
    // or override:
    item.callback.call(["cherry", 999]);
}
Supports up to 8 parameters.
For more โ†’ pass struct/array as one parameter.

Debug & Utility Functions

  • _gmgsl_debug_sheet_data(data) — detailed + types
  • _gmgsl_debug_sheet_data_compact(data) — compact view
  • _gmgsl_debug_sheet_data_summary(data) — column types
  • _gmgsl_debug_call_all_functions(data) — run all callbacks
  • _gmgsl_is_function_object(value) — check function object

Supported Data Types

TypeCSV exampleGameMaker result
StringBanana or "Hello World"string
Number42 or 3.14 or -9real
Array[1,2,3] or ["fire","ice"]array
Struct{hp:100, name:"goblin"}struct
Functionheal_player(30)function object with .call()

Troubleshooting

"Function not found" โ†’ create functions as Script assets

Data not loading โ†’ must publish as Web page, never CSV

Tips & Best Practices

  • Use simple lowercase column names (item_name, base_price)
  • Validate data after loading
  • Store result in global variables
  • Load during game start / loading screen
  • Keep backup of sheet structure


Made with โค๏ธ for the GameMaker community
MIT License — free to use in any project

Note about GenAI: Claude was used to solve a small bug I encountered at the end of the development. The rest was handmade developed.

Published 10 hours ago
StatusReleased
CategoryAssets
AuthorMakee

Download

Download
GMGSL.zip 16 kB

Leave a comment

Log in with itch.io to leave a comment.