For each (ordered), multiple criteria

This forum is currently in read-only mode.
  • 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

    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!

  • 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 :/

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)