• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

GMS 2.3+ Warp Issue: SOLVED

I'm running into a problem I can't seem to fix, perhaps someone can assist:

My warps are all set up and work just fine for all of my rooms thus far, however, in my town room where you would hit the warps on a vertical when entering a building, they are causing what I can only describe as "ghost warp spaces" around the bottom of the warp that will take you inside the building room. To SEE what is going on, I posted a unlisted video on my YouTube channel:


My code **looks** ok to my untrained eye, nothing weird, but perhaps I am missing something. This is what I currently have on my obj_warp:

Code:
CREATE
// @desc Inititalize
target = 0;
xx = 0;
yy = 0;
active = 0;

ROOM START
/// @desc Reactivate
active = 0;

COLLISION (obj_eris which is the player)
/// @desc Fadeout to next room
if (active == 0) {
    fadeout (target, c_black, 0.05, xx, yy);
active = 1;
}
And this is what's on my move_state.gml

Code:
//--------COLLISION CHECKS
    //Horizontal
    if(moveX != 0){
    if(place_meeting(x + moveX, y, obj_collision)){
        repeat (abs(moveX)){
        if(!place_meeting(x+sign(moveX), y, obj_collision)){ x += sign(moveX); }
        else { break; }
        }    
        moveX = 0;
    }
    }

    //-------Vertical
    if(moveY != 0){
    if(place_meeting(x, y + moveY, obj_collision)){
        repeat (abs(moveY)){
        if(!place_meeting(x, y+sign(moveY), obj_collision)){ y += sign(moveY); }
        else { break; }
        }    
        moveY = 0;
    }
    }
 

woods

Member
with my untrained eye.. i think that your sprite for the player might be clipping into the warp.. ie: the top of your players head is hitting the bottom of the warp triggering the collision..
my first thought would be shrink the collision mask of the player to the bottom half of the sprite. this way basically the feet trigger the collision instead of the whole body..

just a thought
 
with my untrained eye.. i think that your sprite for the player might be clipping into the warp.. ie: the top of your players head is hitting the bottom of the warp triggering the collision..
my first thought would be shrink the collision mask of the player to the bottom half of the sprite. this way basically the feet trigger the collision instead of the whole body..

just a thought
The warp is just above the bottom of the door, so when her "feet" hit it, it should trigger. Which it does. But it's the ghost ones that are on the road that are the issue here, which are no where near the approx 25x25 warp square.
 

kburkhart84

Firehammer Games
Can you show us the collision mask for the player sprite? Also, it seems you are fading out, which takes a little time from when the collision is detected to when it actually happens. This is fine, but you may not be noticing when you are actually hitting the thing. This is why the above person thinks it is the head of the character that is doing it. We can be sure of that if you care to show the sprite mask settings.

You can also do more testing of this. Make a sound, or send a debug message, or something to indicate to you, exactly when the collision happens first. See if that is happening when the head hits the warp spot.
 

woods

Member
second thought is +moveX and +moveY

if(place_meeting(x, y + moveY, obj_collision))


... i bet your collision box is bigger than you think, based on your movement?
 
  • Like
Reactions: Tyg
Can you show us the collision mask for the player sprite? Also, it seems you are fading out, which takes a little time from when the collision is detected to when it actually happens. This is fine, but you may not be noticing when you are actually hitting the thing. This is why the above person thinks it is the head of the character that is doing it. We can be sure of that if you care to show the sprite mask settings.

You can also do more testing of this. Make a sound, or send a debug message, or something to indicate to you, exactly when the collision happens first. See if that is happening when the head hits the warp spot.
eriscol.jpg
 

kburkhart84

Firehammer Games
Did you do some additional testing like I mentioned? I'm referring to adding a sound, debug log, or similar, so you can see for sure exactly when you are hitting the warp thing. You can even disable the warping part temporarily, just check for collisions and give feedback so you know for sure exactly when it is happening.
 
