See if a function is running?

0 favourites
  • 4 posts
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • Is there a way to check if a function is running, and if so to wait before calling it again? I'm having this problem where I call the same function two times. The way it happens:

    If skill >= skillnext call function "level"

    On function "damage", deal damage variable to enemy, then distribute points for "hits" and "misses" to the skill being used, call function "display text" "you deal 6 points of damage"

    On function "level", call function "display text" "your unarmed has gone up, it is now 3"

    Here, you see the second line calls text to display, as does the third, but the third you don't see until you level, but when you do you get the "damage" text and the "level" text in teh same sprite box. I'll send my CAPX to anyone willing to tackle the problem. Please be serious.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You want to display in the same object 2 texts at the same time, so the last you call is displayed and hides the previous call.

    The function "display text" could be instead "queue text", a function that adds the text to an array of "buffered text". Another function would be called on regular intervals, and would check if the array is empty or not. If not, it would select the first text from it (remove it from the array too), and display it.

    This is a simple log system...

  • didn't you see the updated capx in the other post ? No wait, no overwrite, call multiple times in same tick...

    https://dl.dropboxusercontent.com/u/143 ... ffset.capx

  • Okay I think the example you gave on the other post wasn't the CAPX so I didn't really know what to do, they both loaded in the browser as HTML files. I did take your suggestion though, I just suck at understanding these things. lol

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