diff --git a/Manual/contents/GameMaker_Language/GML_Overview/Instance Keywords/other.htm b/Manual/contents/GameMaker_Language/GML_Overview/Instance Keywords/other.htm index edd41c570..6c5314f5e 100644 --- a/Manual/contents/GameMaker_Language/GML_Overview/Instance Keywords/other.htm +++ b/Manual/contents/GameMaker_Language/GML_Overview/Instance Keywords/other.htm @@ -42,18 +42,61 @@

Collision Event

other.hit = true;

When 'other' changes

The page on self contains a section on When 'self' changes.

-

This section will describe those cases in relation to how other changes:

+

This section describes those cases in relation to how other changes:

+

value = 40;
+
+ var _struct = {
+     value : 99
+ }
+
+ with (_struct) 
+ {
+     show_debug_message(other.value); // Prints 40
+ } +

+ +

value = 40;
+
+ var _struct = instance_create_depth(0, 0, 0, Object2, {
+     value : 99,
+     func : function () {
+         return other.value;
+     }
+ });
+
+ var _func = _struct.func;
+
+ show_message(_func()); // Prints 40 +

+ +

value = 40;
+
+ item = function () constructor {
+     value = 99;
+     
+     copied_value = other.value;
+ }
+
+ my_item = new item();
+ show_debug_message(my_item.copied_value); // Prints 40 +

+

Legacy other Behaviour

In previous versions of GameMaker other only changed in the following cases: 

This behaviour can be enabled by the Legacy Other Behaviour game option.

Struct Declaration

diff --git a/Manual/contents/GameMaker_Language/GML_Overview/Instance Keywords/self.htm b/Manual/contents/GameMaker_Language/GML_Overview/Instance Keywords/self.htm index c5924765d..c61c5694a 100644 --- a/Manual/contents/GameMaker_Language/GML_Overview/Instance Keywords/self.htm +++ b/Manual/contents/GameMaker_Language/GML_Overview/Instance Keywords/self.htm @@ -24,12 +24,42 @@

self

}

In this example you can see that we have a local variable called val and we want it to set the instance variable with the same name in the newly created object instance. To identify the instance variable correctly and tell GameMaker to set it in the instance calling the code block, we use the self keyword.

self is used in the same way with structs to reference member variables of the struct. It can also be used within constructor functions to reference the struct being generated from the constructor.

+

 Due to compatibility reasons, converting self into a string will return -1.

When 'self' changes

-

Within an event, the current self will change in the following situations:

+

Within an event or script, the current self will change in the following situations:

+

value = 40;
+
+ var _struct = instance_create_depth(0, 0, 0, Object2, {
+     value : 99,
+     func : function () {
+         return self.value;
+     }
+ });
+
+ var _func = _struct.func;
+
+ show_message(_func()); // Prints 99 +

+ +

value = 40;
+
+ item = function () constructor {
+     value = 99;
+     
+     copied_value = self.value;
+ }
+
+ my_item = new item();
+ show_debug_message(my_item.copied_value); // Prints 99 +

+

In all of these cases, when self changes to a new scope, other will be set to be the previous scope. The only exception is when a bound constructor method is called. This is described more in When 'other' changes.

diff --git a/Manual/contents/GameMaker_Language/GML_Reference/File_Handling/Encoding_And_Hashing/load_csv.htm b/Manual/contents/GameMaker_Language/GML_Reference/File_Handling/Encoding_And_Hashing/load_csv.htm index fc6e8dc20..4a6d087a7 100644 --- a/Manual/contents/GameMaker_Language/GML_Reference/File_Handling/Encoding_And_Hashing/load_csv.htm +++ b/Manual/contents/GameMaker_Language/GML_Reference/File_Handling/Encoding_And_Hashing/load_csv.htm @@ -1,16 +1,17 @@ - - + + + load_csv - - + + - - - - - + + + + + @@ -40,22 +41,22 @@

Returns:

DS Grid

 

Example:

-