Did you do some additional testing like I mentioned? I'm referring to adding a sound, debug log, or similar, so you can see for sure exactly when you are hitting the warp thing. You can even disable the warping part temporarily, just check for collisions and give feedback so you know for sure exactly when it is happening.
Admittedly I haven't been able to get back to the project since I asked the question (I've been busy with another non-game related project), but I'm not sure how to add a sound to test it...
 

kburkhart84

Firehammer Games
Admittedly I haven't been able to get back to the project since I asked the question (I've been busy with another non-game related project), but I'm not sure how to add a sound to test it...
It doesn't have to literally be a sound...it can be a call to show_debug_message(), or possibly something you draw to the screen. The first option is typically the easiest to implement in most cases.
 
It doesn't have to literally be a sound...it can be a call to show_debug_message(), or possibly something you draw to the screen. The first option is typically the easiest to implement in most cases.
So I tried the debug to say "House 1" when I would hit the warp to the first house, but I don't think it's working quite right, unfortunately. It's saying "Room 1" every time I warp back INTO city 1, but even though I have it on just one warp creation code, the debug message says "Room 1" anytime I use any warp in that room. I tried doing it again with another name, and it did the same thing.

Is it because I only have one warp tile object I use for the whole game, but they all have different creation codes? Like:

Code:
/// Initialize
target = room4_house1;
xx = 320;
yy = 340;
Am I just using too many in a room?
 

kburkhart84

Firehammer Games
You can have multiple of the same object, and have code in the instance_creation code that applies to specific ones. That's perfectly normal and is something I do often. And the code in the create event should not be overriding it either because that happens before the specific instance creation code. However...if you add code that shows a debug message, it is going to do that the same for all the warps. So what you need is to have some kind of debug message that is different for each instance(if you need to determine which one you are hitting).

However, I thought the issue was that you were hitting one that wasn't actually there and so you thought it was a "ghost" instance. Is that still what is going on?
 
I did a warp sound test, and I'm not sure if it helps, or makes sense, but when I enter the house it plays a really soft sound, and when I exit the house it plays a louder version of the sound, kind of like it is stacked.
 

kburkhart84

Firehammer Games
That leads me to believe that somehow, when you exit the house, your sprite is right on top of the warp, and maybe you are doing something to stop the warping but not the actual sound.
 
That leads me to believe that somehow, when you exit the house, your sprite is right on top of the warp, and maybe you are doing something to stop the warping but not the actual sound.
She definitely warps far enough away, or else it goes into the infinite fading room switch.

I also tried changing the player's radius, and that didn't help (in fact it made it so I couldn't interact with other objects anymore).
 

Tyg

Member
What version of gamemaker are you using? In old versions the instance creation code was run before the create event.
But now the instance creation code is run after the create code , like it should be
i make a generic warp object, and each instance has the warp coordinates in the instance creation code
i make this object with a semi transparent sprite for visual in the editor so you can see the warps for development, and then turn the visibility off when actually playing the game
if your warper has no sprite attached it is basically a 1x1 pixel area and hard to land on
a collision with the warper sends you
the sound is probably being stacked if you have it in some kind of step event
you can also check if the sound is playing then dont play it
 
Last edited:
Could it be an error in the region you defined? Like, rather than teleporting at a certain x AND y position, it's only teleporting once you are within a certain x position?
 

Tyg

Member
Ok, so whats up or different in room 9, are you missing some instance creation code or however your assigning teleport coords?
are you assigning them in an array that only has a length that is less than 9 actually 8 with 0 being the first
or your landing on the warp when exiting, maybe make it smaller like running along the door bottom
 
Last edited:
Thanks everyone for your help on this thread. I ended up "solving" the issue by moving the warps up/making them smaller and adjusting the object collision barriers some so player can only warp into the room if she is practically on top of the door. It took a bit of fine tuning and isn't the BEST solution, but hey, it works ^^;
 

woods

Member
so player can only warp into the room if she is practically on top of the door
could maybe move the player collision box up a bit more from the bottom of the sprite? //that would have the player a lil farther from being "overlapped" on the door.
 
Top