Put attributes / values in order, 1st, 2nd, 3rd, 4th position

dumbstudiosdumbstudios Member Posts: 23
edited July 2012 in Working with GS (Mac)
How you doing guys and gals, I have 4 actors running to a finish line, each one of them is attached to their own separate timers. Once they cross the finish line I get 4 different times, my big question, which i've been trying to figure out for the last 3hrs is, how can I make it so that the results would be sorted out into 1st, 2nd, 3rd, 4th place? based on 1st being the lowest time, and 4th the highest. I'm totally lost here and stuck because from this depends a lot more functions.
Can anybody guide me on this journey?

Thanks in advance

DS

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited July 2012

    @dumbstudios

    Hi, I think there might be a couple of ways to tackle this.

    Here's one way I can think of:

    Make 4 integer game attributes and call them Aplace, Bplace, Cplace and Dplace. Rename your runners to something like A runner, B runner, etc.

    Make another integer att. called TakenPlaces set to 0

    (I'm guessing you're using random for the speed of each of the 4 actors so its different each time).

    In the Rules of each of the 4 actors (here they are for Runner A):

    Rule: When actor collides or overlaps with ---- your finishing line actor
    Change attribute TakenPlaces to TakenPlaces + 1

    Rule:
    Change attribute Aplace to TakenPlaces ---- swapping Aplace for Bplace, etc for the others.

    Hope that gives you something to work on.

    PS Don't forget to reset Aplace, Bplace, Cplace, Dplace and TakenPlaces all back to zero before the next race starts.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • dumbstudiosdumbstudios Member Posts: 23
    @gyroscope Worked flawlessly, thank you so much. Can't believe didn't think of this
Sign In or Register to comment.