Hi all,
I'm working on an RPG and when the player has an encounter, I want to roll for initiative and set the order for battle. Now I have successfully been able to "roll" initiative for each monster by identifying them and assigning a rondom number from 1-20 to the alt value "initiative_rolled" of each monster.
However, I'm stuck for the next step: how can I set the order between monsters based on this initiative_rolled. I want to set the order from 1,2,3 etc until all monsters (and players) have a turn number. Of course some monsters may have the same initiative rolled, so I need to deal with that as well.
Any suggestions? I tried On each one of "Enemy" loop "order_initiative" AND initiative rolled = 20 -> set Monster "initiative_order" to 1+var_order AND add 1 to var_order , but it's not allowing me to filter this way.
Sorry about the terrible explanation, I'm not a programmer obviously Help very much appreciated, thank you!