Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

GM function call during `require()` caused code to fail

A topic by Hyomoto created Feb 03, 2023 Views: 178 Replies: 2
Viewing posts 1 to 3
(1 edit)

I have a good one today.  Test is fairly simple, expose a function to the Lua state via GML, call a lua file which contains requires(), and then have that module try to call the function exposed.  The error passed is attempt to yield across a C-call boundary.  The function will execute fine if called from the source file, it's only when called via requires that the error pops.

Lua error: attempt to yield across a C-call boundary

stack traceback:

[C]: in field 'text'

./core/sprites.lua:3: in main chunk

[C]: in function 'require'

core/data.lua:2: in main chunk

Developer

This is a limitation of the current extension version - it’s listed in documentation.

If you are using GM2022 or newer, you can compile the in-dev next version of the extension from source code - it is spared of this issue and has a number of new features.

Damn it, sorry about that YAL.  I promise I actually did read the manual, even that part ... just not after finding the error.  I'll give the in-dev version a shot as well, it can be my penance for not checking the manual first.