codah's Forum Posts

  • You might need to provide a capx. There's a few things that can go wrong. Try this - add an event when path NOT found and see if that triggers.

  • You can have a Local variable under a function definition, then it will be accessible from function sub-events (from the var definition onwards) and not from elsewhere. What did you have in mind?

  • Thanks for sharing these. Now some text/message backgrounds please

  • The MoveTo behaviour might do what you want.

  • You need to provide more detail. Like how many different types of sprites are there? how many sprites do you need to generate?

  • Like I said, set the position first, then pin. I also fixed some other stuff.

    What I did:

      1. Add an image point above the player's head 2. When reach 1000:
        set smiley visible position it to that image point (added) pin to player(moved; see below)
      3. Added a 'trigger once' otherwise it will be doing the above every tick (probably could've changed the System:TotalDistance>=1000 to =1000 4. Disabled the Sprite:Is visible->Sprite Pin to Player event as it's not necessary due to step 2

    Note: using Wait x seconds can be confusing to use.. other events don't stop while the time passes...

    https://www.dropbox.com/s/tz3wwfzqj64qonj/Autorunner%20Example_tomhaiger.capx

  • Glad to have helped Anyway I think it was the Y position of the objects, not 'Use collision cells'. If you raise them by a couple of pixels (i.e. the same height as the first) then they all work.

  • So to fix it delete all the chesnuts except the first one off your layout, then re-clone the first one to where you had the others.

  • Yes that's why I saw the above Anyway, only the first chesnut is getting line of sight AT ALL. So definitely only that one will trigger the event. I noticed that one has 'use collision cells' to No and the others are Yes. However changing that didn't fix it. Something to go on though.

  • I was going to upload a screenshot but the forum won't let me.

    In event 225 you have the conditions

    -------------------------------------------------------------

    Idle: pick nearest to (chesnut.x, chesnut.y)

    chesnut: Has LineOfSight to Idle

    -------------------------------------------------------------

    Surely the Idle and chesnut should be swapped in the first condition? There is only 1 Idle object so there's no point picking it.. I'll continue to look.

  • Pin behaviour will work if you're doing it right. A common mistake is to not first set the position, before pinning the objects together..

  • So without the full capx it's difficult to know what you mean by "ill destroy the first one" (like, which objects you're referring to). Sorry but like this it's a guessing game for me.

    If you're destroying the chesnut objects then if your event 25 is on every tick (i.e. not a subevent) then I would expect the nearest chesnut with LOS to Idle would be destroyed, then again on the next tick the nearest one with LOS is destroyed... etc. If this is not occurring, make sure there is actually an object with LOS (is the animation changing to attack?).

  • Picking order doesn't matter; you will still end up with the same objects. Each condition is like a filter that reduces the number of objects that are picked. The exception is Pick All, which resets the picking and so increases the number of objects picked. You might sometimes need this in sub-events. Definitely re-read the manual section on Events that describes this if you're unclear on picking.

    So event 25 is saying

    "Filter out all chesnut objects except the nearest one to an Idle object, but only if it has LOS to an Idle object; then, for each one that is picked (if any; in your case there should be 0 or 1) set its animation to 'chesnutAttack'"

    So when you say "the other ones... do not change animation", are they not following your logic (above)?

  • caplocks1111 hmm.. actually no... that doesn't help him at all.

    If you create a new project and choose the platformer example, you should get some ideas from that (like the way the background and floor are moved). I'm not able to do more at the moment but that should give you a start.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • caplocks1111 One way to NOT do it is to spam useless answers to every post you find.