Feature Request: Turret - Min/Max rotation

Discussion and feedback on Construct 2

Post » Fri May 30, 2014 8:31 am

Hi,

I have what I thought would be a simple problem to fix, the thread is here https://www.scirra.com/forum/turret-behaviour-set-max-rotation-angle_t106442

ScreenHunter_38 May. 29 22.18.jpg


The turrets go through the floor. This game is using physics, so setting the floor to solid does not help.

To fix this issue I'd really like to be able to set the min and max turret rotation in the turret behaviour dialogue.
Or have some way for the turret (not using physics) to stop rotating when it hits something, in this case the floor - which is using physics so the player ship which also uses physics can interact with it.

I've just gone through the javascript sdk docs, but I don't feel confident trying to add this behaviour myself. Although I can see where it could be done in the turret behaviours runtime.js, possibly in

// Rotate towards target
if (this.rotateEnabled)

Anyhoo, this addition to the turret behaviour would be great (for me!). Not sure if anyone else has a requirement for it, but I'd be surprised if not.

Thanks
Nick .
You do not have the required permissions to view the files attached to this post.
B
10
S
2
G
1
Posts: 42
Reputation: 798

Post » Fri May 30, 2014 8:38 am

A problem shared is a problem halved ... Just had a thought - I'll try disabling the turrets turret behaviour when player.y > someValue, then enabling it again when player.y < someValue.
B
10
S
2
G
1
Posts: 42
Reputation: 798

Post » Fri May 30, 2014 8:42 am

Nah, won't work with turrets at vastly different Y positions.
B
10
S
2
G
1
Posts: 42
Reputation: 798

Post » Fri May 30, 2014 9:30 am

You could set individual angle limits for each turret - a bit of a pain but probably the most efficient... Or you could alter the collision polygon for your turrets and stop them from rotating on collision with the floor. You'd probably have to add a rotate-until-not -overlapping algorithm as well or the turrets could get stuck. Last option - you could add a sensor and pin it to each turret if you don't want to change the collision polygon - more complex to manage...
A big fan of JavaScript.
B
76
S
20
G
73
Posts: 2,241
Reputation: 45,956

Post » Fri May 30, 2014 12:41 pm

Thanks @Colludium

I've basically decided to just remodel the turrets, so that the turrets rotates around a ball, then attach something thin to the ball to fix it to the ground. Doesn't look as good, but it's a work around I guess.
B
10
S
2
G
1
Posts: 42
Reputation: 798

Post » Fri May 30, 2014 1:31 pm

nickl wrote: I'd really like to be able to set the min and max turret rotation in the turret behaviour dialogue.


Signed.
B
28
S
11
G
2
Posts: 688
Reputation: 5,126


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 3 guests