Describe the bug
So, in my game, i have an AI which chooses the best option against you in Rock Paper Scissors but when i use [Text set to ToString(Variable(Picked))] it just shows 0. Also, yes, picked is a Text variable but it wants me to do ToString or it wont work. Even just straight up changing the text doesn’t even work. [SOLVED]
Now, my problem is that when i made some other code which changes the text when another condition is met, it works but after it just breaks all other code except the text changing just to scissors and only the buttons work. Even when i started a new preview it didn’t work, but when i did a second one it finally fixed. [Main problem still not fixed after].
Share the complete GDevelop project showing the bug
In the most recent versions, you can use just the variable name without Variable() and VariableString()
This is trying to get a string but Variable() attempts to get the variable as a number. If the variable contains a string then instead of crashing it changes the value to 0.
If you’re using a newer version, you should be able to remove the old syntax and just use Text = Picked
Using the old syntax it would be VariableString() instead of Variable() if the variable is a string.
Actually i just discovered some thing else and i think its a bug.
So, i just made an advanced AI for my Bob, but when it does it once it just breaks the game, like the code doesn’t work at all except for bob just always choosing scissors and buttons working.
From the snippet, I can’t really understand your process. Can you explain it further? Maybe more of the code needs to be shown.
Since, you’re using basic variable events, it’s unlikely to be a bug with the app. I would check the debugger to see what the value of the main variables are.
You could also add the values to the debugger output or add a text object and set it to the variable’s value. I like to use a text object then I can always see the value without using the debugger.
Maybe Learning isn’t the right value.
If the choices are equal this doesn’t check the learning value.
Also i’m confused. When i used debugger it worked just fine and it fixed everything even onto a non debugger preview until after i did the advanced AI thing and clicked scissors, it didn’t work. so yeah. (Same problem i said on the topic)