Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

[IDEA] Create a compiler directive that puts initialization code into gml_pragma

A topic by bowsette_game created Apr 23, 2019 Views: 489 Replies: 2
Viewing posts 1 to 2

So, it seems that in 99% of the time you end up with an init script you need to call before using Haxe functions. I was wondering, is it viable to generate it so it's like this:

gml_pragma("global", "init_function()"); 

gml_pragma can be used from inside an extension, right?

As a side question, how should we handle things if we have multiple packages and we want to use them in a single project? I'd guess it would cause conflicts outside of the box if you don't do anything.

Developer

You can set the "init function" in extension properties to be your entrypoint script, and that'll call it at an appropriate time during game startup.

Didn't know about that. Many thanks.