SOLVED Room Transition Object Not Going to Correct Room

O

Optimistic Ori

Guest
Hello friends, I've been following Shaun Spalding's shooter/platformer tutorial, and I've come into a problem I can't seem to solve myself or find the solution to in the comments or elsewhere on the forum.

I have an object set to change my current room upon collision, though whenever I try to do this, it seems to send me back to my original room without ever touching the room I'm trying to go into.
Here's the stuff I have written in the Create event:
GML:
w = display_get_gui_width();
h = display_get_gui_height();
h_half = h / 2;

enum TRANS_MODE
{
    OFF,
    NEXT,
    GOTO,
    RESTART,
    INTRO
}

mode = TRANS_MODE.INTRO;
percent = 1;
target = room;

And here's all the stuff written to change rooms and animate the transition:
GML:
if (mode != TRANS_MODE.OFF)
{
    if (mode == TRANS_MODE.INTRO)
    {
        percent = max(0, percent - max(percent / 10, 0.005));
    }
    else
    {
        percent = min(1, percent + max(((1 - percent) / 10), 0.005));
    }
    
    if (percent == 1) || (percent ==0) //State Machine for Transition Mode
    {
        switch(mode)
        {
            case TRANS_MODE.INTRO:
            {
                mode = TRANS_MODE.OFF;
                break;
            }
            case TRANS_MODE.GOTO:
            {
                mode = TRANS_MODE.INTRO;
                room_goto(target);
                break;
            }
            case TRANS_MODE.NEXT:
            {
                mode = TRANS_MODE.INTRO;
                room_goto_next();
                break;
            }           
            case TRANS_MODE.RESTART:
            {
                game_restart();
                break;
            }
        }
    }
}

My goal is to use my TRANS_MODE.GOTO so I can go to specific rooms by using my trigger object's creation code rather than go to the next room in line.
But trying to do this with my trigger object just places me back in the first room.
GML:
/// @desc Collision = Room Change
with(oPlayer)
{
    if (hasControl)
    {
        hasControl = false;
        SlideTransition(TRANS_MODE.GOTO, other.target);
    }
}

Here's the code written in the script I called above:
GML:
function SlideTransition()
{
    with(oTransition)
    mode = argument[0];
    if (argument_count > 1) target = argument[1];
}

Now I have done some testing, and replacing other.target in my Trigger Object with rTwo (name of my second room) works fine,
and so does replacing TRANS_MODE.GOTO with TRANS_MODE.NEXT. I would rather not work with this, though.

The only thing I have in my trigger object's creation code is target = rTwo, and I haven't tried fiddling with that.

Any suggestions, or do I need to share anything else?
 
O

Optimistic Ori

Guest
Yet again, my problem has been resolved by copying everything into a new project. Coming to this be getting frustrating.
 
Top