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

Get help using Construct 2

Post » Sat May 06, 2017 10:00 pm

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.
Image

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

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

How can I make it?
B
21
S
8
G
1
Posts: 29
Reputation: 2,000

Post » Sat May 06, 2017 10:15 pm

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..
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Sun May 07, 2017 12:23 am

randomly wrote: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?
B
21
S
8
G
1
Posts: 29
Reputation: 2,000

Post » Sun May 07, 2017 2:36 pm

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
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Thu May 11, 2017 4:21 am

Thank you.
B
21
S
8
G
1
Posts: 29
Reputation: 2,000


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 22 guests