nzso's Recent Forum Activity

  • int('total'/60000) & ":" & zeropad(int('total'/1000)%60 ,2) & "." & zeropad('total'%1000, 3)

    Line 8 was exactly what I was looking to achieve and I truly smiled when I saw how you simplified that down. I made just a few minor adjustments to add an extra zero to the minutes and changed the decimal in front of the milliseconds to a colon.

    zeropad(int('totaltime'/60000),2) & ":" & zeropad(int('totaltime'/1000)%60 ,2) & ":" & zeropad('totaltime'%1000, 3)

    I was truly going about it the wrong way. Thanks ROJOhound for the detailed example! It helped me to also understand how to use "int" and bracket correctly when using math.

  • My concern is how to correctly "display" the milliseconds during the lap process and not so much catching the time when crossing the finish line.

    Also retrieving the milliseconds from the system timer it returns in decimal form with multiple digits. I really want to understand how to correctly put the timer together but man I am confused.

  • Hey folks, back again with something I am stumped on. I am trying to create a visible and accurate lap timer and almost instantly ran into an issue of displaying milliseconds at an accurate rate. I noticed that when you use the "every milliseconds" condition that there is a notice that says "milliseconds wait between triggers". I have tried to build a timer from scratch and don't seem to understand how to accurately get the milliseconds to display in real time.

    I searched the construct wiki for a solution and noticed there was an "object" called "profiler" and the wiki described it as dealing with high resolution timers but there was no info on how to use this object or it's purpose in detail.

    I put together a very quick cap file that shows what I am trying to achieve and I know it is absolutely inaccurate and might even be the hard way of going about building the timer but you can at the least see what I am trying to achieve.

  • You need to create the HUD at the origin of the screen: which is in the upper left corner. Make sure you have the right layer selected when you are adding elements.

    Worked a charm! Many thanks, I should of assumed that.

  • in this case i need to ask for a cap file. i am 100% sure that the culpr- it is something very trivial but i cant name it without looking at the cap.

    I'm not real comfortable sharing my cap file with all the work I have put into it so far. No offense meant in any way of course. I can tell you these points of information though.

    • The layout size is 4200x4200
    • The player controlled car is positioned near the bottom center of the layout at the start of the race.
    • In the Attributes of the car I have ticked "center view on me" which controls the scrolling
    • I have created one text object that shows the lap times and positioned it in the layout so when I launch the game it is right where I would like it to be.
    • I then created the second layer, made sure this layer was on top of the original layer and then dragged the text object onto the layer. After doing this I changed the Scrollxrate & Scrollyrate of the second layer to 0. When launching the game the text object timer is no where to be found.
  • well, on bottom of the right side of the construct UI you see couple of tabs: Project, Animator and Layers. Click Layers.

    You wil propably see one Layer.

    Click that little "File iconwith green triangle" then ensure it is on the top (by clicking on the gray upward triangle icon).

    Then click and hold the sprites and other HUD related elements and drag then "On to" the layer you recently created (literaly - on it) and drop it. From now on the elements you draged will be assigned to be on that layer (you can always do the same with anything and any layer).

    Then click that layer and on the left prosperities tab look for "Scroll Rate X" and "Scroll Rate Y" and set both to 0%.

    and you are preety much done

    This is exactly what I tried to do but it seems after I set the Scroll Rate for x & y to 0 the hud is no longer visable.

  • [quote:7mm9im76] set the scrolling of that layer to 0 x/y

    This is the first time I have played with the layer feature in construct. I am a little confused on what you mean by this. Could you elaborate a little?

  • just keep all the HUD on seperate layer and set the scrolling of that layer to 0 x/y

    Thanks The_Funny_Guy! Back to work!

  • Hello again, I had a quick question concerning positioning hud items when it comes to working with scrolling the screen. I am working on adding a timer, lap count, and position count as hud items. The entire layout size is 4200x4200 and the viewable area size is (at the moment) 800x600.

    I have set the the screen to follow the car when the car is moving but I am having trouble figuring out how to get the parameters of the viewable area and having the hud move when the car moves. I tried to find another example that showed how to accomplish this but was unsuccessful in finding one. Do I need to use the "warp" object? What is the best way to accomplish this? Thanks in advance!

    Oh, bonus question!

    Is there a plugin that helps making working with timers a bit easier? Right now I am building my own timer using the "every X milliseconds" event.

  • No prob. BTW, this just dawned on me now. But if you ever wanted to clean up your code further, you could always put all the aicars in a family and reference the family instead of the individual cars, then you'd only have to write the code once.

    Construct, one heck of a gradual learning process.

    Tell me about it! I haven't yet gotten into families and am unfamiliar with there use in Construct as of this moment. Wish there was a quality help file or manual of sorts.

  • Ok, I admit I am a little confused by this, any chance you could be more specific or share an example of how this might look? When you say "add single waypoint and add a variable to define which one they are." this is what confused me.

    Never mind, I was confused because I noticed that by placing more than one of the same object throughout the layout and renaming one would cause all of them to be renamed to the same thing so I only assumed that if I changed a variable for one then that same variable would change for all of them. My mistake, I didn't realize that you could add a separate variable for each of the same object. Thanks! Works like a charm!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, I admit I am a little confused by this, any chance you could be more specific or share an example of how this might look? When you say "add single waypoint and add a variable to define which one they are." this is what confused me.

nzso's avatar

nzso

Member since 12 Jun, 2011

None one is following nzso yet!

Trophy Case

  • 13-Year Club

Progress

13/44
How to earn trophies