PurifiedWater's Forum Posts

  • 7 posts
  • Thank you plinkie, for your very fast replies!

    "This indicates the event is triggered. Rather than running once per tick, this event simply runs (or "fires") upon something actually happening. In this case, the event runs when the user hits the Spacebar key on the keyboard. It is never checked any other time. Since triggers run upon an event happening, they aren't checked in top-to-bottom order like other events. This means the ordering of triggers relative to other events is not important (except relative to other triggers of the same type, since triggers still fire top-to-bottom).

    There can only be one trigger in an event, because two triggers cannot fire simultaneously. However, multiple triggers can be placed in 'Or' blocks (see the next section)."

    Useful reference!

  • Ahh! I thought that Construct 2 would read events going down the line 15,16,17,18 not 15,17/18, then 16.

    I knew it was something obvious lol. Is there a reference that I can refer to about this kind of stuff?

    Thank you for your help plinkie!

    Also thank you blackhornet, oosyrag for your advice!

    ~

    Thinking about it, I guess the 'on Created' is triggered when it is suddenly set to true by something so it pauses any other events that are occurring so it can run. Food for thought.

  • The issue is exactly what blackhornet described so not sure why it was ignored.

    I've re-arranged the event's multiple times; (pathfound at the bottom, village creates villager mid, on created top), (on created bottom, village creates villager mid, pathfound top), (village spawn villager bottom, pathfound mid, on created top), etc. All go to first town, not their respective town.

    Please help me see what I have missed?

  • "On Created" is called before the "Create" event returns, so there is no way the gotoUID will have been set, assuming it is set after the create. Just move "Find path" after your create events.

    I have done that but all the villagers still go to first town.

    i.imgur.com/wtcXPOe.png

    Here are the relevant events.

    Generally speaking, if you want an event to run for each instance of an object instead of one time for all of them, you want to use the system "for each" condition.

    Thanks for the advice but when the villagers are spawned they are told what to do, so I don't think there is a need for a 'for each'.

    I would use a for each, however, if I wanted to make sure that all the villagers are doing something, but for now, I just want them to go to their respective town when spawned.

    ---

    I know for a fact that when the villagers are spawned their variables are set correctly.

    I feel like there is something REALLY obvious that I am missing...

  • ... and have another object path find to it?

    i.imgur com/e5KJIr3.png

    This causes all villagers to go to the first town as opposed to the town they should go to.

    I've tried many different ways of picking a specific town but they all to one town only (if I invert the picking condition, the second town) or a random location.

    Thank you for reading.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • thank you!!!! that is exactly what I was looking for!!

  • 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

  • 7 posts