file_grid = load_csv("spreadsheet.csv");
- var ww = ds_grid_width(file_grid);
- var hh = ds_grid_height(file_grid);
- var xx = 32;
- var yy = 32;
- for (var i = 0; i < ww; i++;)
- {
-     for (var j = 0; j < hh; j++;)
-     {
-         draw_text(xx, yy, file_grid[# i, j]);
-         yy += 32;
-     }
-     yy = 32;
-     xx += 32;
+

file_grid = load_csv("spreadsheet.csv");
+ var ww = ds_grid_width(file_grid);
+ var hh = ds_grid_height(file_grid);
+ var xx = 32;
+ var yy = 32;
+ for (var i = 0; i < ww; i++;)
+ {
+     for (var j = 0; j < hh; j++;)
+     {
+         draw_text(xx, yy, file_grid[# i, j]);
+         yy += 32;
+     }
+     yy = 32;
+     xx += 32;
}

-

The above code will open the given CSV file and store the returned DS grid in the variable "file_grid". This grid is then parsed in a couple of for lops and the contents drawn to the screen.

+

The above code will open the given CSV file and store the returned DS grid in the variable "file_grid". This grid is then parsed in a couple of for loops and the contents drawn to the screen.

 

 

 

@@ -74,5 +75,5 @@
© Copyright YoYo Games Ltd. 2024 All R - - \ No newline at end of file + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Networking/Networking.htm b/Manual/contents/GameMaker_Language/GML_Reference/Networking/Networking.htm index b2724125a..fba391012 100644 --- a/Manual/contents/GameMaker_Language/GML_Reference/Networking/Networking.htm +++ b/Manual/contents/GameMaker_Language/GML_Reference/Networking/Networking.htm @@ -31,7 +31,7 @@

Raw Functions

Packet Separation

When using raw TCP networking, multiple packets sent by one client may be received as a single packet by the receiving client, and the opposite may also happen where a single packet is split into multiple packets. Non-raw networking functions prevent this from happening as GameMaker inserts headers into each packet, allowing the receiving GameMaker client to separate or combine incoming packets to represent them as they were sent.

When using raw TCP functions, it will fall on the game to read the incoming packets and separate/combine them as they were sent.

-

When using UDP or WebSockets, packets will be delivered in the form that they were sent, so using the non-raw functions for these protocols only adds unnecessary overhead.

+

When using UDP or WebSockets, packets will be delivered in the form that they were sent. Using the non-raw functions for these protocols only adds unnecessary overhead.

Function Reference

Compiler Optimisations

The compiler performs optimisations on your game's code. See Compiler Optimisations.

+

By default, any assets that are unused or not referenced directly in your code are stripped from the game's executable. This can be disabled through the Game Options or you can mark tags that should always be preserved through gml_pragma("MarkTagAsUsed", <tags>).

How Different Targets Build

Each target option saves to a platform-specific format, listed below:

-
  • Automatically remove unused assets when compiling: This option enables automatic removal of unused assets when compiling. When enabled, any unused assets that are removed will be logged in the compile output of the project. This setting is enabled by default. This does not affect assets used from the Prefab Library (except for those that have been duplicated into the project) as unused Prefab assets will always be removed during compilation.
  • +
  • Automatically remove unused assets when compiling: This option enables automatic removal of unused assets when compiling. When enabled, any unused assets that are removed will be logged in the compile output of the project. This setting is enabled by default. You can mark tags as used with gml_pragma("MarkTagAsUsed", <tags>) and any assets with the specified tags will not be stripped when this option is enabled. This option does not affect assets used from the Prefab Library (except for those that have been duplicated into the project) as unused Prefab assets will always be removed during compilation.
  • The Main Options section also contains a menu for Template Info.

    The Asset Browser will also have other Game Options available to you depending on the target platforms that are available for the licence that you have and not all of them may be available or visible.

    diff --git a/Manual/contents/The_Asset_Editors/Code_Editor_Properties/Code_Snippets.htm b/Manual/contents/The_Asset_Editors/Code_Editor_Properties/Code_Snippets.htm index 1b454faa9..91089dbda 100644 --- a/Manual/contents/The_Asset_Editors/Code_Editor_Properties/Code_Snippets.htm +++ b/Manual/contents/The_Asset_Editors/Code_Editor_Properties/Code_Snippets.htm @@ -19,7 +19,7 @@

    Code Snippets

    A very handy tool you have at your disposal when editing your code is the use of Code Snippets.

    These are pre-made blocks of code you can insert into your code at any time. A snippet can have placeholders, where you can insert expressions while entering the snippet.

    Using Snippets

    -

    In The Code Editor (Beta), code snippets are inserted through Code Completion. For example, writing for will show its snippet in the Candidate Window, and pressing enter will insert that snippet.

    +

    In Code Editor 2 (Beta), code snippets are inserted through Code Completion. For example, writing for will show its snippet in the Candidate Window, and pressing enter will insert that snippet.

    Inserting a snippet will highlight its first placeholder. After entering text into that placeholder, press tab to cycle through each placeholder until you have gone through all of them.

    Custom Snippets

    @@ -126,7 +126,7 @@

    Legacy Code Editor

    © Copyright YoYo Games Ltd. 2024 All Rights Reserved
    diff --git a/Manual/contents/assets/snippets/Handle_Format.hts b/Manual/contents/assets/snippets/Handle_Format.hts index 5745c5e41..0ed57f743 100644 --- a/Manual/contents/assets/snippets/Handle_Format.hts +++ b/Manual/contents/assets/snippets/Handle_Format.hts @@ -9,6 +9,6 @@ -

    "ref <type> <id>"

    +

    "ref <type> <id>" or "ref <type> <name>"

    \ No newline at end of file