Sort Objects in Array Based on Variable

Get help using Construct 2

Post » Tue Sep 20, 2016 5:47 pm

I'm using this for a turn-based strategy game where each combatant will have a randomized "Speed" stat, like Double Battles in Pokemon. I need for the order of actions to start at the fastest combatant and end with the slowest one.

The issue I'm having is that I want to be able to have several of the same type of enemy sometimes, but with each one having different Speed stats.

I need to find a way to pick each combatant (most likely through UID) and put their individual Speed into the Array so the data can be sorted and have the actions go in the right order.

for some visual clarity: https://www.dropbox.com/s/x9f7ss91i4nbz2n/SpeedArray.jpg?dl=0
B
7
S
1
Posts: 20
Reputation: 585

Post » Tue Sep 20, 2016 5:56 pm

You can use "For each (ordered)" with the Speed as the key to get the order.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494


Return to How do I....?

Who is online

Users browsing this forum: richcoz81 and 41 guests