You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found funny issue
I am sure it is not super priority task but I think it is useful to know
The key is that we cannot use any name as parameters for expression and condition functions (possibly action too, I didnt check it yet)
I created function of expression and condition type with parameter named "Number" and return type "Number". Once I used it I receive error that Number is not function.
The key is that after gdevelop function transpilation we receive js function with parameters named as ones in gdevelop. So we will have parameter Number of number type and later you are trying to use global Number function to process returned value. Here is the issue)
I think it is might be super unobvious for guys who didnt have coding experience.
I see three solutions:
Change parameters naming during transpilation. E.g. Number -> Number / #Number / par_Number and so on or wrap them with object and pass like { Number } (later usage param.Number)
Somehow wrap all global enteties usage. Use it through window variable or wrap with object and pass like context
Make list of reserved names and disallow user to use them with UI warning
Steps to reproduce
Create custom extension
Add function of expression and condition type
Add to it parameter with "Number" name
Make it return Number
In function eventsheet create js code block and add there
Is there an existing issue for this?
Describe the bug
I found funny issue
I am sure it is not super priority task but I think it is useful to know
The key is that we cannot use any name as parameters for expression and condition functions (possibly action too, I didnt check it yet)
I created function of expression and condition type with parameter named "Number" and return type "Number". Once I used it I receive error that
Number is not function
.The key is that after gdevelop function transpilation we receive js function with parameters named as ones in gdevelop. So we will have parameter
Number
of number type and later you are trying to use globalNumber
function to process returned value. Here is the issue)I think it is might be super unobvious for guys who didnt have coding experience.
I see three solutions:
window
variable or wrap with object and pass like contextSteps to reproduce
GDevelop platform
Desktop
GDevelop version
5.3.194
Platform info
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: