Skip to content

Commit

Permalink
[General]Small changes to Instances page
Browse files Browse the repository at this point in the history
* Listed the ways you can create an instance under a new section "Creating Instances"
* Added a "Variable Reference" section and added variables under it
  • Loading branch information
YYBartT committed Dec 21, 2023
1 parent d12253f commit 1c0abda
Showing 1 changed file with 24 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,19 @@
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1><span data-field="title" data-format="default">Instances</span></h1>
<p><b>Instances</b> are created from <a href="../../../../The_Asset_Editors/Objects.htm">Objects</a> and, once created, they can be changed and manipulated through <span data-keyref="GML_Code">GML Code</span> and <span data-keyref="GML_Visual">GML Visual</span> actions. The main instance functions related to instances that are available and most commonly used are:</p>
<p><b>Instances</b> are created from <a href="../../../../The_Asset_Editors/Objects.htm">Objects</a> and, once created, they can be changed and manipulated through <span data-keyref="GML_Code">GML Code</span> and <span data-keyref="GML_Visual">GML Visual</span> actions. This page lists the main functions related to instances that are available in <span data-keyref="GameMaker Name">GameMaker</span>.</p>
<h3>Creating Instances</h3>
<p>You can create an instance of an object in a couple of ways: </p>
<ul class="colour">
<li>Drag it on an Instance Layer in <a data-xref="{title}" href="../../../../The_Asset_Editors/Rooms.htm">The Room Editor</a>.</li>
<li>Create it at runtime, using the functions <span class="inline3_func"><a data-xref="{title}" href="instance_create_depth.htm">instance_create_depth</a></span> and <span class="inline3_func"><a data-xref="{title}" href="instance_create_layer.htm">instance_create_layer</a></span>.</li>
<li>Add it to a sequence in <a data-xref="{title}" href="../../../../The_Asset_Editors/Sequences.htm">The Sequence Editor</a> and adding the sequence in <a data-xref="{title}" href="../../../../The_Asset_Editors/Rooms.htm">The Room Editor</a> or through code.</li>
<li>Add it to a room that&#39;s not the current <a data-xref="{title}" href="../Rooms/room.htm">room</a> using <span class="inline3_func"><a data-xref="{title}" href="../Rooms/room_instance_add.htm">room_instance_add</a></span>.</li>
</ul>
<h3>Deactivating Instances</h3>
<p>You also have the possibility of <strong>deactivating</strong> instances, which means they won&#39;t process any of their events, although they will still exist within the game. You can read about how this works and the functions you can use on the <a href="Deactivating_Instances/Deactivating_Instances.htm">Deactivating Instances</a> page.</p>
<h2 id="func_ref">Function Reference</h2>
<h3 id="func_ref_general">General</h3>
<ul class="colour">
<li><a href="instance_create_layer.htm">instance_create_layer</a></li>
<li><a href="instance_create_depth.htm">instance_create_depth</a></li>
Expand All @@ -31,33 +43,27 @@ <h1><span data-field="title" data-format="default">Instances</span></h1>
<li><a href="instance_place_list.htm">instance_place_list</a></li>
<li><a href="instance_position.htm">instance_position</a></li>
<li><a href="instance_position_list.htm">instance_position_list</a></li>
<li><a data-xref="{title}" href="instance_id_get.htm">instance_id_get</a></li>
</ul>
<p> </p>
<p>Note that there are two additional built in variables (these are <b>global scope</b> variables) and one function related to using instances which can be useful for retrieving certain details:</p>
<ul class="colour">
<li><a href="instance_id_get.htm">instance_id_get</a></li>
<li><a href="instance_id.htm">instance_id</a></li>
<li><a href="instance_count.htm">instance_count</a></li>
</ul>
<p> </p>
<p>There are a number of built in variables available within each instance of an object that can be used to control different aspects of how the instance is displayed, how it uses other assets, and how it reacts to collisions, etc... which are all listed here:</p>
<ul class="colour">
<li><a href="Instance_Variables/Instance_Variables.htm">Instance Variables</a></li>
</ul>
<p> </p>
<h3 id="func_ref_alarms">Alarms</h3>
<p>Instances have a built-in array variable <span class="inline2"><a data-xref="{title}" href="Instance_Variables/alarm.htm">alarm</a></span> that can be use to get or set Alarm Event values, but there are also two functions that can be used to do the same thing:</p>
<ul class="colour">
<li><a href="alarm_get.htm">alarm_get</a></li>
<li><a href="alarm_set.htm">alarm_set</a></li>
</ul>
<p> </p>
<p>Finally, you also have the possibility of <strong>deactivating</strong> instances, which means they won&#39;t process any of their events, although they will still exist within the game. The functions relating to that are available from the following page:</p>
<h2 id="var_ref">Variable Reference</h2>
<h3>Global</h3>
<ul class="colour">
<li><a href="instance_id.htm">instance_id</a></li>
<li><a href="instance_count.htm">instance_count</a></li>
</ul>
<h3>Instance</h3>
<p>There are a number of built-in variables available within each instance of an object that can be used to control different aspects of how the instance is displayed, how it uses other assets, and how it reacts to collisions, etc., which are all listed here:</p>
<ul class="colour">
<li><a href="Deactivating_Instances/Deactivating_Instances.htm">Deactivating Instances</a></li>
<li><a data-xref="{title}" href="Instance_Variables/Instance_Variables.htm">Instance Variables</a></li>
</ul>
<p> </p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
Expand Down

0 comments on commit 1c0abda

Please sign in to comment.