Rhindon's Forum Posts

  • This is simply a verification post seeking to ensure I'm not undoing what I'm trying to put together while ALSO trying to save on the demands on the CPU/GPU.

    The goal is that any objects not on screen should be set to invisible and their collision detection properties disabled. That way C3 isn't constantly checking them all the time - because this game is going to have A LOT OF OBJECTS in the layout. And since I have an $800 laptop that still seems to lag or "skip" I'm concerned that lower-end computers compared to mine may fair worse. At any rate, I figured it's a good practice to attempt.

    Question is, I have some enemies that use Pathfinding behavior and seek to avoid several of the objects I do have (or will later have when I added the conditions) set as obstacles..... So will disabling collisions on these objects still be avoided by the enemies with Pathfinding?

  • I had forgotten about this change! Thank you for the reminder!

  • UPDATE: I had forgotten about the change/addition using the rgba expression. Details can be found here in a similar post to my own issue here. link: https://www.construct.net/en/forum/construct-3/how-do-i-8/set-effect-parameter-setcolor-131303

    RESOLVED!!!

    I'm trying to update objects on my HUD to reflect progressive changes in the game objects they represent.

    As the game objects take damage, the respective HUD elements will go from green (to yellow) to red.

    Per the properties bar, the SetColor effect lists the RGB color values as [RRR, GGG, BBB].

    When updating the values on the event sheet(s) via actions, you have to specify which 0-based parameter you want to affect... 0 for red, 1 for green, 2 for blue - each one having its own action line.

    Initially, the values start out as follows:

    RED: 0

    GREEN: 255

    BLUE 0 (and will never be changed)

    I'm using the two following action lines:

    - SetColor: Parameter 0 (red): round((100-Car.Integrity_Body_End))/100*255

    - SetColor: Parameter 1 (green): round(Car.Integrity_Body_End)/100*255

    The instance variable Integrity_Body_End is the strength of that part of the car object, with value 100 being full strength and 0 being destroyed.

    So an undamaged car would basically be 100/100*255...or 255. The color green should yield a green object on the HUD display. Naturally, as the car takes damage, the "100" value will decrease.

    As the green value goes down, the red value should inversely increase (using the difference between the variable value and 100...the difference then divided by 100 and the yielding fraction multiplied by 255.

    Anyway...

    What results is a greyed-out or black object. The starting RGB value for the object is [000,255,000]...green. And yet any attempt to affect this effect turns...heh...well, dark.

    What am I doing wrong?

    Thank you for your help!

  • Thank you, Kyatric!

  • Bump!

  • Why is it not possible to test if a 9-patch object is overlapping or being overlapped by another object? This is creating a difficult work-around process to isolate a specific 9-patch instance based on where it's located in my map.

  • Sorry for all the trouble...but it worked after all, just like you said. I'm not sure where my issue was coming from when I tried it earlier. But it's all working now as I hoped for.

    Thank you for coming to my rescue once again. :)

  • Ashley - I know you're busy, but do you have a moment to look over this?

  • I hope this offers more clarity.

    Like I mentioned, the map moves in-sync with the movement of the player car, but it's "off center" from the actual location of the car.

    For instance, if the player car is to the bottom left of a building, the minimap shows the car is several units north of the building.

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.