AnD4D's Recent Forum Activity

  • Probably not the most elegant, but I've fixed with by adding a second event.

    1) right("00"&(int(milliseconds / 60000) % 60),2) & ":" & right("00"&(int(milliseconds / 1000) % 60),2) & ":" & (milliseconds % 1000)

    2) left(CurrentTime.text,9)

    This allows the code to be shown correctly, but I'm sure there's an easier way from within point 1).

    Any ideas?

  • Ahh, that seems to be a lot closer. I'm trying to have it display as 00:00:00, and have tweaked the code enough to show the first two sections correctly, but I'm falling down at the millisecond section which is either showing the full range of numbers, which is daft looking, or the right length but not showing the first 3 digits of the milliseconds:

    right("00"&(int(milliseconds / 60000) % 60),2) & ":" & right("00"&(int(milliseconds / 1000) % 60),2) & ":" & left(right("000"&(milliseconds % 1000),3),3)

  • Hi R0j0hound,

    Thank you for your reply. I'm not able to get that working I'm afraid.

    The code you have given me shows the timer very strangely. When it reaches 61 seconds, the other sections of the timer does not change, and it happily counts up to over 100 without the other seconds being added:

    E.G: 0:0:101.56789

    Do you know what I'm missing? At the moment I have:

    Add dt to timer

    Set t to timer%1000

    Set text to (int(t / 60000) % 60) & ":" & (int(t / 1000) % 60) & ":" & (t % 1000)

    This gives me the strange series of numbers.

  • :( That's one of the problems with beta... I can't open the example files from stable.

    Thanks for your help! I've tried to recreate what you've described, but it doesn't seem to be working, so I've installed r99 on my laptop.

    Never heard of zeropad, but this is giving exactly the same result that I currently have but with 3 milliseconds being shown rather than just 2. Judging from this, if I wanted to store the time as a best time, I would need to save all 3 things like I'm doing now (Mins/Secs/Mills)...

    Say for example I just have a random number of milliseconds. 12345678. Is there a formula which will allow me to convert this into minutes, seconds and milliseconds. This way, I only need to save the milliseconds for each level.

    My level works perfectly now, but it's untidy and I forsee it being hard to manage. It's around 24 events long, but I think I can get it lower than 10 with this other method.

  • Hi R0j0hound,

    Thank you for your reply. I'm not able to get that working I'm afraid. I currently have the code:

    Add dt to Timer

    Set minutes to floor(timer/60)

    Set seconds to floor(timer)%60

    Set milliseconds to timer%1000

    Set TimeScore text to:

    right("00"&minutes,2)&" : "&right("00"&seconds,2)&" : "&left(right("000"&float(milliseconds),3),2)

    I then convert these to milliseconds using:

    CurrentTimeVar = Milliseconds+(seconds/1000)+(Minutes/60000)

    However, this displays the milliseconds as 0.0000 and 1 second shows at 1.0000.

    The code you have given me shows the timer very strangely. When it reaches 61 seconds, the other sections of the timer does not change, and it happily counts up to over 100 without the other seconds being added:

    E.G: 0:0:101.56789

    At the moment it's being used for a best time, so I'm having to store the min, sec, and mil data. It would be a lot better if I just saved the mil and converted it to 00:00:00.

    Kind regards.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have a timer set up which displays minutes:seconds:milliseconds. Each kind is its own variable. It's displaying it as a text box, and so I can not use it to compare best times, etc.

    I have a formula which converts all the variables into milliseconds, but am wondering if there's a way to split them back up into minutes, seconds and milliseconds.

    Or if there's a simple way to provide times and best times. It's turning into a real mind-bender.

  • Managed 33 seconds :) LOL! Scratch that... 54 seconds... Got killed by a missile. Slightly unusual :)

    Physics seems quite floaty. I'd try increasing gravity a little bit. Maybe let the penguin rotate so it's sliding down ramps, etc.

  • Thanks for that! I may have explained incorrectly though. I would say for example I would like 2 different layouts to appear on the same screen. Is that possible? Player 1 and player 2 at different points in a level for example, split screen?

  • What about round(random(1-8))?

    Think something's a little off that. Should I use round or float? Hmm...

    Also, do you need the "elses"?

  • Hey guys,

    Just having a think. Say for example I want to create a top down rpg... I then want to have a battle like pokemon or final fantasy. Effectively that's 2 different styles of games in 1. What is the best way to transition between the two modes. I can't just jump to the level, because I'd want the character to remain in the same place. Is it possible to have a separate layout on top of another layout, or do I have to just store every single aspect of the character's position, as well as every enemy, etc? Seems like a lot of information to store just to cut to a mini battle, or detailed menu screen.

  • What if you try "rotate towards" rather than "set", and set the degrees very high. Does that work?

  • Ooh, I'd like to know this too. Haven't come to this part in the program yet, but it's always good to know.

AnD4D's avatar

AnD4D

Member since 4 Nov, 2011

Twitter
AnD4D has 3 followers

Connect with AnD4D

Trophy Case

  • 13-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies