Structure Variable as parameter in a function


#1

Hi, I’m a recent user of GDevelop (about 2 months)
I need to pass an array of data to a function as parameter.
I know that arrays do not exist in GDevelop, but you can replace it with structure variable.
The problem is It doesn’t seem possible to use a scene structure variable as parameter.

Maybe there is a possible workaround, using object structure variable. The problem is that dynamical acces seems not working for objects (or am I wrong?).

Thanks in advance for any help


#2

AFAIK If you want to use variables in a function you need either to use JavaScript or Object variables from an object passed. Normal variables are the same as a structures.


#3

you can use normal variable in a function, I’ve already done it with
GetArgumentAsNumber and GetArgumentAsString


#4

Then there is no problem?


#5

The problem is I need structure variable as parameter, not number or string variable


#6

They are the same. If you cannpass one you can pass the other


#7

I think you pass bypass this limitation if you convert the variables structure into string.

Or if you use an object you can use the object for define the structure variable on it and pass it throught the function.