Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

GMEdit

A high-end code editor for all things GameMaker · By YellowAfterlife

Function highlighting colors are not displayed in events other than the Create Event.

A topic by ZackDeux created 49 days ago Views: 95 Replies: 4
Viewing posts 1 to 5

As shown in the image, function highlighting only works in the Create Event. The program compiles and the function appears to be recognized correctly, but I find it very strange that not only is it not highlighted, but it specifically does NOT get highlighted in events other than the Create Event

Developer

If you want a function that’s only used in an event, you can define it as var example_2 = function() {}.

If you want a function that’s not only used in an event, you should probably put it in Create as a function will only be assigned to an instance variable once that event runs, and will be re-assigned each time it runs.

If you are trying to split up a big Create event, consider #region or @interface + @implements JSDocs.

Well, thank you very much for replying. I mentioned it because GMEdit has really good quality overall, and it seemed strange to me that only this feature behaved like that. (Also, because the argument hint only works for functions inside the Create event)

Developer (1 edit)

To answer your question more directly, GMEdit only picks up function and variable definitions in Create events as it is good practice and spares me of having to make some decisions (e.g. what if you re-define a function with different arguments/types in different events).

If you are 100% sure of your actions, you may use the @init JSDoc tag to assert that variable and function definitions should be picked up in the event as if they were in Create.

Well, I tried to dodge that slap in the face, but I couln't.