User Tag List

Results 1 to 7 of 7

Thread: Putting a counter value into a string?

  1. #1
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Putting a counter value into a string?

    Is there any way to make a string display the numbers of a counter?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,367
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    Put the value inside str$() to parse it.

    Like this:
    str$(value("Counter 1"))

  3. #3
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Ah thanks popcorn However I need to change it a bit more, I am using two counters for my timer in my application. One is a 00.00 counter for seconds like 13.45, then when it goes over to 1 minute (60.00) I add 1 to another counter for the minutes and reset the other one again. So in the end of my game the first counter may be 06 (6minutes), and the other counter may stop at 35.52 (35 seconds +). Together the counters will look like they are displaying 06.35.52

    So I need to transfer this to the string somehow. I was thinking if it was possible to insert the first counters value first, and then the other counter value after in the string.
    The problem now is when I try for one of the strings and it is for example 04.36 I get 4.357 in the string

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Ok i managed to get everything right in the string by doing this: Str$(value( "TimeCounter" ))+"."+Str$(value( "TimeCounter 2" ))

    It first displays the first counter then a "." then the second counter that is made up of a 00.00 number. So the final in the string is something like 03.34.54
    The problem now is that I try to have this as a score to upload to highscores from jeffs simple highscore example. But the score wont upload if I dont remove the dots before i press the upload button :/

    Is it because it does not recognize this as a whole number? Which may be a problem when comparing the values of the scores to sort in the highscores to?..

  5. #5
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Well yeah, because "03.34.54" is not a valid number in the first place. You can't expect MMF to understand your made up math logic. :P I'm not sure you can't use a single decimal point... but I'm positive you can't use two. lol

    Since all of your scores are formatted like ##.##.## couldn't you remove the decimals and just send the highscores like "033454", and once you retrieve them, you could reformat them back as "03.34.54" by inserting the decimal points back in?

  6. #6
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Konidias View Post
    Well yeah, because "03.34.54" is not a valid number in the first place. You can't expect MMF to understand your made up math logic. :P I'm not sure you can't use a single decimal point... but I'm positive you can't use two. lol

    Since all of your scores are formatted like ##.##.## couldn't you remove the decimals and just send the highscores like "033454", and once you retrieve them, you could reformat them back as "03.34.54" by inserting the decimal points back in?
    Ok that sounds logical :P Yes that sounds like something that could work if I knew how to do it :/ It sounds like what I am trying to do in this thread if you could take a look at it please? http://community.clickteam.com/showthread.php?t=71106

  7. #7
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Ok I have now got out the numbers in one row, but how do I put the two decimal points in between the number? The event that retrieves the numer I believe is: Set alterable string: listGetAt$( "String Parser", 2)

Similar Threads

  1. Counter to string
    By JDWB in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 26th December 2011, 12:18 AM
  2. Help with putting on web
    By evilsavage in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 6th December 2009, 01:15 AM
  3. counter value to string (tricky)
    By the_raven in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 3rd April 2009, 09:00 AM
  4. Storing a counter value on a string
    By Snakesoft in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 28th September 2007, 08:38 AM

Posting Permissions

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