Godot Version
` Godot-4
Question
` I recall seeing someone else code it and i don’t remember where. I tried to look for it but couldn’t.
something like this:
var sugar = {"0%","50%","100%"}
and i can use it to compare
if(cup1.sugar == cup2.sugar)
if i write thing like cup1.sugar=“40%” or i write cup1.sugar=“50” (missing%) it will allert me like “there’ no choice named 40%”
Or st like this:
like this:
st st {
POSSIBLE CHOICE ONE
POSSIBLE CHOICE TWO
}
var object.something = POSSIBLECHOICEONE
If I remember correctly, it return the string like in int like this for easier comparation
0% = 0 50% =1 100% = 2
it might give autocorrection so i don’t need to write the rest. or doesn’t show up when i write the number 4. like in Animation.play(“…”) there’re multiple yellow colored words to choose from. example: “run”,“idle”,… if i write “a” there will be nothing showup
for now i need to write this to check manually if i use the wrong string and it’s tiring
func check ():
if sugar!="0%" || sugar!="25%" || sugar!="50%" || sugar!="70%" ||sugar!="100%":
print("there doesn't exist this type"+str(sugar) "recheck your code")
Can you tell me what type, class, func,… it is
Thank you very much