nzso's Forum Posts

  • 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.

  • 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.

    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!

  • 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.

  • First I can tell you that having Always is redundant when it's surrounded by other conditions. Secondly I'd recommend making a single waypoint object and giving them each a value dictating which one they are.

    Third, make it so when the waypoint's value equals the car, that a waypoint should be added to it.

    Finally, make it so when the car overlaps a point it sets the car's value to it's value+1

    I think that should do it.

    EDIT: Oh, and if car's value=31, set to 1

    So if I set Always (Every Tick) and then add sub events to it then those events are redundant? If so, that is good to know. Your solution is interesting. I will sit down and try and implement it when I get a chance. Thanks Yarfapet, you saved me a lot of time!

  • I am currently working with the RTS pathfinding behavior to try and accomplish a racing line to direct the AI around the tracks of a TD Racer I am working on. I have set up more than 30 points using individual sprites around the track to represent the path and am directing the ai to move from point to point determined by a private variable. The event sheet is getting way out of hand considering I am going to attempt to implement 22 ai opponents. I am thinking before I get to ahead of myself that I might want to think about making this met hod a bit simpler.

    My event sheet is looking something like what you see below.

    Timer is equal to 4000 - aicar01 set 'point1' to 1

    Always(Every Tick)

    +aicar01: Value 'point1' equal to 1 - add waypoint at point1

    - move to point1

    Always(Every Tick)

    +aicar01: Value 'point1' equal to 2 - add waypoint at point2

    - move to point2

    Always(Every Tick)

    +aicar01: Value 'point1' equal to 3 - add waypoint at point3

    - move to point3

    etc...etc...etc... until the ai car equals point 30 and then loops

    to change the value I have set it to change when you overlap each point as to create a loop

    so it looks like this.

    aicar01 overlaps point1 - set point1 to 2

    aicar01 overlaps point2 - set point1 to 3

    aicar01 overlaps point3 - set point1 to 4

    etc...etc...etc...

    As you can see this process becomes very repetitive when having to create each cars pathfinding and I would really like to simplify this. Any suggestions?

  • "On collision", and "is overlapping" need to be continuous just like always.

    In other words that condition needs to be checked every tick, start of layout just wont do.

    Thanks newt! I thought this might be the case but I kept thinking there must be a better way than to add all those collision checks to an every tick event. Much appreciated.

  • After spending some time playing around with Construct over the past few weeks I am trying to get a better understanding of how to correctly work with Collision Detection when using the various behaviors. One thing I noticed right away is , for example, if you applied car movement to a sprite and set various other sprites throughout the layout that where checked "solid" the car movement behavior handles the collision detection. This is also true for other behaviors that I had the time to play with.

    The custom movement behavior however does not handle collision detection, as I would imagine it wouldn't, but I am confused on how to "correctly" work with collision detection when using the custom movement behavior. I have done a few tests with "On collision with another object", I have set various collision modes with the "On start of layer" event and ran a few other tests but I am still getting faulty collision detection. What I mean by "faulty" is I, for example, I created one square sprite in the middle of the layout along with another sprite that I created a car movement system for with the custom movement behavior. I then used the "On collision with another object" event followed with the "Bounce" action. I noticed that half the time when coming in contact with the square obstacle I would bounce off and the other half I would drive right through with a quick speed decrease as if the collision detection caught and then failed.

    What I would really like to know is how to "correctly" work with collision detection when using the custom movement behavior. Any help is much appreciated. Thanks in advance!

  • I went ahead and took some of your advice. I had a chance to sit down last night and play with events. I did notice for some reason whenever using an "else" event along with the "on bounce" event the action(s) for the "else" event were not firing correctly. Using separate "on bounce" events along with another condition seemed to work fine. I also worked out the reverse issue by using an inverted key press event.

    Since I had some extra time last night I put together a small example of what I ended up with so anyone else that seems frustrated with the bounce effect within the "car movement" behavior can have a look at one of the possible solutions. The only thing that is missing from the example is if you let off the gas and then are hit by the ai car, you will come to a complete stop but this could easily be added. Enjoy folks and thanks for the help tulamide!

    Bounce Solution

    http://www.mediafire.com/?4564i6b96dylaga

  • Yes, that's why I said, that it only makes sense against other cars

    It is just a start, you would have to further split the events by adding sub-events, to catch all possible situations, e.g.

    + car's speed is negative

    -> set a variable to -1

    + else

    -> set a variable to 1

    + on bounce

    ++ colliding with another car

    --> Set speed as mentioned

    ++ else

    +++ variable is -1

    ---> do what is needed if the car hits anything but a car, while driving backward

    +++ else

    ---> do what is needed if the car hits anything but a car, while driving forward

    It should be doable. But, of course, you can always try to do it with custom behavior. It's just, that you don't need to completely redo the car behavior, just those on bounce situations, and therefore events are the easier solution with less overhead.

    I think I have decided to go the custom behavior route as I have already gotten the feel that I was looking for with the player vehicle and it would allow me to be able to customize more later if I run into any other snags. Your awesome tulamide, thanks for the help!