If i remember correctly you cannot convert + - * / from string to text to number
So you would need to use text input object and have like few of them with and then being able to set up any equation would still be problematic
i want to type like: y=ax+c. so can maybe someone can enter numbers for the parameters “a” and “c” and than the function would be created. same for a parbaula. we would have y=ax^2+bx+c.
if the problem is only the imput we could manage. but can I use math function to create objects at all? can I describe a shape of a circle with it’s equation? (x-a)^2+(y-b)^2=r^2?
Only method i know would be
User have fields in which he can input values
NOW issue is between them either there would need to be PRE DEFINED modification sings + - * /
Or you you would make it like puzzle where you can drag and drop them between values
Cause you can convert 12 as text to number
But you cannot convert 6 + 6 as text to number cause + will not be converted
Either you would JS for it
OR make pre defined events for each secenario
Or lock user in using JUST ONE equation
Or few
Cause in events you would need to do it like
If string DO NOT CONTAIN * then
Var1 + Var
If string contain * then
Var1 * var2 + var3 + var4
And so go on
You would need to make tons of events for many many formulas
I mean you could make a parser to get a formula from the text. Gdevelop has the expressions StrAt(), StrLength(), StrFind() and toNumber() which is enough building blocks to do it.
A parser would basically go through all the characters in some text and extract tokens from it. In your case: numbers, parenthesis, operators ±*/^, and single letter variables. Typically you’d have it skip spaces too.
After that, you’d convert the list of tokens to a list of steps to apply the operators. An algorithm you can look up is the shutting yard algorithm. Although other approaches useful for equations include Pratt parsers or recursive decent parsers. However, this all may be a bit much for a beginner, but gotta start somewhere. There are also JavaScript libraries that can evaluate text expressions that hide all the complexity.
A simple way to get your feet wet with the concept is to make a simple parser to evaluate strings with single digit numbers separated with +*.
I’m only skimming the surface here. But let’s say you get a parser working where you extract a formula and can get a value after plugging in values for the variables. To do the motion you’d just gradually change x and calculate y from the equation. To do the circle in that other way you described would need a way to algebraically solve for y, but that wouldn’t be great for motion and would only get half the circle.
Maybe if the formula could be converted from the y=x form to a x=t, y=t form. Not sure that’s trivially to do automatically but letting the user set an equation for x and y might be better.
Just some ideas and thoughts. I personally have found gdevelop too tedious to use, but there is nothing stopping someone from doing stuff like I described.