• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Windows Collision Events not showing up in Debugger

Yizzard

Member
I've had this problem for a very long time now and have not been able to find anything about it anywhere. Whenever I have a break point in a collision event for an object (example: my collectible object has a collision event that when it collides with a player it is gotten by them) it doesn't appear in the debugger. The debugger still stops and walks through the code as normal, the variables update correctly and stuff, but I just can't see it happening. It doesn't ever open the collision event's code in the debugger window and there's no little red bar on the line it's on (because the line it's on isn't on the screen anywhere). As soon as the code exits the collision event, it pulls up the next event correctly and everything works fine, but if it ever goes back into the collision event, it just leaves open whatever the last event was before the collision event and doesn't show any new code until exiting the collision event again. This has been happening for quite some time now for me, pretty much since I got GMS2. It's a very annoying glitch and I can't seem to find any info on it. It has persisted through multiple updates and I can't figure out why. It is more difficult to debug collisions when I can't see what's going on in them. If anyone has any tips that would be very helpful.
Thanks!
 

Roldy

Member
What OS?

What is the name of the collision file? Open the event and hover the mouse over the file tab to see the path and file name.

Copy/Paste the collision event in the forum code block </>
 
Last edited:

Yizzard

Member
It's Windows and the game is being built for Windows as well if that matters. This bug happens with every collision file on every object, but one example is on an object called obj_Collectible and the collision event for obj_Player is objects/obj_Collectible/Collision_0d63509a-7cd1-45ed-a6aa-fb67148cf069.gml
Here is the code:
GML:
/// @description Collectible Get
if(!textCreated && resetCooldown < 0)
{
    resetCooldown = .5;
    obj_Player.pause = true;
    with(obj_GenericEnemy)
        pause = true;
    
    //find where the camera man is
    var cx = camera_get_view_x(view_camera[0]);
    var cy = camera_get_view_y(view_camera[0]);
    var cw = camera_get_view_width(view_camera[0]);
    var ch = camera_get_view_height(view_camera[0]);
    //creates the textbox in the center bottomish of the screen
    arrayCnt = 0;
    myTextBox = instance_create_layer(cx+cw/2-sprite_get_width(spr_TextBox)/2, cy+ch-sprite_get_height(spr_TextBox)-bottomOffset, "InvisibleTrackers", obj_TextBoxAnnouncer);
    if(collectedBy == obj_Player.object_index || collectedBy == noone)
    {
        x = obj_Player.x;
        y = obj_Player.y - obj_Player.sprite_height;
        myTextBox.myTotalText[0] = obj_Player.myName + " got the " + collectibleName;
        alarm[9] = 1;
        global.collectiblesCollected[myCollectibleNum] = true;
        if(checkHowManyLeft)
        {
            var cnt = 0;
            var finished = true;
            while(cnt < array_length_1d(others))
            {
                if(!global.collectiblesCollected[others[cnt]])
                    finished = false;
                cnt++;
            }
            if(finished)
            {
                if(instList[0] != noone)
                {
                    if(!obj_Player.textCreated)
                    {
                        cnt = 0;
                        while(cnt < array_length_1d(instList))
                        {
                            instList[cnt].alarm[alarmList[cnt]] = 1;
                            cnt++;
                        }
                    }
                    else
                        interactWithInst = true;
                }
                myTextBox.myTotalText[1] = noneLeftText;
                if(triggerWhenDone != noone)
                    triggerWhenDone.alarm[0] = 1;
            }
        }
    }
    else
    {
        myTextBox.myTotalText[0] = obj_Player.myName + " cannot collect the " + collectibleName + ". Only " + collectedByName + " can.";
        alarm[1] = 1;
    }
    myTextBox.myCreator = self;
    myTextBox.npcFont = myFont;
    myTextBox.alarm[0] = 2;
    textCreated = true;
    if(myScript != noone)
    {
        script_execute(myScript);
    }
}
 

ensomari

Member
I've had this problem since I started GMS about that time in July. Still have it. I have to move collision code into the Step event to debug it, and then move it back to collision. I've just assumed debugging collision code was something that was being worked on... hopefully.
 
Top