How to prevent Turret to targeting itself

  • Is there any method or alternative to prevent Turret to targeting itself ?

    I want to make online multiplayer top down shooter similar to io games, so, there will be a dozens player on a room. And if there is not enough player, system will create bot player.

    Bot player and real player is a same object / sprite, and there is a separate sprite with pathfinding and turret behavior, Bot player will be pinned with this sprite and a variable for bot identification.

    Bot movement > use pathfinding to patrol/moving, and if turret are detecting target, bot will star shooting.

    Target for turret are grouped using families (pick nearest target)

    Is there any solution for this?

    Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • redfoc

    I would first select all the turret family except the one doing the targeting, they you can pick nearest...

    https://www.rieperts.com/games/forum/TargetTurret.capx

  • AllanR

    Thanks for your reply

    But, i don't think it's working with real Turret behavior (exclude specific uid), i already tries this and not working.

    If i use pick nearest every tick, it's may slow down the game performance especially on mobile device and there are many object that are checking every tick (for each).

  • I don't believe the turret behavior has a way to exclude specific instances of objects.

    You should probably work at recreating a similar result with events, which you will have much more control over.

  • oosyrag

    Yeah, i better to forget this things until i find a solution in the future, just separate bot object and set target to real player, so, player will know if an object is a bot.

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