• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker Is the array reference accessor supposed to be used outside of scripts?

A

Annoyed Grunt

Guest
For the longest time, I believed that the array reference accessor "@" would only work inside of scripts and would be useless outside of them. After reading around and doing some personal testing, it seems however that the behaviour described for scripts - arrays are passed as references in the argument variables, and it is only after the array is changed that a copy is made of them unless the accessor is used - is actually not limited to scripts but is used for ALL arrays. However, the manual itself makes no mention of this behaviour outside the context of scripts.

Is this just a case of the documentation being outdated or is by-reference array accessing not an explicitly supported feature and may break in the future?
 

samspade

Member
I don't think that is the implication in the manual. As merely a fellow user, I can't say for sure though.

Array accessors have been there for a long time with pretty much the same language in the manual. You can use them outside of scripts they just don't provide any additional value (that I am aware of).
 
Top