Hi, i would like to make it so the units that had a higher speed variable would go first instead of being random, i tried using array sort but i get this error
############################################################################################ ERROR in action number 1 of Draw Event for object obj_battles: trying to index a variable which is not an array at gml_Object_obj_battles_Draw_0 (line 10) - var _unitWithCurrentTurn = unitTurnOrder[turn].id ############################################################################################ gml_Object_obj_battles_Draw_0 (line 10)
this is how i tried it:unitTurnOrder = array_sort(units, function(a, b){
return b.speeed - a.speeed;
}) (there's three e's on speed because the text would turn green).
The other feature i would like to add is to choose the actions first and then all the units do their actions. Thanks :)