[solved] Error: attempt to yield across ...

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
spir
Citizen
Posts: 76
Joined: Wed Oct 17, 2012 1:12 pm

[solved] Error: attempt to yield across ...

Post by spir »

Is it at all possible to use coroutines with Löve? (I was trying a coooool way to manage processes / sequences of actions that still need to be controlled by events, without loads of state everywhere). I cannot succeed in running (or rather come back from) even the simplest co. I need to know whether it is possible to unblock my debugging mind.

Thank you,
denis
Last edited by spir on Sun Nov 18, 2012 11:59 pm, edited 1 time in total.
... la vita e estrany ...
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Error: attempt to yield across metamethod/C-call boundar

Post by bartbes »

Well, the error basically says what you're doing wrong, you're trying to yield from within a function called from c++ (a physics callback?) or from within a metamethod (like __index).
spir
Citizen
Posts: 76
Joined: Wed Oct 17, 2012 1:12 pm

Re: Error: attempt to yield across metamethod/C-call boundar

Post by spir »

bartbes wrote:Well, the error basically says what you're doing wrong, you're trying to yield from within a function called from c++ (a physics callback?) or from within a metamethod (like __index).
Right, but isn't everything called from C when I use Löve? The yielding func in question does about nothing (i reduced the error case) and is just called by love.update. But ultimately it is indeed called by the c/++ framework behind the scene, what do you think? That's why I asked whether it is at all possible to "coroutine" and use Löve.

Denis
... la vita e estrany ...
spir
Citizen
Posts: 76
Joined: Wed Oct 17, 2012 1:12 pm

Re: Error: attempt to yield across metamethod/C-call boundar

Post by spir »

bartbes wrote:Well, the error basically says what you're doing wrong, you're trying to yield from within a function called from c++ (a physics callback?) or from within a metamethod (like __index).
Found my error, was a wrong usage of the coroutine. Thank you for the help,
Denis
... la vita e estrany ...
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Error: attempt to yield across metamethod/C-call boundar

Post by bartbes »

spir wrote: Right, but isn't everything called from C when I use Löve?
Specifically, you need to yield across boundaries, meaning from lua->c->lua, which barely ever happens in love.
Post Reply

Who is online

Users browsing this forum: Amazon [Bot], Google [Bot] and 10 guests