Page 1 of 1

"Invalid map layer" errors... engine bug?

Posted: Thu Jan 15, 2015 8:45 pm
by FnrrfYgmSchnish
Something I'm noticing when playing through Okédoké to catch bugs (which I did not notice when I was playing through prior to the most recent release, even when testing out the scripts that bring up this error message now...), it seems like every script that changes the tileset of a map layer is giving me an "invalid map layer" error message screen like the one attached.

I'm not sure what the heck is going on here: map layer 1 does exist on this map so it shouldn't be "invalid." It's set to a blank tileset, and the script is set up to change the tileset to a different one so that a ladder appears--tiles were placed using the non-blank tileset and then I changed the layer settings to use the blank one so all the tiles would be in the right place when the change happened.

This worked fine in the older nightly I was testing Okédoké with before releasing the complete version of the game, but gives me an error message every time in the December 19th nightly than I'm currently using. I think it might also happen in the version I upgraded to shortly before releasing the final version, as a review mentioned the bug and I'm assuming he was using the included game.exe.

Posted: Thu Jan 15, 2015 8:48 pm
by Bob the Hamster
Can you post the ladderappear script?

EDIT: nevermind, there is definitely an engine bug here, of the "why has this EVER worked?" variety.

Posted: Thu Jan 15, 2015 8:51 pm
by FnrrfYgmSchnish
There's not much to it, but sure.

Code: Select all

script, LadderAppear,
(
	if(check tag(tag:IntoTheBubbaNest) == on)
		then(change tileset(14,1))
)

Posted: Thu Jan 15, 2015 8:55 pm
by Bob the Hamster
Hmmm... So I tracked this down to a bug in the code that checks whether or not a layer is valid. I can't believe this ever worked properly, and the bug was introduced all the way back in May of 2014.

When you say you were using a "December 19th" nightly build, do you mean December 19th of 2013?

At any rate, I can fix this, I'll let you know when the fix is ready.

Posted: Thu Jan 15, 2015 8:58 pm
by FnrrfYgmSchnish
December 19th 2014 is the nightly I'm currently using. The version I was testing Okédoké on before (when these error messages didn't happen) was definitely older than May 2014, though I don't know exactly how far before.

Good to know this is an engine bug (that will be fixed!) and not something I messed up in my scripts, though!

Posted: Thu Jan 15, 2015 9:16 pm
by Bob the Hamster
Okay, bug fixed, thanks for pointing that out to me!

I am rebuilding the nightlies, so wait about an hour, and then download the latest, and let me know how it works for you.

Posted: Fri Jan 16, 2015 1:39 am
by FnrrfYgmSchnish
Just downloaded the new nightly and poked around on the closest map that was giving me this bug again. Seems to be fixed! No script error message this time, and the ladder appears as normal (when I was getting the error, I also wasn't seeing the ladder show up.)