playMaker

Author Topic: A* pathfinding (stable 0v841)  (Read 230622 times)

Saputo

  • Full Member
  • ***
  • Posts: 107
Re: A* pathfinding (stable 0v83)
« Reply #195 on: August 22, 2013, 02:17:27 PM »
Will this work using 2D Tool Kit and Using a TileMap, Iv tried to set it up, and i only get 23 spots walkable. I have over 1k nodes.

It seems FollowTarget.cs will not work fr me, were ever I put it in my actions, it just wont load up in unity, I keep getting an Error report.

Assets/PlayMaker/Actions/Addons/AStar/FollowTarget.cs(120,64): error CS1061: Type `System.Collections.Generic.List<UnityEngine.Vector3>' does not contain a definition for `Length' and no extension method `Length' of type `System.Collections.Generic.List<UnityEngine.Vector3>' could be found (are you missing a using directive or an assembly reference?)

I get the same message if I put it in the Custom Actions Folder as well.

Saputo
« Last Edit: August 22, 2013, 04:13:54 PM by Saputo »

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v83)
« Reply #196 on: August 22, 2013, 04:18:25 PM »
Sure it should be rather simple. Make sure that all of your sprites have a collider on them and that the graph is always under the gameobjects, so the raycasting will work propwerly. Also make sure to turn height checking off. If none of that works, try scaning your graph after the game has started (the button for that is at the bottom of the a* gameobject inspector). If none of that works, you can always send me an example project (I own a 2dtk license ;) )
Sorry for the late update btw, I needed some time to think of the best way to create an installer for both win and mac. The next release will contain a python installer script and will combine both the pro and the free version into one package, as well as doubling as an updater (so we can avoid any complicated "remove this,move this, and add that" instructions in the future)
It'll probably take some more days though...
Best,
Sven

Saputo

  • Full Member
  • ***
  • Posts: 107
Re: A* pathfinding (stable 0v83)
« Reply #197 on: August 22, 2013, 04:39:34 PM »
sounds great, what about the TargetFollow.cs prob I'm having any ideas on that?? and all that worked just there is no collisions, not even into the tree's.

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v83)
« Reply #198 on: August 22, 2013, 04:56:37 PM »
umm, I don't have a good memory, so I can't tell when I put a TargetFollow script in there, but it should definitely not be there anymore xD Remove it and use the MoveTo action, you should be able to set the movement type at the very top. If you can't, download the newest version of it and its' custom editor on page 13 of this thread, and remove the old ones.
Best,
Sven

Saputo

  • Full Member
  • ***
  • Posts: 107
Re: A* pathfinding (stable 0v83)
« Reply #199 on: August 22, 2013, 05:00:32 PM »
the FollowTarget was a Custom Script, but I am using the MoveTo and have it set to Follow, and my AI just PUFF gone under the World, every time he moves, which is a prob I had with Tiled for a while I had to use ONLY Controller Move X Y Z, couldn't use Simple Move, b.c it has Gravity. So I was unsure if A* would work for me b.c of this.

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v83)
« Reply #200 on: August 22, 2013, 05:50:23 PM »
I know that character controllers have issues if they contain both a normal collider AND a character controller. Please make sure that tk2d isn't adding a boxcollider OnStart. Otherwise you could try the rigidbody velocity controller type, which also offers collisions and gravity. In case you don't need any real collisions , and don't want your character to behave like a rigidbody on collisions, you can use the transform controller type. Since it's 2d you can use the graph y position to control the "depth" of your character.
« Last Edit: August 22, 2013, 06:07:15 PM by kiriri »
Best,
Sven

Saputo

  • Full Member
  • ***
  • Posts: 107
Re: A* pathfinding (stable 0v83)
« Reply #201 on: August 22, 2013, 06:07:55 PM »
I'll test that out in a minute, I added the AStar Move Custom Editor to the AStar Folder in Playmaker in FsmPathFinding, and i got this Error


Assets/PlayMaker/Actions/Addons/AStar/FsmPathfinding/AstarMoveCustomEditor.js(3,8): BCE0021: Namespace 'HutongGames.PlayMakerEditor' not found, maybe you forgot to add an assembly reference?

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v83)
« Reply #202 on: August 22, 2013, 06:11:25 PM »
you need to upgrade PlayMaker to the newest version, sorry, I didn't mention that before.
Best,
Sven

Saputo

  • Full Member
  • ***
  • Posts: 107
Re: A* pathfinding (stable 0v83)
« Reply #203 on: August 22, 2013, 06:16:09 PM »
it is at the newest version

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v83)
« Reply #204 on: August 22, 2013, 06:19:32 PM »
mhm, maybe putting it in PlayMaker/actions/editor/ will fix it? Sorry, I'm not at my best right now, sleeping in a 32 dorm does that to you xD
Best,
Sven

Saputo

  • Full Member
  • ***
  • Posts: 107
Re: A* pathfinding (stable 0v83)
« Reply #205 on: August 22, 2013, 06:25:52 PM »
That did the trick, and Nor Am I, Been up for 38 hours working on the Game, trying to make up for lose of time & work. I feel dumb for not thinking to put it there lol. TY

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: A* pathfinding (stable 0v83)
« Reply #206 on: August 22, 2013, 06:28:19 PM »
glad I got you a step further then. And it makes me feel good if people have problems, it at least shows that people are using this :)
Best,
Sven

SteveB

  • Playmaker Newbie
  • *
  • Posts: 29
Re: A* pathfinding (stable 0v83)
« Reply #207 on: August 23, 2013, 11:53:15 AM »
Hey guys quick question:

What is the status of using Mecanim? I saw the work that hannibalov put into it last year, but that file doesn't compile when I import it.

Is there another way to use Mecanim in the latest and greatest version of this add-on?

I have the latest installation of everything fyi.

Thank you!

-Steve

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: A* pathfinding (stable 0v83)
« Reply #208 on: August 23, 2013, 03:12:50 PM »

SteveB

  • Playmaker Newbie
  • *
  • Posts: 29
Re: A* pathfinding (stable 0v83)
« Reply #209 on: August 23, 2013, 03:31:20 PM »
Yup def have that, but I'm specifically referring to using Mecanim with the A* addon here.

It was mentioned on the first page that a 'fix' was made to allow Mecanim to play nicely, but that script is DOA when I bring it in.

Has any further work been done to get these two addons to work in concert?

Thanks Alex!