mappinggmllintergame-maker-language

Mapping eventNum and eventType for GameMaker's .yy files when deleting event files


I'm developing a linter for GML, and I'm working on a function to remove unnecessary files. When deleting event files, GameMaker doesn't automatically remove lines from the corresponding .yy file. I haven't found any documentation on eventNum and eventType. Does anyone have data for mapping these values (e.g., 'Draw_0': (0, 0) or 'Draw_73': (73, 8))? Manually creating this mapping is time-consuming, and any help would be appreciated!


Solution

  • Late answer, but it's less work than you might think! The file name structure is eventTypeName + "_" + eventNumber + ".gml", and if it's a collision event, object name takes place of eventNumber.

    The event types are as following as of GM2024:

    linkType(0, "Create");
    linkType(1, "Destroy");
    linkType(2, "Alarm");
    linkType(3, "Step");
    linkType(4, "Collision");
    linkType(5, "Keyboard");
    linkType(6, "Mouse");
    linkType(7, "Other");
    linkType(8, "Draw");
    linkType(9, "KeyPress");
    linkType(10, "KeyRelease");
    linkType(12, "CleanUp");
    linkType(13, "Gesture");
    

    And if you need to translate numeric eventType-eventNumber, I mapped most of those for GMEdit at one point.