3030's Forum Posts

  • If it's good enough for Aurel, im ready to make the jump Though im on 195 so im likely already seeing most of the benefit..

  • > : Thanks!

    It would be nice to make a version, where the arrow is really at the right position in their right angle. Since both our solutions are a bit off, due just offsetting it in horizontally or vertically rather than radially. (Causing the arrow mostly being off the line between player and target.) Just to make things perfect

    I might take a look, to figure it out. ramones maybe you got an idea?

    Hey man, it's funny because that's actually perfect for me - im not really looking for the position according to the player, im looking for the position towards the edge of the screen.. where maybe in a GTA type situation, you would want the position to the player, this is actually for enemies 'entering the screen' so i actually want to know their exact position they will be entering. In my actual game, the angle itself of the indicator is irrelevant because the angle will always simply be pointing to the edge either up down left or right.

  • small bug in the create/destroy stuff but easy to fix. you'll see it if you just read it line by line.

  • As a way to give back and as a thanks for everyone's help, here's my full enemy indicator code, using multiple enemies in a family marked as 'EdgeTrack' so anything you want tracked, just add it to that family and it should show indicators.

    Features:

    • Tracks multiple instances
    • Indicators Fade out when associated enemies enter the screen
    • Indicators Fade back in when enemies leave the screen.
    • When enemies enter the screen, indicators change to a flashing 'warning' version.
    • Indicators created automatically when a new instance is created
    • Indicators destroyed automatically when its parent enemy is destroyed.

    Hope this helps someone, thank you so much for your help, especially ramones who did that final canvas/layer conversion for me.

  • Here's the LayerToCanvas/CanvasToLayer approach if you want to see that.

    you, my friend are royalty among humans. thank you so much for the help this is exactly what I needed!!!!!

  • MultipleChoice

    Please see this movie for what my actual problem is: http://d.pr/v/1b0eN/4oqF4TZm

  • > SecondDimension ,

    The map rotation problem was something I realized at the end, so I cheated deleting that possibility

    (Since I had two separate layers apparently that is, and I did not have time to realize that.)

    Now I had time to take a look again, and I revise!!

    IT DOES WORK WITH ROTATION, but all objects obviously have to be on that layer (which you want to rotate).

    Well it works with rotation, but it has the same issue as my original version: when the screen is rotated, the arrow does not stay visible when you get too far from the Target... the arrow moves outside of the visible area unless you are actually near the target / the target is on-screen.

  • > SecondDimension ,

    This is a simple way to do it.

    DON'T rotate the layer, on which the player or Arrow or whatever is this way, since the rotation is not centered. It confuses the coordinates.

    Rather rotate everything around the player in the center of the map.

    You can also let the arrow easily disappear, if target "is on-screen", or when the distance (rather of the XY coordinates, as done in the file, not the function dist(), as this would detect a circle, but you have a square Screen) of the halfway point being smaller than your View-Port-edges.

    Hope it helps...

    Hey man, thanks so much for your time on this - Unfortunately rotating the layer is something I have to do. 14 months of development already built around the layers rotating, it would be too time consuming to switch it so everything rotates around the player.

    Also, in regards to the code above, its nice for sure, i like how it smoothly transitions from the object to the screen edge, but yeah without the rotation i just cant use it.

    i was trying to account for the rotation using transform/rotate trigonometry functions but i barely knew what I was doing, so it ended up messed up.

    p = ViewportRight/2

    q = ViewportBottom/2

    (so now p,q is the exact centrepoint of the viewport)

    newx=(x-p)*cos(?)-(y-q)*sin(?)+p

    newy=(x-p)*sin(?)+(y-q)*cos(?)+q

  • spongehammer - Yea been messing with this trying to get it working but cant quite seem to wrap my head around the context. eg. am i clamping the arrows first, then translating it to canvas then dropping it back down on, eg .the hud layer? just cant seem to understand what i need to do exactly haha

    Also worried about performance of doing that layer/canvas translating as someone mentioned it slowed things down for them, but i will probably only have about 20-50 objects on the screen max that are being positioned in this way..

  • spongehammer

    Thank you so much - can you check this updated CAPX?

    Basically if you use the A & D keys, it rotates the layer by 15 degrees each way so you can see how the indicator no longer lines up to the edge of the layout. Im trying to account for the rotation of the layout and reposition it according to where it should be with the angle change, but i cant seem to figure it out properly...

    Do you have any ideas? Thank you a million times over for checking it out..

  • Hmmm i think once i started playing with teh ranges it worked a lot more to what i was after, i toyed with the sensitivity range on the ufo itself and that seems to have helped quite a bit. Thanks for this amazing plugin man, you made my UFO ai so much more sophisticated haha

  • Hey rexrainbow, im trying to use this to make my ufos chase the player but avoid the planets.. (ie go around them better). The thing is it seems I set the properties at Runtime on the planet (the planets are created at runtime) to:

    Source: Yes

    A: 0

    n: 0

    B: Planet.Width*2

    m: 1

    Sensitivity: 300

    Target: No

    But it seems it ignores my settings and go with the default ones assigned to initial object (in the layout).. am I doing something wrong there? Can I assign those properties at runtime?

    Thanks for your great work. You are definitely in the credits as a programmer on Cosmochoria haha

  • should just be

    GlobalVariable = GlobalVariable*1.10

    but the other way around should work.. are you sure your GlobalVariable is a number and not a string?

  • Oh, and SecondDimension

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • spongehammer

    Any chance you still have this example handy? Im trying to do something similar but for an enemy marker. I can get it working no problem as long as my layout isnt rotating, just using clamping to the viewport, but as soon as my layer rotates, the X,Y gets all bungled with the rotation so its no longer accurate. Just curious if this example tackled rotation or how i might be able to do that?

    Huge love...