Hey Guys, I'm having a weird issue in my fangame... let me start off with my specs:
Seph Edition Engine
Game Maker 8.1
So I've got this one room with a bunch of trolls. When you trigger them all and exit the room (as intended), the game starts acting very strangely. I'm not sure exactly what's happening, but it's like the create events are no longer being fired. The player starts moving faster than intended (but the physics seem to still be accurate), and the troll spikes in the previous room are clearly visible. You can see what I mean in the spoiler below. Caution: This is for my contest fangame, so if you don't want spoilers, don't open this tag!
I have the troll spikes on layer -1000000, above everything, for development; in the create event I put them at layer 1000000, below everything, so you don't see them. However, it's like the code to hide them isn't being run!
I figured this might be a problem with my room transition code, since it was custom written. I've included it in the spoiler below if you want to look at it.
//Collision with player event
var changedRoom;
changedRoom=false;
with (player) {
if (x > room_width) {
x-=room_width;
room_goto(other.roomTo);
changedRoom=true;
}
else if (x < 0) {
x+=room_width
room_goto(other.roomTo);
changedRoom=true;
}
if (y > room_height) {
y-=room_height;
room_goto(other.roomTo);
changedRoom=true;
}
else if (y < 0) {
y+=room_height;
room_goto(other.roomTo);
changedRoom=true;
}
Another strange occurrence is that this bug only happens in this exact room, and only when you exit it on the left for the first time. I cannot reproduce this bug by coming back here later. If it happens, F2 does not fix it; I have to close the game and reopen it, and then it works as intended for the rest of the game. Maybe it's an issue with my triggers? I've included the code for them as well in the spoiler below.
//create event
primed=true;
//step event
//dep is a value you can set; this trigger won't activate until the trigger with a value of dep is activated
if (dep!=0) {
primed=false;
if (objFreeTrigger.triggered == dep) {
primed=true;
dep=0;
}
}
//collision with player event
if (primed && objFreeTrigger.triggered!=trg) {
objFreeTrigger.triggered=trg;
}
If you require any other information, or would like to look at the project itself, let me know and I would be happy to share. Thanks for taking the time to read!