User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 17

Thread: How can I track who crossed the finish line first?

  1. #1
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export Module
    Emerson3's Avatar
    Join Date
    Apr 2014
    Location
    Lafayette, Louisiana
    Posts
    715
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Question How can I track who crossed the finish line first?

    Hey Clickteam,

    I have a racing level almost completed. The opponent cars drive around the track via AI. I have four separate counters that track laps for the drivers when they cross the finish line. How can I program the first winner, then the second, third, and finally last? The race is 3 laps long. Thanks Clickers!

  2. #2
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)

    Join Date
    Jun 2014
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you could add another counter (or alterable value) for each car that counts the amount of seconds that each car is driving for. As each car overlaps the finish line after 3 laps compare the counters, the lowest number of seconds is the winner, then work out the 2nd, 3rd position ect.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    another quick idea,
    you could add each car to the same qualifier:

    then on (qualifier) crosses finish line ---> add string "car_name" (this may be saved in an alt.string of the car) to a list object

    in this way, since each row will be added in sequence,
    you'll have the cars automatically sorted on the list object one by one as they cross the finish line

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,716
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Take a look at the "Fast Car" example on my website.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  5. #5
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export Module
    Emerson3's Avatar
    Join Date
    Apr 2014
    Location
    Lafayette, Louisiana
    Posts
    715
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Schrodinger,

    That's a neat idea. I'm going to set that scenario right now. Let's say the cars are sorted in the list object as they cross the finish line and the player finishes 2nd, is there a way I can compare the line item of the list to the placement of the player in the event editor? Also, how could I carry over the placements of the list to a second frame to present the winner of the race?

  6. #6
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export Module
    Emerson3's Avatar
    Join Date
    Apr 2014
    Location
    Lafayette, Louisiana
    Posts
    715
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Schro,

    Another question. On the list object, do I just use "Add Line?" Also, how can I test if its listing in order? Thanks!

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Emerson3 View Post
    Schrodinger,
    Let's say the cars are sorted in the list object as they cross the finish line and the player finishes 2nd, is there a way I can compare the line item of the list to the placement of the player in the event editor?
    Yes, each line in the list object has an "id", that is, it's own line number from first to last.
    If you tick "1-based-index" (I think it's ticked by default) in the object properties, first line will be 1, and so on.
    So, say your CAR3 arrives 1, and CAR4 second..
    you'll have a list object storing values like this:

    ID CAR_NAME
    (1) CAR3
    (2) CAR4
    (3) CAR2
    (4) CAR5

    So in the event editor you can retrieve placement for each car
    because line number is paired to the text stored for that line number,
    depending on what you want to do with this data there can be many ways to retrieve and use these informations.


    Quote Originally Posted by Emerson3 View Post
    Also, how could I carry over the placements of the list to a second frame to present the winner of the race?
    You could setup many ways, just a bunch of ideas:
    1) loop the list and set global string number (IDline) to car Name, so you'll have each global string assigned the car placement in ascending order
    2) save the list to a .txt file and then re-load it in the next frame (that's all easily doable with list object actions)
    3) append on loop each list number/name to a single global string with delimiters, and then parse it on next frame with string tokenizer/string parser
    (i.e. above positioning could look in a single string like: 1@CAR3|2@CAR4|3@CAR2|4@CAR5
    then with string parser you could set 2 loops, one nested in the other, first with delimiter "|", nested with delimiter "@"
    if you like this way I can setup some quick example)

  8. #8
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export Module
    Emerson3's Avatar
    Join Date
    Apr 2014
    Location
    Lafayette, Louisiana
    Posts
    715
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hey Schrodinger,

    Thank you for the detailed response! I'm at work right now so I'm asking this for when I get home. What's the formula to add the names to the list object? Is it add line? Also, is there a tutorial that breaks down all the options in the list object? I don't understand how so many users know how to use the list object so well. I want to master it so I don't have to always ask questions and to help others like me!

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    Yes, add line for adding a "row" in your list

    I don't know about good tutorials,
    but the help file embedded in fusion (list object properties - "about" tab - "help")
    provides the most useful informations (you'll mainly need "actions" and "expressions" subchapters)

    It's very powerful and useful in lots of ways,
    I use lists all time for debugging
    couldn't live without (well... more or less)

    If any doubt have no problem asking

  10. #10
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Perry's Avatar
    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,323
    Mentioned
    44 Post(s)
    Tagged
    0 Thread(s)
    I really recommend reading the Help file, and/or watch 1 of the 100's tutorials on You tube.
    That's where I gained most of my knowledge.
    I started over a year ago with no knowledge what so ever, and now I am doing pretty good in Fusion.
    A lot of trial and error is the only way to master the code and tricks you can do.
    Combining Examples and solutions together to 1 program, doesn't make you a good programmer. If you run into an issue later on, you will have
    no clue what to look for.

    I am not trying to be harsh, but asking for full games, will bite you in the a... later on, if you need to make changes.

    Of course I could be completely wrong as well, we're only trying to help

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Overlaying a track
    By Kalis in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 19th September 2011, 11:04 AM
  2. How to Arc Track?
    By PandaExplosion in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 26th November 2010, 12:36 PM
  3. How to finish nearly any game....
    By Jacob in forum Articles
    Replies: 29
    Last Post: 22nd January 2010, 04:18 PM
  4. Moving along a track help
    By Atherton in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 30th December 2009, 02:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •