Johnson01's Recent Forum Activity

  • How do I set the text of a text object from a different event sheet than the event sheet of the layout that the text object is in? Sorry if I worded that poorly. But what I mean, is that I want to set the text when an event happens, but the event is in a different event sheet and layout.

    Thanks!

    Edit: Also, the text I want it to be is a global variable, which is stored in the event sheet that the text object is NOT in.

  • I dont get the logic.

    For a 'every X seconds' to work its needs to check its time kinda every tick.

    Lets say its must fire every 2 seconds. First tick it sets that time, next ticks its askinig the system "is it time yet". And when it reads 2 seconds, it will fire and reset the clock.

    You would do the same, keeping an eye on that watch.

    A function gets called. Then it runs one moment. The containing events and actions dont get called/checked/compared/activated again till the next call. So that 'every x seconds' aint gonna do one thing.

    If you need that timer, use a real timer. Outside the function. Thats a behaviour. Start a timer with a specifiek tag in layout start up. Use a 'on timer' condition. And bring in there that whole on locate function. No need to call it, it calls itself when it is time. The on failed path is then not needed to.

    If you want it to it to find a path 2 second after it has sight on the player. Then make the 'has LOS' a top event. And start the timer in there. Make the inverted to stop the timer.

    'on arrived' is not needed, because the timer will catch that.

    Thanks for replying! I understand what you're saying, and I guess I don't need the timer. So I removed it, which makes my code better, but the enemies still don't follow the player. Do you know how I could fix it? Would having the file help, like the other person asked for?

    Edit: I'll upload the file tomorrow.

    Edit 2: And I should mention, when I removed the timer I moved the actions that were on it to the event above it.

  • Anybody at all know what I did wrong? I'm still trying to figure it out and would greatly appreciate the help!

  • Bumping this, because it's been a while.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm trying to make my enemies go to the player when they are in its line of sight, but it doesn't work. Here's a screenshot of the portion that is supposed to do that:

    http://prntscr.com/b4b3oe

    http://prntscr.com/b4b3xs

Johnson01's avatar

Johnson01

Member since 28 Apr, 2016

None one is following Johnson01 yet!

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies