No turret rotation = Turret won't shoot?

For questions about using Classic.

Post » Fri Apr 11, 2008 7:58 pm

I posted it here because I'm not sure if you have to do something special if you want your turret to shoot without it rotating to the targets direction.

Ok, so I'm making a missile silo, with turret behavior and no rotation.

If turret rotation is enabled it rotates towards target and looks stupid like hell.

If turret rotation is disabled, it does nothing! Targets just go by it, it does nothing.

Is there something special I need to do to enable the turret to fire without the rotation of the turret itself?

Oh, and the build is 0.94.2, in case future people have this problem but just can't solve it by looking here.
B
2
S
1
G
4
Posts: 35
Reputation: 1,270

Post » Fri Apr 11, 2008 8:02 pm

Further studies show that it indeed acquires target, but doesn't do anything else if it's not allowed to rotate.

I put the following condition on the turret:
+On target acquired
-Turret: play animation
-Turret: set animation to fire

And it does the firing animation!
B
2
S
1
G
4
Posts: 35
Reputation: 1,270

Post » Fri Apr 11, 2008 8:13 pm

Ok, I worked out a temporary solution. I made a private value with name "reload" with it's initial value being the wanted reload time, and made this condition.

On the turret:
+Has target
+Every turret.Value('reload') milliseconds
-turret: set animation to 'fire'
-turret: play animation
-turret: spawn object missile (pic here) on layer 1 (image point 'fire'
-missile: set 'target' to turret[Turret].TargetUID

It isn't as perfect as the normal turret firing, as with this setting it takes the reload time you want to shoot the first time, unlike in a pre-set turret, which fires the first shot immediality when it sees the target.
B
2
S
1
G
4
Posts: 35
Reputation: 1,270

Post » Fri Apr 11, 2008 8:26 pm

If you dont want turret to rotate change in Property -> Angle -> Rotation=No Rotations. And set "Turret rotation=true".
B
4
S
2
G
4
Posts: 719
Reputation: 2,938

Post » Fri Apr 11, 2008 8:42 pm

Oh, for christs sake! That did the trick!

Ashley, could you give me a title?

It would be: The Turret-fool.
B
2
S
1
G
4
Posts: 35
Reputation: 1,270

Post » Fri Apr 11, 2008 9:35 pm

The turret movement is coded to not trigger "On shoot" unless its within something like 1 degree of the target. This means a machine gun with turret movement isnt going to randomly spray bullets forwards while it rotates to the target - it only shoots AT it.

So yeah, Doppel's on the right lines, make the rotate speed really high and turn off the Sprite's rotation and the Turret will be happy it's pointing at its target.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Wed Aug 07, 2013 2:32 pm

I see this post is very old, 2008 or 2009 but I am currently having this same issue. The solution given is for Construct 1 I believe or at least for a previous version of Construct as there is no option in Construct 2 to disable animation from a sprites property. I want to create towers as my turrets and have bullets spawn from the towers but do not want the towers to rotate. Presently I spawn a separate turret sprite that overlaps my tower and rotate it. Is there a way to not rotate my tower but still target enemies?
B
6
S
1
Posts: 16
Reputation: 453

Post » Thu Aug 08, 2013 4:41 am

@juduncan Unfortunately you'll likely need to give the turret behavior to an invisible sprite and put it in the container of the turret sprite to avoid C2 from rotating the image I believe.
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Thu Aug 08, 2013 9:53 am

Thanks, this is what I am presently doing just seemed like there was a better solution.
B
6
S
1
Posts: 16
Reputation: 453

Post » Fri Aug 16, 2013 4:08 pm

Same problem :)
is there simple way to do it?
HELP:)

THANKS!:)
B
9
S
2
Posts: 82
Reputation: 914

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests