Rhindon's Forum Posts

  • Forgive me...

    I'm just not getting it. Everything I've attempted so far - including using your solution - just isn't working.

    I tried to open your .capx but it's telling me there's something concerning the poly_pts and it won't load for me.

  • Further update...

    My apologies, unless you haven't looked at my .c3p yet, one thing I didn't clarify about my set up is that I have another object on the minimap (which will be invisible) that all the map icons are pinned to (except for the one representing the player car.

    This object (with said icons) moves along the minimap outline to represent map movement as the car moves.

    SO FAR, since my last update, I've been able to get things to move. NOW my only problem is getting the INITIAL orientation of this object to appear correctly so that the car icon appears in the accurate position relative to the actual player car. Meaning, if the car is actually to the left of a building, the minimap still shows the car icon appearing somewhere...else.

    Here's the current action I have for the updated map icons...

    Set position for Map_BG object:

    X position -> lerp(HUDborderMiniMap.X-HUDborderMiniMap.Width/2,HUDborderMiniMap.X+HUDborderMiniMap.Width/2,1-unlerp(0,LayoutWidth,Car.X))

    Y position -> lerp(HUDborderMiniMap.X-HUDborderMiniMap.Height/2,HUDborderMiniMap.Y+HUDborderMiniMap.Height/2,1-unlerp(0,LayoutWidth,Car.Y))

    The idea here, as you can see, is to take the (un)lerp position of the player car object - with the ranges of the width and height of the layout - and use that fractional value to determine how to place the Map_BG object (which has all the minimap icons pinned to it). Thus making the minimap do what it's supposed to. Unfortunately, the best I've been able to do is to get the map to move appropriately but not show the car icon in the right place (which means the Map_BG object isn't updating accordingly). The link I provided in my original post should take you to the updated save file.

  • Alrighty... So, what you're sharing makes sense, but I think I failed to explain what I'm trying to do clearly.

    Pardon some redundancy...

    The minimap won't show the ENTIRE set of roads and buildings, etc. Just the immediate radius surrounding the player car. So, as the car moves and passes by buildings, the respective icon on the map will show the player car passing by a building. The car icon always dead-center in the map, of course. As mentioned, I'm able to get the building and road icons to appear appropriately on the map, but I'm having trouble figuring out how to get the icons to "move" on their layer (which is parallax 0x0). My efforts to use lerp have failed (kinda...).

    (Not that it matters much towards the problem I'm having, I have the icons set to a blend mode so that they ONLY appear while overlapping the minimap white outline object. Just in case that helps to set the picture as clearly as possible of what I'm attempting to do.)

    Thanks again for your time and patience.

  • I will give that a try. Thank you!

  • R0J0hound - Any suggestions?

  • I'm working on a top-down racing-style game in a sandbox cityscape. No major explanation for the minimap - it works like almost any of its sort if you're familiar with games like Need For Speed: Most Wanted or Spider-Man 2...all of which show a limited surrounding layout of your location.

    And, just like these mini-maps, as you move about, the icon that represents your character stays at the center of the mini-map while the rest of the icons for roads, buildings, etc move accordingly.

    UPDATE: I've gotten the minimap to move around and update accordingly. What does not work is getting the map to appear correctly given the player Car's literal position in the layout.

    I've managed to get the icons to appear in their proper location and size relative to the layout objects they represent.

    But what I cannot get to work properly is to have the icons on the mini-map move relative to how the car moves about the environment. I've checked the debug layout, and it shows the X & Y values for the icons as being waaaaaaay astronomical. Totally out of the limits of the layout.

    Parallax for the mini-map layout is 0x0, of course, but I'm not sure why the mini-map isn't working. Here's what I've got so far... https://www.dropbox.com/s/xt8w2rywggvvo30/The%20Getaway.c3p?dl=1

    Event lines to focus on: 3-6 and 29.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah... And to figure out a fraction of that would be ridiculously time-consuming on my part right now. I don't think I'm ready for all of that. *sighs*

  • I'm working on a game concept which is set amongst a sandbox-style city (think really, really simple 2D Google Maps) where the player must walk or drive from destination to destination to continually "getaway" from his pursuers. There are two styles of AI car mechanics I want to employ:

    1. The cars follow a "casual" course throughout the city. Just about any game set to a cityscape - Legos Avengers, Spider-Man 2, GTA, Need For Speed: Most Wanted, etc, etc, etc - that has NPC cars driving about, turning at intersections, avoiding other cars... Sunday drivers of the best sort.

    2. Enemy AI cars that are actively chasing down the player but pursuing in Car behavior style. This quickly becomes problematic when factoring in things like collisions with Solid-behavior objects and how to get the Car AI to back up when necessary and know when enough is enough to resume the proper course.

    I would and have attempted to use the Pathfinding behavior, but this also quickly defeats the impression of enemies following in Car behavior style. And the enemies still get stuck on Solid objects even then, even when using cell padding.

    I would appreciate any suggestions, alternatives, full-blown solutions that I can use for my own... I'm aware that I'm attempting something well beyond my current skill set and I'm just at a lost.

    Thank you for your help and input.

  • OH MY GOODNESS! You have totally given me great relief! Thank you!

  • .C3P file https://www.dropbox.com/s/xt8w2rywggvvo30/The%20Getaway.c3p?dl=1

    The new Tween behavior recently got added and Ashley is still working on the documentation...

    In the meantime, I was wondering if anyone has had any success in better understanding the nuances of the behavior than I have...

    I'm trying to create a somewhat "dynamic" camera system for a racing game I'm working on.

    The Camera object is pinned to the far end of an object "camera arm" which I've called "Selfie Stick". The Selfie Stick is likewise pinned to the Car object.

    When the Car accelerates, the Selfie Stick extends in length, lerping based on Speed/MaxSpeed of the Car. This begins the set-up of the Camera "leading" ahead of the Car. This part works just fine.

    When the Car turns left or right, the Selfie Stick is to rotate to the Car.Angle +/- 10. Of course, if the Car is not turning, the Selfie Stick "rests" at Car.Angle = 0. This way the Camera also "leads" at angles, too. I want this to be a smooth transition, even if the player quickly alternates between turning left or right or not turning at all.

    I'm trying to use the Tween behavior (assigned to the Selfie Stick) so that it smoothly transitions to the +/-10 value relative to the Car object's angle.

    The problem is when I start turning - even just tap the left/right arrow keys - the Selfie Stick object begins rotating rapidly and will not stop, even after the Car has completely ceased all movement.

    Previous sample projects to test out how the Tween behavior worked resulted in things happening mostly as I thought they should. But I do not understand why the Selfie Stick object overshoots the Car.Angle value and never stops.

    Help, please?

    ========

    EDIT: I did further testing and I discovered something interesting.

    I created a single sprite and set it so that it moves 50 up/down/left/right depending on which keyboard arrow is pressed (event: on pressed). While the sprite is moving its 50 pixels but not yet reached its goal if the key is pressed again in the same direction, it "adds by overlap" (probably not an accurate phrase, but it's the best I can think of to explain it) another 50 pixels to Tween to. The result is that the sprite is now moving faster - or faster for the amount of "overlap".

    This would help explain why my Selfie Stick object begins spinning wildly even after the briefest tap of the left/right arrow keys while turning. For however many ticks passed, that's +/- 10 degrees "overlapping" and so the object continues to Tween until it has finished processing each set of 10. (@Ashley, can you confirm this is more-or-less accurate, please?)

  • Seems I solved my own problem...

    I went ahead and disabled the 8Direction Disable action, Set 8Direction Speed action, and Set angle action.

  • I'm working on a top-down perspective game in which the standard movement is via the 8Direction (8Dir) behavior. Upon pressing the specified "dash button" on the keyboard, the character should briefly dash ahead using the Bullet behavior and then return back to normal movement.

    The Set-Up

    Dash button pressed

    - Stop all momentum from the 8Dir behavior (I found that the momentum was "held over" after re-enabling the behavior when the dash was finished)

    - Enable Bullet behavior and set the Bullet angle of motion to the facing angle of the character

    - Set Bullet speed to 500 because the Bullet behavior deceleration value is -800 (I didn't want a future use of the Bullet behavior to be at 0)

    - Start a self-countdown timer for how long the dash should last

    - Disable 8Dir behavior for the duration of the dash

    When the character timer is up

    - Re-enable 8Dir behavior

    - Set the 8Dir speed to whatever the remaining value of the Bullet behavior speed was (remember, it had a -800 deceleration)

    - Disable the Bullet behavior

    What I'm TRYING to Accomplish

    - Activating the dash should send the character rushing ahead at its given angle.

    - After a 1/4 second, the movement behaviors switch back to normal and the angle of the Bullet motion is set as the character's angle.

    Problem

    When resuming normal 8Dir movement, there is an immediate sudden right "burst" of movement after the Bullet behavior is de-activated.

    I have discovered what I believe the issue to be. Upon re-activating 8Dir, 8Dir's angle of motion value is 0, hence the sudden movement to the right. There are no actions for the behavior to edit this value. I can set the object's angle and its Bullet angle of motion...but not its 8Dir angle of motion.

    https://www.dropbox.com/s/vltqn912290myl5/Sir%20Slash.c3p?dl=1

    I'd appreciate any input on how to resolve this. Thank you!

  • I was not aware of that demo. I'll surely have a look! Thank you for the suggestion.

  • NetOne - Oh man, bugs always bugging ya. Such is the life of a programmer. Heh.

    Sorry for any confusion... I'll try to explain again with more clarity. Bear with me...

    As you see, there are multiple instances of the GhostHunter(Body) objects. (GhostHunter is the visual object that the player will see and GhostHunterBody is intended to be the object that does all the moving about and contains (most of) the behaviors, variables, and other stuff.)

    Taking into account that the "camera" angle (based on how things are drawn and now the actual camera/ScrollTo behavior), the visuals are that of top-down + slightly behind. Much like how Zelda: A Link To The Past was drawn on the SNES. With that visual angle, objects that are higher up on the Y-axis are technically "behind" or "farther away" (from the player's visual reference) than that of objects lower on the Y-axis. Assuming they're all on the same layer (they should be), objects that are "farther away" need to be drawn on the bottom of the layer or at least below objects that are "closer" to the player.

    So when one GhostHunter instance moves down on the Y-axis (closer to the player) they need to be redrawn on the top of the layer when "passing through" other instances of the same GhostHunter object. The current problem most of the time is that it looks as if certain instances on the top of the layer are literally on top of the other instances even though they should be behind them because they're higher up on the Y-axis.

    Further, the problem I'm having with the Z-order action line is that I don't know what the assumed sorting process is. Does it sort ascending or descending? I looked into the manual and couldn't find a clear answer. Is there a way to affect the sorting order? I'm guessing that the variable it's calling upon is used to calculate how it should sort or what it should sort, but again, I'm not finding a clear answer.

    Thanks for your time to help me work this out, too!

  • *sighs* I don't know what's wrong, but even with a family, it's still not working. It occasionally sorts them correctly, but in the end, whichever GhostHunter is on the top of the layer stays on the top... It won't sort to the bottom, or rather below another GhostHunter, when it's at a lower Y-axis value than the others.