Turret behavior problem...

  • Hey, this is my second post

    Well Im making a strategy game and I have a little (Huge) problem. I have some tanks and they shoot each other, thats what I want, but at the time when I put more than one kind of tank, the enemy tank starts getting a bit "crazy".

    What do I mean? Well, I have tanks fighting 1 vs 1, "A" tank vs "B" tank, right, but when I put 2 vs 1, two "A" tanks vs one "B" tank, the "B" tank doesnt know who to shoot, it just stucks (Btw, the two "A" tanks are the same sprite, they're just duplicated, but they have their own hp, etc... )

    Can pls someone help? I would apreciate it so much, Thanks! ^^

  • can you maybe change in the targeting to nearest target first or futherest target first. To see if there a difference ?

  • For a strategy game I would go a little further than just checking who's closest,

    If it's an automated defense mechanism I would check which unit has the higher rank, which has the lowest health, which can cause you the most damage and target them accordingly.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • can you maybe change in the targeting to nearest target first or futherest target first. To see if there a difference ?

    No, I've already tried, it doesnt work...

  • For a strategy game I would go a little further than just checking who's closest,

    If it's an automated defense mechanism I would check which unit has the higher rank, which has the lowest health, which can cause you the most damage and target them accordingly.

    The problem is, the tank gets stuck because the two "A" tanks, are the same sprite, they're just duplicated, so there is when it gets stucks, cause when I have two different sprites, the "B" tank does not get stuck

  • after you narrow down your pick to all tanks suitable for attack add a subevent with

    pick nth instance (0)

    and do the actions on it

    if its still switching, maybe you need to lock your target until it dies or for a certain amount of time

    add another var on your turret attackUID=0

    now while it's 0 you're picking a tank, once you picked you're updating this value to the tank uid

    than you need to reset it to 0 once the tank is destroyed or in any other condition you like.

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