A simple script and demonstration to iterate over ds_maps.
When relying on datastructres heavily in Gamemaker, it becomes very apparent that the native functionality for manipulation leaves a lot more to be desired, and this is one of the staple scripts I import to any project before even thinking of beginning.
Similar to "foreach" in PHP, the script makes a pleasant to look at way of iterating all elements of a map as such:
var i = iter(myMap, true), key, val;
while(iter(i)) {
key = iterkey(i);
val = iterval(i);
}
See the included demo object for an in-application use
More Assets:
End User Licence Agreement (EULA).