How do I exclude a target from a turret?Pls help

0 favourites
  • 5 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I have a dragon that flies in the air above the enemies.

    When some enemy enter the radius range of 280 of the dragon, it stops moving (set bullet speed 0) and starts the attack animation. In the attack animation the dragon spawns a fireball that have 300 of range and 1000 of rotate speed. But i don't want the fireball to act like a guided missile. I want the ball to be spawned with the necessary angle of motion to hit the target in the dragon range without using turret behavior in the fireball.

    After this i want the dragon to choose another target when the enemy is 90º under him or pass to behind the dragon. Just like in the images below.

    Shooting the first one.

    First one get on off the "realistic view" then choose another

    Nobody in the "realistic view" then keep flying in the way.

    How can I make it?

  • I'm not sure how you want the fireball to work if it shouldn't be a guided missile.

    If you simply want to spawn a fireball with the needed angle of motion, you can do this:

    • Pick the correct enemy with the condition Pick by UID, use the Turret expression TargetUID for this
    • Under that condition, create the fireball on the position of the dragon
    • Set the fireball's angle of motion to the system expression angle(Dragon.X,Dragon.Y,Enemy.X,Enemy.Y)

    Don't know whether this is what you want though..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm not sure how you want the fireball to work if it shouldn't be a guided missile.

    If you simply want to spawn a fireball with the needed angle of motion, you can do this:

    • Pick the correct enemy with the condition Pick by UID, use the Turret expression TargetUID for this
    • Under that condition, create the fireball on the position of the dragon
    • Set the fireball's angle of motion to the system expression angle(Dragon.X,Dragon.Y,Enemy.X,Enemy.Y)

    Don't know whether this is what you want though..

    I have already done the part off the fireball's angle. But now I'D like to solve the pictures' problem. Can you help me?

  • Well, what you could do is:

    • Pick the current target by the turret expression TargetUID
    • check whether angle(dragon.X,dragon.Y,target.X,target.Y) is bigger than 90. If so, perform the action "Unacquire current target"

    Here is a .capx if you need more help: Download .capx

  • Thank you.

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