• 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 Accessing/Modifying values of extensions with best performance

Mert

Member
Hi.

This was a post about efficiently sending data to extensions, and receive from them. Normally, we can send arguments(double and string) as parameters to functions. Sometimes, we need more than that, and send some blob of data. In the past it worked like this:
GML:
extensionFunctionX("Hello:!HowAreYou:!200:!Who");
And then in the extension(Java/Javascript/Cpp), we parsed this blob of data. Like:
JavaScript:
var str =
function extensionFunctionX(data) {
    var str = data; //"Hello:!HowAreYou:!200:!Who"
    var res = str.split(":!");
    
    //Use the data
    var first = res[0];
}
However, this looked ugly. Then I found out something, mainly from Yoyogames' extensions source code. I detailed this in the following video


 
Last edited:
Top