[Behavior]PathFinder

0 favourites
  • HPA97: You need the pathfinder behavior that is available in the first post.

    And here check how to install plugins and behaviors (the pathfinder needs to be copied in the exporters\html5\behavior folder).

  • Thank you Kyatric ;)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi Kyatric,

    I just started using C2 and i think this is a great plugin! I only have one question that i can't seem to figure out if you can help. The player's movement to follow the path seems to be limited to the size of the project "Window Size" not the layout size. I have a layout background that is double the size of the project's window size and if the background has scrolled past the window size, and i click, the player will not move to that location. They seem to "hit" and edge and start over where the window size edge was. Is there a way to set the PF board rows and columns manually? Or am i doing something wrong that is causing this? Thx!

  • Just to follow up, i put a JS alert in the plugin runtime.js to test and i saw that the "this.support = this.runtime.running_layout;" code is getting the correct layout width and height. The problem is the pathfinder does not seem to work on the entire layout, only the original window size from the project settings. The proj window size is 1024x1024, and the layout size is 3616x3616. If i click outside the 1024 area on the layout, the pathfinder will not recognize. If you have time to take a look, thx

  • jerniganj: Well, at the time of coding, the plugin was using the whole layout.

    Maybe something has changed in the insides of C2 (I don't really keep this plugin up to date), maybe you're doing something wrong.

    Unfortunately without studying your capx I can't guess and give an answer there.

    Post it in this thread and I (or some other members) will have a look at it.

  • Thanks Kyatric! I have posted my capx here: dl.dropbox.com/u/126021636/mars_v1.capx

    i set the window size to 1000x700, and the layout size is 3616x3616 (divisible by 32). There are only 2 main things going on in the capx. One is the click once on screen to move player to that location, the second is to click and drag to scroll around the map.

    My only problem is that when i drag the background past the window size and click, the player will not move. If i click anywhere inside the 1000x700 area, the player does move. Thanks if you or anyone can figure out what happening!

  • Thanks Kyatric! I have posted my capx here: dl.dropbox.com/u/126021636/mars_v1.capx

    i set the window size to 1000x700, and the layout size is 3616x3616 (divisible by 32). There are only 2 main things going on in the capx. One is the click once on screen to move player to that location, the second is to click and drag to scroll around the map.

    My only problem is that when i drag the background past the window size and click, the player will not move. If i click anywhere inside the 1000x700 area, the player does move. Thanks if you or anyone can figure out what happening!

    I was able to figure it out! Very sorry, after posting this i looked at the code i was using from the example capx and realized that there was a limitation comparison set for Mouse.Y < WindowHeight and Mouse.X < WindowWidth. I just changed those to LayoutHeight & LayoutWidth and all set! Still learning. thanks for your response, I appreciate your support

  • jerniganj: I'm glad everything's working as intended.

    Thank you for notifying you had fixed your issue <img src="smileys/smiley1.gif" border="0" align="middle" />.

  • I've been making an isometric game and using 00rez's Pathfinder plugin. However, it uses the visual extents of an object as a blocker and I need to use the collision polygon instead (since an isometric view projects tall objects up, but you only want the bottom of an object to block pathfinding).

    Kyatric--Does your plugin use the collision polygon to eliminate A* nodes from the valid pathing space? Sorry, I can't tell from the examples given.

  • Awesome stuff! Should have some fun with this one ;)

  • DrDeleto: It does use the collision polygon of the object types you set as "Obstacles". If the polygon is on a "virtual cell" (the behavior divides the layout in cells) then the cell will be marked as "unwalkable".

    procrastinator: have fun <img src="smileys/smiley4.gif" border="0" align="middle" />

  • Kyatric, I have been :) I've waited so long for a decent pathfinder to continue an idea I started in BlitzMax many moons ago, but never finished. My code got very messy very fast ;p Thanks for developing such a nice, simple to use pathfinder!

  • procrastinator: well you're welcome, even though I thought rez's pathfinder was even simpler to use (and handled real time (every tick) path generations).

  • Kyatric, ahhh I must've missed that one.

    I don't think I need path generation every tick. Yours seems to handle that fast enough by setting a destination with the mouse. Also I like how I can just place objects on the layout without any regard for a grid with yours. Leaves time for more creativity ;)

    I'll be sure to check rez's too!

  • Kyatric, loving the pathfinder behaviour.

    1 problem:

    I've placed this behaviour in a family and running 2 sprites from this family simultaneously.

    It doesn't work for me. If I run each sprite individually, its good. However together, its mayhem (?).

    Any thoughts on this (maybe its my code). Thanks.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)