Skip to content

Instantly share code, notes, and snippets.

@tabularelf
Last active May 9, 2026 17:45
Show Gist options
  • Select an option

  • Save tabularelf/615e22bc70aeb382e42b15a365e80ed9 to your computer and use it in GitHub Desktop.

Select an option

Save tabularelf/615e22bc70aeb382e42b15a365e80ed9 to your computer and use it in GitHub Desktop.
is_asset
// idk
function is_sprite(_value) {
if !is_handle(_value) return false;
return sprite_exists(_value);
}
function is_instance(_value) {
if !is_handle(_value) return false;
return !object_exists(_value) && instance_exists(_value);
}
function is_object(_value) {
if !is_handle(_value) return false;
return object_exists(_value);
}
function is_script(_value) {
if !is_handle(_value) return false;
return script_exists(_value);
}
function is_room(_value) {
if !is_handle(_value) return false;
return room_exists(_value);
}
function is_font(_value) {
if !is_handle(_value) return false;
return font_exists(_value);
}
function is_path(_value) {
if !is_handle(_value) return false;
return path_exists(_value);
}
function is_sequence(_value) {
if !is_handle(_value) return false;
return sequence_exists(_value);
}
function is_animcurve(_value) {
if !is_handle(_value) return false;
return animcurve_exists(_value);
}
function is_sound(_value) {
if !is_handle(_value) return false;
return audio_exists(_value);
}
function is_surface(_value) {
if !is_handle(_value) return false;
return surface_exists(_value);
}
function is_ds_map(_value) {
if !is_handle(_value) return false;
return ds_exists(_value, ds_type_map);
}
function is_ds_list(_value) {
if !is_handle(_value) return false;
return ds_exists(_value, ds_type_list);
}
function is_ds_stack(_value) {
if !is_handle(_value) return false;
return ds_exists(_value, ds_type_stack);
}
function is_ds_queue(_value) {
if !is_handle(_value) return false;
return ds_exists(_value, ds_type_queue);
}
function is_ds_priority(_value) {
if !is_handle(_value) return false;
return ds_exists(_value, ds_type_priority);
}
function is_ds_grid(_value) {
if !is_handle(_value) return false;
return ds_exists(_value, ds_type_grid);
}
@tinkerer-red
Copy link
Copy Markdown

yoink

@tinkerer-red
Copy link
Copy Markdown

as a note, sending an object reference into is_instance will return true if the object exists in the room.

@tabularelf
Copy link
Copy Markdown
Author

Good point, updated it lol

@tinkerer-red
Copy link
Copy Markdown

please mark as public

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment