For each (ordered), multiple criteria

New releases and general discussions.

Post » Sun Oct 19, 2008 7:12 am

Hey, this request relates to the problem i've been having with the Z layering with my pseudo Z axis bizzo.
If there's already a way of doing this please ignore (and then tell me how to do it! :) )
So like if it was a database you could sort by say, age THEN by last name.
It would sort the people ordered by age and for each age they would be listed alphabetically.

So is it possible to do the same thing with the 'for each (ordered)' event? Cause I'm sure that would completely fix my problem :D

On a side note, what do commas do in the expressions? because adding a comma in the for each (ordered)'s expression thing then followed by some other critera doesn't come up as in incorrect expression, except it doesn't seem to change anything :(

Anyways construct rocks!
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Sun Oct 19, 2008 10:14 am

Okay I dont know whats going on with the commas thing, but as for the 'for each ordered' you just need to use a little maths. For each ordered will order the objects in ascending or decending order, so if you want to sort some objects by their age, and then by another value such as health, then you would do:

Player.Health + Player.Age * 1000

Or something like that, the value at the end being the highest possible value that health could be.

However, in the case of 'last name' i'm not sure, being you want to obtain some kind of alphabetical comparison, and I dont know how to do that :/
B
4
S
2
G
5
Posts: 641
Reputation: 3,011

Post » Sun Oct 19, 2008 11:39 am

I was doing something similar to that method, it didn't -exactly- work as intended, but i don't need any last name business, that was just an example to illustrate, what i need it for is that layering problem i have a thread about in the help forum
It's quite the halting setback :(
B
3
S
2
G
5
Posts: 351
Reputation: 2,377


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 2 guests