Hello! I’ve been using GDevelop for a while now, and I have 2 suggestions about new functions/possibilities that could be made. I programmed things with a lot of Variables involved, so my suggestions might make things easier for that kind of games/softwares.
An object name depending on a variable.
It would be handy if the conditions and actions dealing with objects could accept object titles depending on a variable. Currently, if I’m not wrong, such conditions and actions can only accept a specific object, that can be picked in the objects picklist.
Let’s say I have 5 objects named “button.1”, “button.2”, “button.3”, “button.4”, “button.5”. It would be great if I could run a condition / action about them, calling them button[VariableString(n)], and then vary the variable n.
It could allow us to run loops about objects, or make an action on any object depending on a variable.
Maybe is that already possible? (but I’ve never seen that) Or is there a reason why it is not possible…?
I know an object is not a variable, but it could be handy to be able to deal with the object name more freely.
Pick a random value (with weightings)
It would be great to have a random function picking a value among several given values.
Something like :
RandomPick(2;5;8;9;11)
The same function could exist with weightings (a probability between 0 and 1. Either the probabilities sum has to be 1, either the left probability leaves the variable unmodified.)
Something like:
RandomPickWeighted(2,10/100 ; 5,15/100 ; 8,36/100 ; 9,20/100 ; 11,19/100)
I know such random results can be made with the current tools and functions available in Gdevelop, for example :
- set Variable(q) to RandomInRange(1,100)
- if 0<q<11 set Variable(Q) to 2
- if 10<q<26 set Variable(Q) to 5
- if 25<q<62 set Variable(Q) to 8
- if 61<q<82 set Variable(Q) to 9
- if 81<q<101 set Variable(Q) to 11
Nevertheless in some kind of games dealing with a lot of variables, random events, auto-generation, such a random function could be more than useful.
So such a function would make things easier, and the game developer could see things more clearly : RandomPickWeighted(2,10/100 ; 5,15/100 ; 8,36/100 ; 9,20/100 ; 11,19/100)
Let me know what you think