Examples for expressions references & some extra info
So here https://wiki.gdevelop.io/gdevelop5/all-features/expressions-reference/
In most cases it just say what it is but does not explain what it is Or worse how it works
For example abs() What is abs?
I know you know but does new user seeing this expression for the 1st time knows? And all such user see is abs() Absolute value
What means absolute? English is not my native language I did not have idea what it means
If it would be like abs() Absolute value
Using abs() on any number will return it without minus - If its negative number For example abs(-20) will return 20 Useful for counting down
If we set variable to -20 and we gonna add 1 to it We will get -20 > -19 > -18
If we use abs(variable) to display it in text object Then we will see 20 > 19 > 18 Which will be also useful for making countdown timers
Stuff like that is needed on this page I could write examples with descriptions for some expressions since i don't understand all of them myself But any user who would see proper description and practical usage would not need additional explanations And it could help deduce other stuff by user on its own
Problem is i have dyslexia and my engrish and my grammar Someone would need to review everything i write
So before i gonna spam here with such examples/descriptions I would want to know would it have any sense Cause i would also want to provide such info for extensions And some other documentations which kinda need it
Indeed, "absolute value" is Math jargon and the description is the same as the name. The description could be changed to "Return the non-negative value by removing the sign. The absolute value of −8 is 8."
@ZeroAlvein Do you have other actions, conditions or expressions in mind that could use more explanations? This way, we can do the changes in one go.
@D8H Sorry i do not check mails so i did not see someone reply here and i was checking for a month if someone did And A LOT For example ToString() ToNumber() There is no warning that if your value is already text and you use to ToString() on it it won't work Same story with ToNumber() if its already a number it won't work That is common confusion with ppl putting ToString() for everything in text objects Less happen with ToNumber() TimeDelta() its description explains nothing IF there was ToString(round(1/TimeDelta())) as example to show fps That is already helping ppl understand what exactly TimeDelta do and how it can be used These are just few examples Documentation literally lacks examples People do not learn from descriptions which require some knowledge to understand it People need examples
Look as simple as it gets RandomInRange(Min value , Max Value)
Self explanatory BUT Showing -4 -3 -2 - 1 0 1 2 3 4 kind of scale Saying more to the left = less and more to the right = more And then showing RandomInRange(-83 , -16) is correct format cause -83 is less than -16 already would help A LOT ppl understand that negative/positive shifts what is considered less/more
Object.Animation::Index() in description of this there could be Object.Sprite() will return current frame Even so its not related it should be there since Object.Sprite() is counter intuitive
Even CursorX() and Y That you can put specify layer Like CursorX("LayerTwo",)
I would say lion share of what is on that site require use case examples and some info why you even want to use it
Best example ToDeg() i can read description i know that it do But why i need it? or when? THAT requires example to show me what can be done with it And then this documentation site with all expressions could teach A LOT more than any1 explaining every single expression to a single user