Zebbi's Forum Posts

  • Okay, I kinda got it working (looks like it's got some serious racecar drift going on since it's faking the rotation and it has no effect on it's motion) but the last little booboo is it twists at the end of the path. Tried doing some offset checks, but it keeps twisting anyways. Any ideas?

  • Seems like you are almost there..

    You could now add a "is not within angle" condition..

    then add an else event and set the exact angle..

    I'm just not getting this?

  • This is really nice, the fact it's realtime is very useful, maybe it could be modded so if the player has reached the end of the path, the pathfinder still moves around the rotating sprite?

  • As stated before, what you'd need is an event "if within a certain distance of the destinationnode rotate towards the position of detinationnode+1"

    https://www.dropbox.com/s/eytk0omy9wvlt0x/pst.capx?dl=0

    I used this:

    but it never gets to the right angle, even though it tries?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I said I would NOT use it, so why give an example in which it is used?

    So like I said, what you could do is check the distance to the currentdestinationnode (actually there is already an event doing that) and instead of setting the angle directly rotate 1 degree counterclockwise untill the new angle is reached..

    Should be pretty easy to make..

    LittleStain Okay, I've managed to get it rotating with the rotate towards angle of motion, but obviously it only starts rotating when it's changed direction, whereas in order to be as effective as the pathfinding angle rotation, it would need to have a type of 'lookahead' whereby the sprite knows the next sequential direction it will be moving in, and could start rotating when it's within, say, 20 of the destination node. Is this possible using some of the data extracted from the pathfind?

  • I said I would NOT use it, so why give an example in which it is used?

    So like I said, what you could do is check the distance to the currentdestinationnode (actually there is already an event doing that) and instead of setting the angle directly rotate 1 degree counterclockwise untill the new angle is reached..

    Should be pretty easy to make..

    Okay, I wasn't entirely sure if you meant it should be used or not, sorry. Why counterclockwise? What if the "bullet" is going from, say, 90° angle to 0°, wouldn't that be a clockwise rotation?

    I'm trying to figure out how these expressions work, but it's slightly confusing to me how it's been written with distances and destinations, as I said, I'm okay with the basics, but detailed expressions are a bit difficult for me to manage, which is why I put this in the beginner's section, it's really not my strong point yet. Most things I try in C2 that aren't from the context menus tend to not work anyways, I usually forget to wait 0.1 seconds and events cancel each other out, so I'm sorry if I'm slow but I am trying to comprehend how these more advanced (to me) algorithms work.

    As you say, there is the currentdestinationnode check (Turt.Pathfinding.NodeCount-1) but I have no idea how to gradually rotate the bullet when it's a) using a bullet behaviour and b) it's angle seems controlled by variables. I can probably get it if you can hint whereabouts I should put these events/conditions.

  • You should read "How events work" in the manual..

    Sounds like you are dealing with an unreferenced object.

    "On object touched" or "On object clicked" should be enough to reference the object.

    I would assumed that was the condition they were using?

  • I wouldn't use lerp (or anglelerp in this case), but if you want to try, go ahead..

    Maybe you could use rotate counterclockwise while within a certain distance of the node untill the right angle is reached..

    That's what I was thinking, maybe something like [quote:2kftm5zj]anglelerp(Self.Angle,TargetAngle,8*dt)

    but I'm not sure how to use this in a condition with the current system?

  • I don't see any odd reason..

    Pathfinding finds the shortest path, so if you don't close off the direction to the finish it will go directly to it..

    LittleStain perhaps the easier question would be, is it possible to interpolate the angles of rotation? at the moment with the bullet movement, the sprite just jumps to the angle it's going, whereas with pathfinding it smoothly changes the angle. Perhaps with lerp?

  • Zebbi

    To do it without the paster object just make sure the areas on either side of the layout look identical.

    https://dl.dropboxusercontent.com/u/542 ... croll.capx

    Thanks, that's a perfect example!

  • I don't see any odd reason..

    Pathfinding finds the shortest path, so if you don't close off the direction to the finish it will go directly to it..

    I'm going to work with your bullet idea, but I tried working it into using the pathfinding motion (since I liked the little rotations on the corners) but the sprite AI has a little think before it goes around again (kinda cute) whereas a fluid continuation would be better, not sure I can do that though? https://www.dropbox.com/s/sxwl936plk26u ... .capx?dl=0

  • I have 5 objects of same type on the screen. When game is started i would like, when user click on this object to increase it's size. But right now size is increased of all objects of same type. Is there any way to increase size of just that instance of touched object?

    Have you tried adding a "pick" event from System?

  • Sorry, can't open that capx, because it uses magicam-plugin..

    Sorry, forgot about that, here's a new one: https://www.dropbox.com/s/1fjgkpdpnv9o9 ... .capx?dl=0

  • >

    > > Most of the math in that example is to prevent the overlapping..

    > > All you'd need is the part that does the bullet instead of the follow path..

    > >

    > > Like this:

    > > https://dl.dropboxusercontent.com/u/485 ... rcles.capx

    > >

    > This is perfect! Thank you so much, a lot easier to read for those of us who are a little lacking in geo/trigan-ometrical knowledge <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy"> I noticed the pathfinding method was a little shaky when the screen is set to scroll to it, I'll be keen to see if the bullet smooths things out. Is bullet a better behavior to use over, say, the car behavior?

    >

    You are free to try and make this with the car behaviour..

    Tried applying your example to mine and the sprite just tries to go backwards for some odd reason: https://www.dropbox.com/s/tddz3vzcet8ya25/try.capx?dl=0

  • >

    > > The seam is hidden by either carefully placing objects in the same places on either end or using the paster object to copy the other side. It just to make the transition appear seamless.

    > >

    > >

    >

    > Would use paster be essential or could it be done with creative triggering?

    >

    Did you really read the answer?

    Of course I did, I was just clarifying that it could be done without paster, I must have read the or as an and.