Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

I'm using runtime 2.2.0.258 I tried changing "var i = 0" but I think I'm doing it wrong because I'm getting  an "unexpected syntax error"


this is how it looked before I changed it: 

// create another array that has the correct entries
var len = array_length_1d(global.__objectDepths);
global.__objectID2Depth = [];
for( var i=0; i<len; ++i ) {
var objID = asset_get_index( global.__objectNames[i] );
if (objID >= 0) {
global.__objectID2Depth[ objID ] = global.__objectDepths[i];
} // end if
} // end for


and this is after trying to do what you suggested:

// create another array that has the correct entries
var len = array_length_1d(global.__objectDepths);
global.__objectID2Depth = [];
for var i( i=0; i<len; ++i ) {
var objID = asset_get_index( global.__objectNames[i] );
if (objID >= 0) {
global.__objectID2Depth[ objID ] = global.__objectDepths[i];
} // end if
} // end for


sorry for being a pain, new to GMS2 really appreciate you trying to help.

Yeah, that's an actual syntax error... the correct version would be this:

var i;
for( i=0; i<len; ++i ) {

But yeah, this is weird... if we're using the exact same runtime to load the exact same file, we should get the same results. (You're using the v1.1 version of the GMS2 source, right?). Maybe it's time to contact Yoyo support about it...

There's one more thing we could try first, though... I'll try importing the GMS1 1.1 source file in the latest version of GMS2 and upload that as a GMS2 1.2 source file, and if there's any issues with the compatibility scripts that should hopefully be resolved by that.

Uploaded a new "Source Code (GMS2) (v1.2)" file which is freshly imported from the GMS1 source in the latest GMS2 runtime, please try that out and see if it solves the problem (it compiles and runs just fine for me, but then again so did all of the other versions...).

YES! Finally lol thank you so much, it works great :)

Awesome, glad to hear that! I suppose I'll go hide the outdated versions now so they don't trip any more people up...