Obsolete Dynamic Functions

These functions deal with the generation of resources at run time.

Object Function List:

FunctionDescription
object_addAdds a new object. It returns the index of the object. You can now use this index in the routines above to set certain properties of the object and then you can use the index to create instances of the object.
object_deleteDeletes the object with the given index. Make sure no instances of the object exist in any of the rooms.
object_event_addTo give the object a behavior we must define events for the object. You can only add code actions to events. You need to specify the object, the event type, the event number (use the constants that have been specified before for the event_perform() function). Finally you provide the code string that must be executed. You can add multiple code actions to each event.
object_event_clearYou can use this function to clear all the actions for a particular event.
object_set_parentSet the parentfor an object.

Variable Function List:

FunctionDescription
variable_global_existsReturns whether a global variable with the given name (a string) exists.
variable_local_existsReturns whether an instance variable with the given name (a string) exists for the current instance.
variable_global_getReturns the value of the global variable with the given name (a string).
variable_global_array_getReturns the value of index ind of the global array variable with the given name (a string).
variable_global_array2_getReturns the value of index ind1,ind2 of the global 2-dimensional array variable with the given name (a string).
variable_local_getReturns the value of an instance variable with the given name (a string).
variable_local_array_getReturns the value of index ind of an instance array variable with the given name (a string).
variable_local_array2_getReturns the value of index ind1,ind2 of an instance 2-dimensional array variable with the given name (a string).
variable_global_setSets the global variable with the given name (a string) to the given value
variable_global_array_setSets the index ind in the global array variable with the given name (a string) to the given value.
variable_global_array2_setSets the index ind1,ind2 in the global 2-dimensional array variable with the given name (a string) to the given value.
variable_local_setSets an instance variable with the given name (a string) to the given value.
variable_local_array_setSets the index ind in an instance array variable with the given name (a string) to the given value.
variable_local_array2_setSets the index ind1,ind2 in an instance 2-dimensional array variable with the given name (a string) to the given value.

Resource Function List:

FunctionDescription
sprite_add_spriteAdds the sprite stored the file fname to the set of sprite resources. The file must be a .gmspr file that is saved in the sprite property form in GameMaker.
background_add_backgroundAdds the background stored the file fname to the set of background resources. The file must be a .gmbck file that is saved in the background property form in GameMaker.
sprite_add_spriteAdds the sprite stored the file fname to the set of sprite resources. The file must be a .gmspr file that is saved in the sprite property form in GameMaker.
background_add_backgroundAdds the background stored the file fname to the set of background resources. The file must be a .gmbck file that is saved in the background property form in GameMaker.
sprite_create_from_screenCreates a sprite by copying the given area from the screen.
sprite_add_from_screenAdds an area of the screen as a next subimage to the sprite with index ind.
background_create_from_screenCreates a background by copying the given area from the screen.

Miscellaneous Function List:

FunctionDescription
room_set_codeSets the initialization code string for the room with the indicated index.
script_get_textReturns the text string of the script with the given index.
execute_stringExecute the piece of code in the string str with the indicated arguments.
execute_fileExecute the piece of code in the file with the indicated arguments.
execute_programExecutes program "prog" with arguments "arg". "wait" indicates whether to wait for finishing.
execute_shellExecutes the program (or file) in the shell.
timeline_moment_addAdds a code action to the time line at moment step. If the step does not exist it is created. So you can add multiple code actions for the same moment.

Why These Are Obsolete

These functions cannot be used any more due to changes in the underlying runner that GameMaker: Studio uses to generate the device specific packages making it impossible to generate objects, images or code "on the fly" as was done before.


Back: Obsolete Functions
Next: Transition Functions

© Copyright YoYo Games Ltd. 2018 All Rights Reserved