Not logged in
Register | Login

Menu:

Game Maker Extensions Menu:

av. 8/10 | Who rated

Credit to Jonah Turnquist (not required)

Downloads: 1484

Tags:

Get a refer button for this extension!

BBcode

html [example]
download
[download]

Advanced Arrays

Posted by Jonah on January 02, 2008

Allows for multi-dimensional arrays with tons of extra features that the normal Game Maker arrays don't allow. This includes using strings for keys instead of just numbers.

Read the documentation


» Add a Screenshot


Functions:

array_copy(arrayId)

Copies an array

Returns New array ID

array_create()

Creates an array and returns an ID to be used with other functions

Returns New array ID

array_destroy(arrayId, key1, key2, key3...)

Destroys an array or part of one. Does not work for sub-arrays. Use array_destroy2 for that.

array_destroy2(arrayId)

Just like array_destroy but works for sub-arrays. It does not allow for keys though and can be much slower

array_get(arrayId, key1, key2, key3...)

Retrieves a value or sub-array from an array.

Returns array ID or value

array_print(arrayId)

This function show_messages()'s the array's contents (very useful for debugging). It also saves it to the file Array_print.txt

array_set(arrayId, value, key1, key2, key3...)

Sets a value to an array

array_set2(arrayId, arrayId2, key1, key2, key3...)

Sets an array to an array (nests one into the other in other words)

array_size(arrayId)

Gets the size of an array. Counts branches to, but not inside the branches (not recursive in other words).

Returns size

array_isSet(arrayId, key1, key2, key3...)

Tests if key(s) are set





You not logged on! It is recommended you logon before commenting so we can tell who you are!

Comments:

12:21pm, 11 Jan 2008
Guest

An array_print(arrayId,filename) would be nice.

5:30am, 24 Aug 2010
hakkan

güzel

11:05am, 14 Sep 2011
Romtos

First of all, this is brilliant! It’s incredibly useful. (If I manage to get it working). That said, I’m having trouble using this code. I’m getting the following error: “Illegal array index in script "array_set". trying to access argument[8], but only 8 arguments have been supplied.” Replace 8 with whatever amount of arguments I try to provide. I keep on getting this. Two questions:

1) Am I using this code wrong or is this due to incompatibility with 8.1?
2) I can avoid the error by unchecking “Throw an error when argument aren’t initialized correctly.” under global game settings. Is this a solution for incompatibility or am I simply avoiding a very real problem which will rear its ugly head later on?

I guess those two questions come down to the same thing.

12:52pm, 19 Sep 2011
Romtos

After working with the code for a while, it seems to work perfectly fine. I just read somewhere that in the future the option to turn this error off will disappear. I hope that won't be the case, because it'd be a great loss not being able to use this.

3:31am, 22 Oct 2014
jillheden

I get an error when I try to run the game with this extension saying
Compile Extensions...Error : gml_Script_sym_copy_climb(0) : Assignment operator expected
Final Compile...Error : gml_Script_sym_copy_climb(0) : malformed assignment statement


I do not have any other extensions installed and I am using GameMaker Studio. Don't know if that's a problem...?

Gamemaker studio education (standard edition) v1.3.1386