Maybe I am missing something obvious here, but although I can do it by using multiple arrays, wondering if there is a solution that would let me use a single multidimensional array for this: In flash it is very easy, in construct I can apparently only sort X, Y and Z, In flash I can sort it any way I want, by specific column in Y for example.
Anyway this is what it would look like in Flash using multidimensional arrays:
Create array like this for each team : Array.push({name:teamA, rank:6, score:0, power:6, win:0, dr:0, lose:0, pt:0, gfor:0, gagainst:0, gd:0, posic:0});
In Flash I can sort based on any of those, name, rank, power, score, goals, etc.....
Then with code below do what I need to do. Sort by total points, and if points are equal between teams, sort those by goal differential, so teams with better goal differential come on top. With a single array in Construct 2 simple enough to sort team standings by total points, but not by goal differential because it will not sort points and goal differential values independently ( both stored in Y columns )
for (i = 0; i < 8; i++)
{
Array.posic = 0;
for (j = 0; j < 8; j++)
{
if (Array.pt < Array[j].pt and i != j)
{
Array.posic -= 1;
}
if (Array.pt == Array[j].pt and i != j)
{
if (Array.gfor - Array.gagainst < Array[j].gfor - Array[j].gagainst and i != j)
{
Array.posic -= 1;
}
}
}
}