Instance functions in NTT

Management
Management
instance_create(x, y, obj, ?var_struct)​
instance_delete(inst)

This is just a instance_destroy(inst, false) from a time before GM added an optional argument to instance_destroy.

instance_is(instance, object)​

Returns whether an instance belongs to the given object type.

This is equivalent to

object_index == obj || object_is_ancestor(object_index, obj)

Objects
Objects

Non-standard:

object_get_depth(object)​

Returns the depth that instance_create would put instances of the object on.

object_has_event(object, event_type, event_number)​

Returns whether an object has a specific event.

Searching
Events
Events

Alarms:

alarm_run(index)​

Ticks down the specified alarm if it is set, and returns whether it's time to trigger the effect.

Source: alarm_run


event_perform(etype, enumb)
event_perform_object(object, etype, enumb)

Also be careful - executing other objects' events may leak variables into the current instance.

GM help: event_perform_object

Event constants
ev_create#
ev_destroy#
ev_alarm#
ev_step#
ev_collision#
ev_keyboard#
ev_mouse#
ev_other#
ev_draw#
ev_keypress#
ev_keyrelease#
//
ev_animation_end#
ev_boundary#
ev_close_button#
ev_draw_begin#
ev_draw_end#
ev_draw_post#
ev_draw_pre#
ev_end_of_path#
ev_game_end#
ev_game_start#
ev_global_left_button#
ev_global_left_press#
ev_global_left_release#
ev_global_middle_button#
ev_global_middle_press#
ev_global_middle_release#
ev_global_press#
ev_global_release#
ev_global_right_button#
ev_global_right_press#
ev_global_right_release#
ev_gui#
ev_gui_begin#
ev_gui_end#
ev_left_button#
ev_left_press#
ev_left_release#
ev_middle_button#
ev_middle_press#
ev_middle_release#
ev_mouse_enter#
ev_mouse_leave#
ev_mouse_wheel_down#
ev_mouse_wheel_up#
ev_no_button#
ev_no_more_health#
ev_no_more_lives#
ev_outside#
ev_right_button#
ev_right_press#
ev_right_release#
ev_room_end#
ev_room_start#
ev_step_begin#
ev_step_end#
ev_step_normal#
ev_trigger#
ev_user0#
ev_user1#
ev_user10#
ev_user11#
ev_user12#
ev_user13#
ev_user14#
ev_user15#
ev_user2#
ev_user3#
ev_user4#
ev_user5#
ev_user6#
ev_user7#
ev_user8#
ev_user9#

Filtering
Filtering

Intended for narrowing down instances to the one's you'd like.

instances_matching(object_or_array, varname, ...values)​

Returns an array of instances that have varname equal to any of values.

instances_matching_ne(object_or_array, varname, ...values)​

Returns an array of instances that have varname not equal to any of values

instances_matching_lt(object_or_array, varname, value)​

Returns an array of instances that have varname numeric and < the set threshold

instances_matching_gt(object_or_array, varname, value)​

Returns an array of instances that have varname numeric and > the set threshold

instances_matching_le(object_or_array, varname, value)​

Returns an array of instances that have varname numeric and <= the set threshold

instances_matching_ge(object_or_array, varname, value)​

Returns an array of instances that have varname numeric and >= the set threshold

instances_matching_range(object_or_array, varname, minValue, maxValue, minValueIsInclusive, maxValueIsInclusive)​

Returns an array of instances that have varname numeric and within the range


instances_in_rectangle(object_or_array, x1, y1, x2, y2)​

Returns an array of instances with their XY within rectangle

instances_in_circle(object_or_array, x, y, rad)​

Returns an array of instances with their XY within circle