btacaddy.blogg.se

Game maker studio 2 scripts
Game maker studio 2 scripts







game maker studio 2 scripts

Previously, a script was a single resource that was created on a global scope and used to create a single custom function which would then be called using the script name as the function name. what's been added! To start with we want to talk about in-line functions and scripts. Access a map nested in a grid nested in a list nested in an array:ĭata = "hello world" Ībove we outline some changes to the GameMaker Language, but now it's time to talk about the good stuff.

game maker studio 2 scripts

Access an array nested in a list from a function and modify it: Other examples of use are: // Access a grid that has been added to a list that is part of a map: This would retrieve the data from the 6th position in the DS list that is being held in the grid (0, 0) position. Previously you'd have to first retrieve the index of the list from the grid, and then access the data in the list, but now it's as simple as doing something like this: variable = grid Much like you can now chain arrays together, you can chain the different Data Structure accessors together too, making accessing the data from nested structures much easier.Ī simple example of this would be a DS grid, where each grid entry is a ds list. Note that the old functionality (and the deprecated functions mentioned above) will still work but under no circumstances should new projects use the old syntax, as these will eventually be removed from the language.Īnother change to GML is the ability to chain accessors. The change also means that the following functions have been deprecated: array_length_1d()Īnd the following new functions have been added: array_length(array) This change means that all platforms will now work the same (including HTML5) and enables much larger arrays, both in number of items as well as number of dimensions. The above is now a multi-dimension array with 2 dimensions to it, but you are no longer limited to just 2 dimensions and can create arrays of 3 or 4 or more dimensions as required, eg: array = 1 // A three dimensional array So how do we create a 2D array now? Well this is done by chaining arrays together to essentially create arrays within arrays. However, this is no longer the case and now all arrays are 1D. Previously, GML only permitted 1D or 2D arrays, eg: array_1d = "hello" The first change to the GameMaker language that we want to discuss is a change to how arrays work. In a follow up tech blog we'll cover the changes to the IDE. In this tech blog we'll be going over the changes to GML and we'll give a brief overview of the new language features available.

game maker studio 2 scripts

Now that the 2.3.0 Beta of GameMaker Studio 2 is available, you will be able to see there have been a number of significant changes and additions to the GameMaker Language, as well as a number of changes and additions made to the IDE.









Game maker studio 2 scripts