diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/room_get_info.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/room_get_info.htm index 6c78dba6b..ce6adf3a3 100644 --- a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/room_get_info.htm +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/room_get_info.htm @@ -215,7 +215,7 @@

room_get_info

pre_creation_code Script Function - The index of the script function that holds the pre-creation code for this specific instance, i.e. the overrides for its Object Variables as set in the Room Editor. + The index of the script function that holds the pre-creation code for this specific instance, i.e. the overrides for its Object Variables as set in the Room Editor. See: Pre-creation Code diff --git a/Manual/contents/The_Asset_Editors/Object_Properties/Object_Variables.htm b/Manual/contents/The_Asset_Editors/Object_Properties/Object_Variables.htm index 7cd9a54a4..afcc421d0 100644 --- a/Manual/contents/The_Asset_Editors/Object_Properties/Object_Variables.htm +++ b/Manual/contents/The_Asset_Editors/Object_Properties/Object_Variables.htm @@ -38,14 +38,13 @@

Object Variables

Object Variables And Child Objects

An important feature of the Object Variables is that they are inherited by any child objects that you have in the Asset Browser (see the section on Parent Objects for more information), which means that you can then choose to override or change any or all of them if you wish.

When you create a child object of another object asset that has variables defined for it, these will show up in the Object Variables window like this:

-

Object Editor Variable In A Child ObjectYou can see in the top image that the Parent object has four Object Variables and in the bottom image these are also shown, only "greyed out" and have the Inherited From Parent Inherited From Parent Icon icon to indicate that they have been inherited. These inherited variables can then be edited if you click the Override Variable Override Variable Icon button, so you can then adjust the range slider or values, or select different items from lists, etc. Note that when you edit a parent variable you can only change the defined value but not the name, nor can you change the variable options. Also note that you can add in new Object Variables to child objects as well (and in the example image above you can see that "Character Type" is a new Object Variable only for the child object).

+

Object Editor Variable In A Child ObjectYou can see in the top image that the Parent object has four Object Variables and in the bottom image these are also shown, only "greyed out" and have the Inherited From Parent Inherited From Parent Icon icon to indicate that they have been inherited. These inherited variables can then be edited if you click the Override Variable Override Variable Icon button, so you can then adjust the range slider or values, or select different items from lists, etc. Note that when you edit a parent variable you can only change the defined value but not the name, nor can you change the variable options. Also note that you can add in new Object Variables to child objects as well (and in the example image above you can see that "Character Type" is a new Object Variable only for the child object).

If you have edited an inherited Object Variable, then you can click the Delete Delete Variable Icon button to remove the edit, but not the variable. The variable will still be inherited from the parent, but will use the parent default value again. If you need to completely remove the variable, then you must do this from the parent object.

Pre-creation Code

Pre-creation code is any code generated by the compiler to initialise object variables. This includes the variables that you override in an instance added to the Room Editor. It runs before the Create event and before the variables in the var_struct are assigned (when using instance_create_depth or instance_create_layer). The pre-creation code for variables that you override in the Room Editor can be found in the struct returned by room_get_info.

This makes the order of variable initialisation in an instance as follows:

    -
  1. The pre-creation code runs for the new instance, assigning it the variables set in the Variable Definitions.
  2. -
  3. The pre-creation code generated for instances added to the room in the Room Editor runs.
  4. +
  5. The pre-creation code runs for the new instance, assigning it the variables set in the Variable Definitions and any overrides if it was placed in the Room Editor and variables were modified.
  6. The variables in the var_struct are assigned.
  7. The Create event runs for the instance.