Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

GMLive.gml

Livecoding for GameMaker: Studio / GameMaker Studio 2 · By YellowAfterlife

[Solved] layer_create() Error.

A topic by SyntheticPixel created Aug 21, 2019 Views: 253 Replies: 2
Viewing posts 1 to 3
(1 edit)

GMlive reports an error in the code with layer_create(). The error is the following. 

[live][5:03:12 PM] Runtime error: oChickey:Step_0[L64,c22] layer_create needs at least 2 arguments, got 1 

However this function only requires one argument to run. The second argument is optional.

Developer

GMLive's function definitions are based on GM's auto-completion file, which sometimes isn't entirely consistent (e.g. in this case it uses "arg*" to indicate an optional argument, whereas usually it's "[arg]").

You can update the definition by doing

gml_func_add("layer_create(depth, ?name):", g_gml_func_script[?"layer_create"]);

after you call live_init.

I'll fix this in the upcoming version.

Nice. Thanks for the response.  Being able to add that is quite handy.