[Solved] Families and Pathfinder

0 favourites
  • 3 posts
From the Asset Store
A short demo of template sold on store, with formations on end of way for no overlaps.
  • Hello,

    I have two sprites in a family with the pathfinding behavior.

    I used the pathfinder for sprite A and for sprite B to go to red spot.

    After that, I want to use the pathfinder to make sprite B go to the yellow spot.

    I could tell the pathfinder to tell sprite B directly to go to the yellow spot but that is not what I am trying to do because I want to have many sprite B's on the layout.

    If I directly told sprite B to go to the yellow spot, then all of the sprite B's would go to the yellow spot, when I want the ones with the specific conditions to go (for instance; low fuel.)

    When specific conditions are met Sprite B goes to the location. I can't figure out how to get the event to differentiate between telling sprite B or sprite A based on conditions.

    Is there a way to use the pathfinder option for specific object of a family when the conditions are true?

    I figure there is a way with UID's, maybe loops (to continually check if condition is true or not) but I'm not sure...

    I'm willing to hear all ideas and suggestions,

    Thank you!

    www dropbox com/s/tm9xnh4raqfb57b/pathfinding%20families.capx?dl=0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Why can't you just pick instances of sprites B with low fuel?

    B fuel<10 -> B find path to yellow spot

    If you want to differentiate objects in the family, the easiest way is to add another instance variable objectType to the family. When sprites are created, for sprites A set objectType="A", for sprites B set objectType="B".

    Then you can do this:

    Family objectType="B" -> Family find path to yellow spot

    and Family fuel<10

  • thank you!!!! that is exactly what I was looking for!!

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