GMS 2.3+ How do I choose value from the list?

Nidoking

Member
choose

The choose function does not take an array or list as an argument. If you try to do that, it will choose the only thing you gave it to choose from, the array or list. You need to specify all of the entries in the list or array individually as arguments.

GML:
choose(ItemQuality[0], ItemQuality[1], ItemQuality[2])
Or, better yet, use irandom to get a random index and then just look at that element of the array.
 
choose

The choose function does not take an array or list as an argument. If you try to do that, it will choose the only thing you gave it to choose from, the array or list. You need to specify all of the entries in the list or array individually as arguments.

GML:
choose(ItemQuality[0], ItemQuality[1], ItemQuality[2])
Or, better yet, use irandom to get a random index and then just look at that element of the array.
Thanks
 
Top