Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matrix Functions page update and matrix_inverse(), legacy behaviour game options, changes to array_copy() and others #216

Merged
merged 29 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
84e25c0
docs(general): add note about matrices being stored in arrays
YYBartT Nov 8, 2024
502f486
docs(feature): Add a new function matrix_inverse() for inverting a ma…
YYBartT Nov 11, 2024
f980538
Merge branch 'develop.bart.matrix_functions_and_inverse' into develop…
YYBartT Nov 11, 2024
1c66409
Merge branch 'develop' into develop.bart
YYBartT Nov 11, 2024
71a8683
docs(general): Event User Not Triggered During Clean Up Event
YYBartT Nov 11, 2024
a92b182
docs(feature): Add options for toggling legacy behaviours for string-…
YYBartT Nov 12, 2024
5c88d7e
docs(feature): Add a Game Option for controlling whether unused asset…
YYBartT Nov 12, 2024
c90e3a0
docs(feature): Document Path to Project Tool preference
YYBartT Nov 13, 2024
cd53c3d
docs(general): Added a note to mention that websockets are not suppor…
YYBartT Nov 14, 2024
081d709
docs(general): When launching a GM game that only supports full-scree…
YYBartT Nov 14, 2024
25861c5
docs(general): "Privately attach this project" should be reworded to …
YYBartT Nov 15, 2024
5053611
docs(general): "Privately attach this project" should be reworded to …
YYBartT Nov 15, 2024
7980e14
docs(general): typo fix
YYBartT Nov 16, 2024
e456213
docs(general): define pre-creation code
YYBartT Nov 18, 2024
3d3e580
docs(feature): added particleSystemID to activeTracks
YYBartT Nov 18, 2024
188c22b
docs(general): updated code example on alarm manual page
YYBartT Nov 18, 2024
cc5c855
docs(general): updated code example on alarm manual page
YYBartT Nov 18, 2024
c303570
docs(general): updated Keyboard Shortcuts page
YYBartT Nov 19, 2024
b1d23ab
docs(feature): [iOS] Add "add -FIRDebugEnabled" to the launch options…
YYBartT Nov 19, 2024
f379163
docs(feature): array functions clamp offset to upper bound, string_de…
YYBartT Nov 19, 2024
474be3f
docs(feature): [iOS] Add "add -FIRDebugEnabled" to the launch options…
YYBartT Nov 19, 2024
904236d
docs(general): Precreation code update
gurpreetsinghmatharoo Nov 20, 2024
50b82cb
docs(feature): Small changes to deprecated options
gurpreetsinghmatharoo Nov 20, 2024
bcd25a4
docs(feature): Marked references of Package Manager as beta only
gurpreetsinghmatharoo Nov 20, 2024
866f8da
docs(feature): Add options for toggling legacy behaviours for string-…
YYBartT Nov 20, 2024
5b0a3b4
docs(general): remove CE2 shortcuts from shortcuts page
YYBartT Nov 20, 2024
7ebc5df
docs(general): sprite_get_bbox_left() page code example has left and …
YYBartT Nov 20, 2024
b1f9168
docs(general): Emitter ind found in particle_get_info is a number, no…
YYBartT Nov 20, 2024
1fbb34d
docs(general): Incorrect Manual entry note for network_send_broadcast
YYBartT Nov 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ <h1><span data-field="title" data-format="default">Data Types</span></h1>
<p><a class="dropspot" data-rhwidget="DropSpot" data-target="drop-down2" href="#">Arrays</a></p>
<div class="droptext" data-targetname="drop-down2">
<p class="dropspot"><label for="three">An array is a special data type that can be used to hold multiple values. You assign the array to a variable, and then &quot;fill in&quot; different indices of the array with values. This array can then be passed through to scripts and functions on a <a href="Values_And_References.htm#pass_by_value_and_pass_by_reference">pass-by-reference</a> basis, however should you modify the passed array, it will then become a copy of the original array and so will need to be returned back to the original variable for the array to be updated. For more information on arrays, please see: <a href="Arrays.htm">GML Overview - Arrays</a>.</label></p>
<p class="dropspot">Note that matrices are also stored in arrays. See <a data-xref="{title}" href="../GML_Reference/Maths_And_Numbers/Matrix_Functions/Matrix_Functions.htm">Matrix Functions</a> for more information.</p>
<p class="dropspot"> </p>
</div>
<p><a class="dropspot" data-rhwidget="DropSpot" data-target="drop-down3" href="#">Structs</a></p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ <h2 id="h">When &#39;other&#39; changes</h2>
<li>When calling an unbound constructor function, <span class="inline2">other</span> will be the instance or struct that called that function. If the constructor is bound as a method, then <span class="inline2">other</span> will be the instance or struct to which the constructor method is bound.</li>
<li>When stored as a reference through a struct literal, covered below under &quot;<strong>&#39;other&#39; as a reference</strong>&quot;.</li>
</ul>
<h3 id="legacy_other_behaviour">Legacy other Behaviour</h3>
<p>In previous versions of <span data-keyref="GameMaker Name">GameMaker</span> <span class="inline2">other</span> only changed in the following cases: </p>
<ul class="colour">
<li>As part of the <span class="inline2">with</span> statement.</li>
<li>When <span class="inline2">new</span> is called when a constructor is executed <span class="inline2">other</span> is set to the <span class="inline2">self</span> at the point that <span class="inline2">new</span> was called.</li>
</ul>
<p>This behaviour can be enabled by the <a href="../../../Settings/Game_Options.htm#legacy_other_behaviour">Legacy Other Behaviour</a> game option.</p>
<h2>Struct Declaration</h2>
<p>Scope doesn&#39;t change inside a struct declaration, so <span class="inline2">other</span> refers to the same scope as <span class="inline2">self</span> (the <strong>current</strong> scope), meaning the struct or instance that&#39;s initialising the struct:</p>
<p class="code">var _struct =<br />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,25 @@ <h1><span data-field="title" data-format="default">alarm</span></h1>
<h4>Syntax:</h4>
<p class="code"><span data-field="title" data-format="default">alarm</span>[index]</p>
<p> </p>
<h4>Returns:</h4>
<h4>Holds:</h4>
<p class="code"><span data-keyref="Type_Real"><a href="../../../../GML_Overview/Data_Types.htm" target="_blank">Real</a></span> (-1 if the alarm isn&#39;t running)</p>
<p> </p>
<h4>Example:</h4>
<p class="code">if (canshoot) <br />
<p class="code_heading">Create Event</p>
<p class="code">can_shoot = true;</p>
<p class="code_heading">Alarm 0 Event</p>
<p class="code">can_shoot = true;</p>
<p class="code_heading">Step Event</p>
<p class="code">if (can_shoot)<br />
{<br />
    if (keyboard_check_pressed(vk_space)) <br />
    if (keyboard_check_pressed(vk_space))<br />
    {<br />
        canshoot = false;<br />
        can_shoot = false;<br />
        alarm[0] = game_get_speed(gamespeed_fps);<br />
        instance_create_layer(x, y, &quot;Bullets&quot;, obj_Bullet);<br />
        instance_create_layer(x, y, &quot;Bullets&quot;, obj_bullet);<br />
    }<br />
}</p>
<p>The above code checks a variable and then if it is true, checks for a key press and if that is true it finally sets the variable to false, sets an alarm (where it will be set to true again) and creates an instance.</p>
<p>The above code checks a variable <span class="inline2">can_shoot</span> in the Step event. If this variable is <span class="inline2">true</span>, a key press of the Space key is then checked and if that is <span class="inline2">true</span> the variable is finally set to <span class="inline2">false</span>, <span class="inline2">alarm[0]</span> is set and an instance of <span class="inline2">obj_bullet</span> is created. When the alarm reaches 0, the <span class="inline2">can_shoot</span> variable is set back to <span class="inline2">true</span>. Note that this variable is first initialised to <span class="inline2">true</span> in the Create event.</p>
<p> </p>
<p> </p>
<div class="footer">
Expand All @@ -48,7 +53,7 @@ <h4>Example:</h4>
<div style="float:right">Next: <a href="direction.htm">direction</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2023 All Rights Reserved</span></h5>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
alarm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@ <h1><span data-field="title" data-format="default">instance_create_depth</span><
<div data-conref="../../../../assets/snippets/Note_layer_depth_range.hts"> </div>
<p class="note"><span data-conref="../../../../assets/snippets/Tag_note.hts"> </span> This function behaves differently when you call it after calling a room-changing function in the same event. See the note on <span class="inline3_func"><a data-xref="{title}" href="../Rooms/room_goto.htm">room_goto</a></span> for details.</p>
<p>This function returns the <span class="inline2"><a data-xref="{title}" href="Instance_Variables/id.htm">id</a></span> of the new instance which can then be stored in a variable and used to access that instance. Note that this function will also call the <a href="../../../../The_Asset_Editors/Object_Properties/Object_Events.htm">Create Event</a> of the instance being created <i>before</i> continuing with the code or actions for the event that called the function.</p>
<h2>Optional Struct</h2>
<p>The last argument, <span class="inline2">var_struct</span>, is optional and takes a struct containing additional variables for the new instance.</p>
<p>Variables from this struct are applied to the new instance <em>before</em> its Create event runs, but <em>after</em> its <a href="../../../../The_Asset_Editors/Object_Properties/Object_Variables.htm">Variable Definitions</a> are set.</p>
<p>This means that the values from that struct are readable in the Create event of the new instance. See <strong>Example 2</strong> at the bottom.</p>
<p>Values applied to the new instance through this struct can be of any type, including <a href="../../../GML_Overview/Method_Variables.htm">method</a> variables. <a href="Instance_Variables/Instance_Variables.htm">Built-in variables</a> can be changed as well.</p>
<p class="note"><span data-conref="../../../../assets/snippets/Tag_note.hts"> </span> Variables from the struct are &quot;shallow-copied&quot; to the new instance, meaning any arrays, structs, and other resources are copied by reference and not duplicated.</p>
<div data-conref="../../../../assets/snippets/Note_instance_create_Optional_Struct.hts"> </div>
<p> </p>
<h4>Syntax:</h4>
<p class="code"><span data-field="title" data-format="default">instance_create_depth</span>(x, y, depth, obj, [var_struct]);</p>
Expand Down Expand Up @@ -68,13 +63,13 @@ <h4>Returns:</h4>
<p class="code"><span data-keyref="Type_ID_Instance"><a href="Instance_Variables/id.htm" target="_blank">Object Instance</a></span></p>
<p> </p>
<h4>Example 1:</h4>
<p class="code">var inst = <span data-field="title" data-format="default">instance_create_depth</span>(x, y, -100, obj_Bullet);<br />
with (inst)<br />
<p class="code">var _inst = <span data-field="title" data-format="default">instance_create_depth</span>(x, y, -100, obj_bullet);<br />
with (_inst)<br />
{<br />
    speed = other.shoot_speed;<br />
    direction = other.image_angle;<br />
}</p>
<p>The above code creates a new instance of the object <span class="inline2">obj_bullet</span> at <span class="inline2">-100</span> depth, and stores the instance ID in a variable. This variable is then used to assign <span class="inline">speed</span> and <span class="inline">direction</span> to the new instance.</p>
<p>The above code creates a new instance of the object <span class="inline2">obj_bullet</span> at <span class="inline2">-100</span> depth, and stores the instance ID in a variable. This variable is then used to assign <span class="inline2">speed</span> and <span class="inline2">direction</span> to the new instance.</p>
<p>This will first create the instance, run its Create event, and <em>then</em> assign values to its variables.</p>
<p>If you want to assign some variables <em>before</em> the Create event runs, see the example below.</p>
<p> </p>
Expand Down
Loading
Loading