Skip to content

Commit 588785a

Browse files
committed
docs(general): "path_position" page refers to "path_speed" and "path_position" variables as functions
YoYoGames/GameMaker-Bugs#9122 * Changed "function" -> "variable" on path_position and path_speed page * Fixed variable name in path_orientation page code example * Fixed variable names in path_positionprevious code example * Small (visual) update of the built-in path instance variable pages
1 parent 0ec21be commit 588785a

File tree

8 files changed

+71
-84
lines changed

8 files changed

+71
-84
lines changed

Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Paths/Path_Variables/Path_Variables.htm

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@
1616
<!--<div class="body-scroll" style="top: 150px;">-->
1717
<h1><span data-field="title" data-format="default">Path Variables</span></h1>
1818
<p>The following variables are built-in to all instances when created and can be used to get information about a path, or to change certain properties:</p>
19-
<p> </p>
2019
<ul class="colour">
21-
<li><a href="path_index.htm">path_index</a></li>
22-
<li><a href="path_position.htm">path_position</a></li>
23-
<li><a href="path_positionprevious.htm">path_positionprevious</a></li>
24-
<li><a href="path_speed.htm">path_speed</a></li>
25-
<li><a href="path_scale.htm">path_scale</a></li>
26-
<li><a href="path_orientation.htm">path_orientation</a></li>
27-
<li><a href="path_endaction.htm">path_endaction</a></li>
20+
<li><a data-xref="{title}" href="path_index.htm">path_index</a></li>
21+
<li><a data-xref="{title}" href="path_position.htm">path_position</a></li>
22+
<li><a data-xref="{title}" href="path_positionprevious.htm">path_positionprevious</a></li>
23+
<li><a data-xref="{title}" href="path_speed.htm">path_speed</a></li>
24+
<li><a data-xref="{title}" href="path_scale.htm">path_scale</a></li>
25+
<li><a data-xref="{title}" href="path_orientation.htm">path_orientation</a></li>
26+
<li><a data-xref="{title}" href="path_endaction.htm">path_endaction</a></li>
2827
</ul>
2928
<p> </p>
3029
<p class="note"><span data-conref="../../../../../assets/snippets/Tag_note.hts"> </span> You can find further information on instance variables here: <a data-xref="{title}" href="../../../../GML_Overview/Variables/Instance_Variables.htm">Instance Variables</a>.</p>
@@ -33,11 +32,11 @@ <h1><span data-field="title" data-format="default">Path Variables</span></h1>
3332
<div class="footer">
3433
<div class="buttons">
3534
<div class="clear">
36-
<div style="float:left">Back: <a href="../Paths.htm">Paths</a></div>
37-
<div style="float:right">Next: <a href="../Path_Manipulation/Path_Manipulation.htm">Path Manipulation</a></div>
35+
<div style="float:left">Back: <a data-xref="{title}" href="../Paths.htm">Paths</a></div>
36+
<div style="float:right">Next: <a data-xref="{title}" href="../Path_Manipulation/Path_Manipulation.htm">Path Manipulation</a></div>
3837
</div>
3938
</div>
40-
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2023 All Rights Reserved</span></h5>
39+
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2025 All Rights Reserved</span></h5>
4140
</div>
4241
<!-- KEYWORDS
4342
Paths

Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Paths/Path_Variables/path_endaction.htm

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
66
<title>path_endaction</title>
7-
<meta name="generator" content="Adobe RoboHelp 2020" />
7+
<meta name="generator" content="Adobe RoboHelp 2022" />
88
<link rel="stylesheet" href="../../../../../assets/css/default.css" type="text/css" />
99
<script src="../../../../../assets/scripts/main_script.js" type="module"></script>
1010
<meta name="rh-authors" content="Mark Alexander" />
@@ -14,16 +14,16 @@
1414
</head>
1515
<body>
1616
<!--<div class="body-scroll" style="top: 150px;">-->
17-
<h1>path_endaction</h1>
18-
<p>This variable can be used to get or to change the reaction of an instance when it reaches the end of the current path. Normally you would set this when you start the path using <a href="../path_start.htm"><span class="inline">path_start()</span></a> but you may wish to change this behaviour depending on any number of events in your game. The available values are expressed using the following constants:</p>
17+
<h1><span data-field="title" data-format="default">path_endaction</span></h1>
18+
<p>This built-in variable can be used to get or to change the reaction of an instance when it reaches the end of the current path. Normally you would set this when you start the path using <span class="inline3_func"><a data-xref="{title}" href="../path_start.htm">path_start</a></span> but you may wish to change this behaviour depending on any number of events in your game. The available values are expressed using the following constants:</p>
1919
<table>
2020
<colgroup>
2121
<col />
2222
<col />
2323
</colgroup>
2424
<tbody>
2525
<tr>
26-
<th colspan="2"><span data-keyref="Type_Constant_Path_End_Action"><a data-rhwidget="HyperlinkPopover" href="../../../../../../GameMaker_Language/GML_Reference/Asset_Management/Paths/Path_Variables/path_endaction.htm">Path End Action Constant</a></span></th>
26+
<th colspan="2"><span data-keyref="Type_Constant_Path_End_Action"><a href="path_endaction.htm" target="_blank">Path End Action Constant</a></span></th>
2727
</tr>
2828
<tr>
2929
<th>Constant</th>
@@ -49,10 +49,10 @@ <h1>path_endaction</h1>
4949
</table>
5050
<p> </p>
5151
<h4>Syntax:</h4>
52-
<p class="code">path_endaction;</p>
52+
<p class="code"><span data-field="title" data-format="default">path_endaction</span></p>
5353
<p> </p>
5454
<h4>Returns:</h4>
55-
<p class="code"><span data-keyref="Type_Constant_Path_End_Action"><a data-rhwidget="HyperlinkPopover" href="../../../../../../GameMaker_Language/GML_Reference/Asset_Management/Paths/Path_Variables/path_endaction.htm">Path End Action Constant</a></span></p>
55+
<p class="code"><span data-keyref="Type_Constant_Path_End_Action"><a href="path_endaction.htm" target="_blank">Path End Action Constant</a></span></p>
5656
<p> </p>
5757
<h4>Example:</h4>
5858
<p class="code">if (path_endaction == path_action_stop)<br />
@@ -62,15 +62,14 @@ <h4>Example:</h4>
6262
<p>The above code will check the path end action and if it&#39;s set to stop, then the end action will be changed to reverse.</p>
6363
<p> </p>
6464
<p> </p>
65-
<p> </p>
6665
<div class="footer">
6766
<div class="buttons">
6867
<div class="clear">
69-
<div style="float:left">Back: <a href="Path_Variables.htm">Path Variables</a></div>
70-
<div style="float:right">Next: <a href="../path_start.htm">path_start</a></div>
68+
<div style="float:left">Back: <a data-xref="{title}" href="Path_Variables.htm">Path Variables</a></div>
69+
<div style="float:right">Next: <a data-xref="{title}" href="../path_start.htm">path_start</a></div>
7170
</div>
7271
</div>
73-
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2022 All Rights Reserved</span></h5>
72+
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2025 All Rights Reserved</span></h5>
7473
</div>
7574
<!-- KEYWORDS
7675
path_endaction

Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Paths/Path_Variables/path_index.htm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ <h1><span data-field="title" data-format="default">path_index</span></h1>
1818
<p>The variable <span class="inline2"><span data-field="title" data-format="default">path_index</span></span> is a <b>read-only</b> variable that holds the handle for a given path asset that has been assigned to an instance using the <span class="inline3_func"><a data-xref="{title}" href="../path_start.htm">path_start</a></span> function. If the instance has no path assigned, the variable will be set to <span class="inline2">-1</span>.</p>
1919
<p> </p>
2020
<h4>Syntax:</h4>
21-
<p class="code"><span data-field="title" data-format="default">path_index</span>;</p>
21+
<p class="code"><span data-field="title" data-format="default">path_index</span></p>
2222
<p> </p>
2323
<h4>Returns:</h4>
2424
<p class="code"><span data-keyref="Type_Asset_Path"><a href="../../../../../The_Asset_Editors/Paths.htm" target="_blank">Path Asset</a></span></p>
@@ -34,11 +34,11 @@ <h4>Example:</h4>
3434
<div class="footer">
3535
<div class="buttons">
3636
<div class="clear">
37-
<div style="float:left">Back: <a href="Path_Variables.htm">Path Variables</a></div>
38-
<div style="float:right">Next: <a href="path_position.htm">path_position</a></div>
37+
<div style="float:left">Back: <a data-xref="{title}" href="Path_Variables.htm">Path Variables</a></div>
38+
<div style="float:right">Next: <a data-xref="{title}" href="path_position.htm">path_position</a></div>
3939
</div>
4040
</div>
41-
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
41+
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2025 All Rights Reserved</span></h5>
4242
</div>
4343
<!-- KEYWORDS
4444
path_index

Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Paths/Path_Variables/path_orientation.htm

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
66
<title>path_orientation</title>
7-
<meta name="generator" content="Adobe RoboHelp 2019" />
7+
<meta name="generator" content="Adobe RoboHelp 2022" />
88
<link rel="stylesheet" href="../../../../../assets/css/default.css" type="text/css" />
99
<script src="../../../../../assets/scripts/main_script.js" type="module"></script>
1010
<meta name="rh-authors" content="Mark Alexander" />
@@ -14,32 +14,31 @@
1414
</head>
1515
<body>
1616
<!--<div class="body-scroll" style="top: 150px;">-->
17-
<h1>path_orientation</h1>
18-
<p>This variable holds the current orientation of the path that has been assigned to the instance when the function <span class="inline"><a href="../path_start.htm">path_start()</a></span> was called. When a path is created, its orientation is the default
19-
0 degrees, but you can set this value to anything you wish using this. Remember that in <span data-keyref="GameMaker Name">GameMaker</span> (unless you are using physics) the angles are calculated counter-clockwise, so setting the path orientation
20-
to 90° would rotate the path to the <i>left</i>.</p>
17+
<h1><span data-field="title" data-format="default">path_orientation</span></h1>
18+
<p>This built-in variable holds the current orientation of the path that was assigned to the instance when the function <span class="inline3_func"><a data-xref="{title}" href="../path_start.htm">path_start</a></span> was called.</p>
19+
<p>When a path is created, its orientation is the default 0 degrees, but you can set this value to anything you wish using this. Remember that in <span data-keyref="GameMaker Name">GameMaker</span> (unless you are using physics) the angles are calculated counter-clockwise, so setting the path orientation to 90° would rotate the path to the <i>left</i>.</p>
2120
<p><img alt="Path Orientation Example" class="center" src="../../../../../assets/Images/Scripting_Reference/GML/Reference/Paths/pathrotated.png" /></p>
2221
<h4>Syntax:</h4>
23-
<p class="code">path_orientation;</p>
22+
<p class="code"><span data-field="title" data-format="default">path_orientation</span></p>
2423
<p> </p>
2524
<h4>Returns:</h4>
26-
<p class="code"><span data-keyref="Type_Real"></span></p>
25+
<p class="code"><span data-keyref="Type_Real"><a href="../../../../GML_Overview/Data_Types.htm" target="_blank">Real</a></span></p>
2726
<p> </p>
2827
<h4>Example:</h4>
29-
<p class="code">mypath = path_duplicate(choose(path_1, path_2, path_3, path_4));<br/> path_start(path, 4, path_action_reverse, 0);<br/> path_orientation = 90;</p>
30-
<p>The above code duplicates a random, pre-made path asset into the variable &quot;mypath&quot;. This new path is then started and rotated 90°.</p>
31-
<p> </p>
28+
<p class="code">my_path = path_duplicate(choose(path_1, path_2, path_3, path_4));<br />
29+
path_start(my_path, 4, path_action_reverse, 0);<br />
30+
path_orientation = 90;</p>
31+
<p>The above code duplicates a random, pre-made path asset into the variable <span class="inline2">my_path</span>. This new path is then started and rotated 90°.</p>
3232
<p> </p>
3333
<p> </p>
3434
<div class="footer">
3535
<div class="buttons">
3636
<div class="clear">
37-
<div style="float:left">Back: <a href="Path_Variables.htm">Path Variables</a></div>
38-
<div style="float:right">Next: <a href="path_endaction.htm">path_endaction</a></div>
39-
37+
<div style="float:left">Back: <a data-xref="{title}" href="Path_Variables.htm">Path Variables</a></div>
38+
<div style="float:right">Next: <a data-xref="{title}" href="path_endaction.htm">path_endaction</a></div>
4039
</div>
4140
</div>
42-
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2021 All Rights Reserved</span></h5>
41+
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2025 All Rights Reserved</span></h5>
4342
</div>
4443
<!-- KEYWORDS
4544
path_orientation

Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Paths/Path_Variables/path_position.htm

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
66
<title>path_position</title>
7-
<meta name="generator" content="Adobe RoboHelp 2019" />
7+
<meta name="generator" content="Adobe RoboHelp 2022" />
88
<link rel="stylesheet" href="../../../../../assets/css/default.css" type="text/css" />
99
<script src="../../../../../assets/scripts/main_script.js" type="module"></script>
1010
<meta name="rh-authors" content="Mark Alexander" />
@@ -14,30 +14,28 @@
1414
</head>
1515
<body>
1616
<!--<div class="body-scroll" style="top: 150px;">-->
17-
<h1>path_position</h1>
18-
<p>This function can be used to get or to set the position of an instance along a path. The value is normalised from 0 - 1, so if you set it to, for example, 0.5, the instance will be moved to exactly the middle of the path.</p>
17+
<h1><span data-field="title" data-format="default">path_position</span></h1>
18+
<p>This built-in variable can be used to get or to set the position of an instance along a path. The value is normalised from 0 - 1, so if you set it to, for example, 0.5, the instance will be moved to exactly the middle of the path.</p>
1919
<p> </p>
2020
<h4>Syntax:</h4>
21-
<p class="code">path_position;</p>
21+
<p class="code"><span data-field="title" data-format="default">path_position</span></p>
2222
<p> </p>
2323
<h4>Returns:</h4>
24-
<p class="code"><span data-keyref="Type_Real"></span></p>
24+
<p class="code"><span data-keyref="Type_Real"><a href="../../../../GML_Overview/Data_Types.htm" target="_blank">Real</a></span></p>
2525
<p> </p>
2626
<h4>Example:</h4>
27-
<p class="code">path_position = random(1);</p>
27+
<p class="code"><span data-field="title" data-format="default">path_position</span> = random(1);</p>
2828
<p>The above code sets the instance to a random position anywhere on the current path.</p>
2929
<p> </p>
3030
<p> </p>
31-
<p> </p>
3231
<div class="footer">
3332
<div class="buttons">
3433
<div class="clear">
35-
<div style="float:left">Back: <a href="Path_Variables.htm">Path Variables</a></div>
36-
<div style="float:right">Next: <a href="path_positionprevious.htm">path_positionprevious</a></div>
37-
34+
<div style="float:left">Back: <a data-xref="{title}" href="Path_Variables.htm">Path Variables</a></div>
35+
<div style="float:right">Next: <a data-xref="{title}" href="path_positionprevious.htm">path_positionprevious</a></div>
3836
</div>
3937
</div>
40-
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2021 All Rights Reserved</span></h5>
38+
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2025 All Rights Reserved</span></h5>
4139
</div>
4240
<!-- KEYWORDS
4341
path_position

Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Paths/Path_Variables/path_positionprevious.htm

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
66
<title>path_positionprevious</title>
7-
<meta name="generator" content="Adobe RoboHelp 2020" />
7+
<meta name="generator" content="Adobe RoboHelp 2022" />
88
<link rel="stylesheet" href="../../../../../assets/css/default.css" type="text/css" />
99
<script src="../../../../../assets/scripts/main_script.js" type="module"></script>
1010
<meta name="rh-authors" content="Mark Alexander" />
@@ -14,35 +14,33 @@
1414
</head>
1515
<body>
1616
<!--<div class="body-scroll" style="top: 150px;">-->
17-
<h1>path_positionprevious</h1>
18-
<p>This variable can be used to get or to set the position of an instance along its current path in the previous step, and is a normalised value between 0 and 1 ie: 0 is the start position of the path and 1 would be the end position. It is similar to the <a href="../../Instances/Instance_Variables/xprevious.htm"><span class="inline">xprevious</span></a> and <a href="../../Instances/Instance_Variables/yprevious.htm"><span class="inline">yprevious</span></a> variables in how it works, only it is specific for paths. It can be useful for things like temporarily stopping a path follower if something is in the way (see the example code below).</p>
17+
<h1><span data-field="title" data-format="default">path_positionprevious</span></h1>
18+
<p>This built-in variable can be used to get or to set the position of an instance along its current path in the previous step, and is a normalised value between 0 and 1, i.e.: 0 is the start position of the path and 1 would be the end position. It is similar to the <span class="inline2"><a data-xref="{title}" href="../../Instances/Instance_Variables/xprevious.htm">xprevious</a></span> and <span class="inline2"><a data-xref="{title}" href="../../Instances/Instance_Variables/yprevious.htm">yprevious</a></span> variables in how it works, only it is specific for paths. It can be useful for things like temporarily stopping a path follower if something is in the way (see the example code below).</p>
1919
<p> </p>
2020
<h4>Syntax:</h4>
21-
<p class="code">path_positionprevious;</p>
21+
<p class="code"><span data-field="title" data-format="default">path_positionprevious</span></p>
2222
<p> </p>
2323
<h4>Returns:</h4>
24-
<p class="code"><span data-keyref="Type_Real"></span></p>
24+
<p class="code"><span data-keyref="Type_Real"><a href="../../../../GML_Overview/Data_Types.htm" target="_blank">Real</a></span></p>
2525
<p> </p>
2626
<h4>Example:</h4>
2727
<p class="code">var _x = x + lengthdir_x(16, direction);<br />
2828
var _y = y + lengthdir_y(16, direction);<br />
29-
if (collision_circle(xx, yy, 16, obj_Player, false,true)) <br />
29+
if (collision_circle(_x, _y, 16, obj_player, false, true))<br />
3030
{<br />
3131
    path_position = path_positionprevious;<br />
3232
}</p>
33-
<p>The above code checks an area in front of the instance for a collision with the object &quot;obj_Player&quot; and if there is one, it sets the instance back to the previous position it occupied on the current path, as assigned by the function <span class="inline"><a href="../path_start.htm">path_start()</a></span>.</p>
34-
<p> </p>
33+
<p>The above code checks an area in front of the instance for a collision with an instance of object <span class="inline2">obj_player</span> and if there is one, it sets the instance back to the previous position it occupied on the current path, as assigned by the function <span class="inline3_func"><a data-xref="{title}" href="../path_start.htm">path_start</a></span>.</p>
3534
<p> </p>
3635
<p> </p>
3736
<div class="footer">
3837
<div class="buttons">
3938
<div class="clear">
40-
<div style="float:left">Back: <a href="Path_Variables.htm">Path Variables</a></div>
41-
<div style="float:right">Next: <a href="path_speed.htm">path_speed</a></div>
42-
39+
<div style="float:left">Back: <a data-xref="{title}" href="Path_Variables.htm">Path Variables</a></div>
40+
<div style="float:right">Next: <a data-xref="{title}" href="path_speed.htm">path_speed</a></div>
4341
</div>
4442
</div>
45-
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2021 All Rights Reserved</span></h5>
43+
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2025 All Rights Reserved</span></h5>
4644
</div>
4745
<!-- KEYWORDS
4846
path_positionprevious

0 commit comments

Comments
 (0)