mekonbekon's Recent Forum Activity

  • In general it's best to avoid using the wait action, especially in situations where it might be interrupted. Instead, add the timer behaviour to your character. Remember to give each timer you start a different tag. You can then use the "stop timer" action to cancel the timer for a given tag.

  • nightbr You're welcome

  • Hi nightbr, the easiest way to deal with this is to put the bat and the start position object into a container together. That way whenever you pick a bat you also pick its start position:

    https://www.dropbox.com/s/u37utq9xvas7n ... .capx?dl=0

    I also added a "for each" on the check, otherwise you might have problems with the else statement that determines the mirroring.

  • TheSynan, you're welcome

  • Hi tarek2, Thanks for looking into this. I tried with your bug capx too and got the same result. Interestingly, if you check the timer tags in debug you can see that each sprite has a different tag ("change0","change1","change2") so it seems that the UID is being applied to the tag correctly.

    So the problem is that even if they have different tags if they finish on the same tick then "change"&self.UID still picks them all together, so the function Call "ChangeAnimation"(sprite.UID) will only fire for the first sprite in that group. Adding the "for each" to the function call (as suggested) fixes it, which renders the UID unnecessary.

    OK, I'm pretty sure that explains the issue I've been having - time to rewrite some code! Cheers again

  • I have a bug in one of my projects; multiple instances are running simultaneous timers and I've been using a tag containing the instance UID to differentiate between them. Sometimes an instance hangs when the timer expires.

    If making the tags unique by including the UID isn't enough to distinguish between timers for instances of the same object finishing on the same tick then that might explain the issue I'm experiencing, hence my interest.

  • blackhornet tarek2

    Re. the timer multiple fire issue, is it possible to circumvent this by using "fire"&self.UID as a tag?

  • TheSynan

    Here's an example:

    https://www.dropbox.com/s/o6c85gmlczowk ... .capx?dl=0

    Press space to start the pathfinding and shift to reset the level.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ah yes, "pick all", I forgot about that. Cheers!

  • dop2000

    Sorry, I should have clarified - using the wait 0 seconds returns a count of 0 even if other sprites still exist, hence me using a function after the wait to escape the picking

  • I've just recently been using object.count in a project; I noticed that the count doesn't update within the same event, so if you have:

    on sprite touched: destroy sprite; set text to sprite.count

    ...it still includes the touched sprite within the count, because the sprite still exists until the next top level event (I think?).

    Changing this to:

    on sprite touched: destroy sprite; wait 0 seconds; set text to sprite.count

    ...returns a count value as 0, I'm guessing because in this case it only picks the sprite that's been touched and destroying it means there's no sprites left in the pick. I'm not sure why the same picking logic doesn't return a count value of 1 in the first example.

    One way I managed to get around this was:

    On sprite touched: destroy sprite; wait 0 seconds; call function "count"

    On function "count": set text to sprite.count

    I'm sure there are other ways though.

  • You're welcome!

mekonbekon's avatar

mekonbekon

Early Adopter

Member since 9 May, 2014

Twitter
mekonbekon has 13 followers

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • x2
    Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

18/44
How to earn trophies