Having a callback variable with an index

The callback variables get mixed up when I call several times the same function where they appear. So I’m trying to have the name of the callback variable as a variable, so it can be changed each time the function is run and they don’t mix up.
Like in this example:

I think I understand. You can return a structure variable. Give the function an ID and return a variable with as many children as you need. It could return any values in the provided parameters.

For you or for other readers.
https://wiki.gdevelop.io/gdevelop5/events/async/

I’ve used it as an action. I guess it could be an expression as well. Return 1 value thorgh the expression plus change the parameter variable. I would have to try it on my PC to fully form a concept.

There’s an expression to read the variable and another to set it or you could get a value with 1 parameter and reruen it to the variable setup as another parameter.

My spelling is horrible this am.

I’m still trying to understand the concept and your need. I guess when the value is returned, you could add it to an array. You’d have a list or buffer.

The callback variable is a number here. And even if I could use an array I need to load different fields from different documents.
Even with an action I would have the same problem with callback variable mixing up.

I don’t think I’m understanding the concept. Maybe, I should allow someone more familiar with async.

As I read it, it’s a bit like a wait action. It pauses at the point of the function until the function does something. I don’t know how async values are returned.

What exactly is the async function doing. I think the bigger picture would help me and others understand what you need.

I realized it was bugging even with one function call.

That’s not something I use or understand. I wish you luck.