Superepicking's Forum Posts

  • 7 posts
  • FIXED - eventually by using debug I found that the alertcountdown counted past zero and into the negatives, which set alerted to true. I fixed that by setting it so that if alertcooldown is =<0, it sets alerted to false and alertcooldown to 0, and the Chaser now wanders correctly. Then, when the player was spotted, the Chaser would just infinitely walk in one direction. This was a result of trying to find a path every tick - slowing it to every 0.1 seconds did the trick, and the AI now functions correctly.

    Thanks ramones for the advice!

    -Martin

  • Bump

  • I think maybe the Chasers aren't being reset when their alertcooldown reaches 0. In event 5 you have a trigger once that won't work well with multiple objects. Say you have two chasers with alertcooldown > 0. When one of them reaches 0 then event 5 runs and sets alerted to false. When the second chaser reaches 0 that event won't run again, it already "triggered once" so the second chaser doesn't get reset.

    Events 5 and 10 do the same thing right? I'd say try getting rid of event 5 and remove the trigger once from event 10 and see if that helps.

    Nothing changed - the Chaser still tracks me through the walls.

  • Have you changed it from solid to custom obstacles in the line of sight behavior properties?

    Yes, I just checked and it's set to custom obstacles.

  • Oops, the imgur link was removed.

    imgur. com/a/Htp5I

  • So I have programmed some basic but decent AI that *should* wander around until it has line of sight to the player sprite. It should then chase the player.

    However, although I have set the Wall sprite as an obstacle, the enemy can still see through it and will continuously chase the player, even through mazes. There is probably something obvious I have forgotten to include in the code.

    Screenshots of my issue: Thanks in advance!

    Martin

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi! I'm Martin. I live in England and am just starting out on my game dev journey. I tried unity, but its a little too complicated for what I want to do. I got interested in game development when I was only 7, and I am currently 14. See you around!

  • 7 posts