Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

GMLive.gml

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

Error thrown with new functions added by other extensions?

A topic by K.Blank created Nov 13, 2021 Views: 208 Replies: 2
Viewing posts 1 to 2
(1 edit)

Im using both the latest GMLive and GMS2 IDE (2.3.6.595) & Runtime (2.3.6.464).

The error:

[live][2021/11/13 11:38:31] Runtime error: [error] Script index must be a number, got `instance#100017(o_ui_file_browser)` (struct)
 called from o_ui_file_browser:Step_0[L5,c46]


The extension i'm using is File Manager by Samuel Venable. it added buncha functons from dll, not from scripts.

I've tried adding one of the new function "directory_contents()" into the GMLiveAPI.gml like this:

At the end of line 23:

And at the end of line 61:

But the same error still occurs when i call this function while live coding, no matter if i use the original GMLiveAPI.gml or the one modified by me, and i've tried restart gms2 between the modifications.


Am i doing something wrong? or are there any other methods of adding live support for these external functions? 

Developer

For native functions (see limitations), you’ll want to use live_function_add with your own function for implementation, so

live_function_add("directory_contents(dname)", function(dname) {
    return directory_contents(dname);
});

GMLiveAPI shouldn’t be touched by hand and is like that to minimize impact on compile times.

Thank you so much! I never noticed there's this function. it works like a charm now!  :DD