I have an asynchronous function with a callback. The callback sets eventsFunctionContext.returnValue from my expresion to what I want, but it takes too long and when I try to get the expressions, it returns undefined because the callback didn’t execute already. Is there a way to make gdevelop wait for that callback to execute?
I don’t js, but isn’t that the whole point of asynchronous operations, not waiting for completion?
Anyway, when you pick an asynchronous action in GD, there’s always a variable along with it to check for “ok”/“error” status. Can’t you use this status variable as condition? Don’t ask me for js syntax though.
If you look at the source code of one of these async actions, you might see how those status variables are handled… I suppose.
Yes it is, but Gdevelop think it’s already complete when it’s not. I search a way to tell gdevelop when it is completed and when it’s not.
Example: Like I posted originally, I call the function and the tell gdevelop that it’s not complete, and when the callback is executed, it tells gdevelop that it is. (The attribute doesn’t exist it’s just an example of what I’m searching).