Turrets

Get help using Construct 2

Post » Thu Feb 09, 2012 9:16 pm

Here is my Project:
Project

Working on Turret at the Moment.
Works fine if only one.
The problems come with many...



It is obvious to me that the problem is that i don't use instance variables.

But i can't figure out how to use them on this one.

Edit:
What would happen when there are more than one target for the Turret? Would it F*** up? Schoening2012-02-09 21:20:46
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Post » Thu Feb 09, 2012 9:45 pm

Replace "Every tick" with "For each 'turret'"
B
83
S
21
G
15
Posts: 1,039
Reputation: 15,134

Post » Thu Feb 09, 2012 10:11 pm

Hm.. Now it is only one turrent that fires arrows at a time. The others Don't
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Post » Thu Feb 09, 2012 10:50 pm

Instead of "every 1 seconds" use a instance variable for a cooldown time between shots.

Here is an example of multiple turrets and multiple targets:
http://dl.dropbox.com/u/5426011/examples%209/turret.capx

In the example the turrets target the closest player within range. I didn't work it out but it could be modified so that only the first object in range will be targeted until it is out of range.
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Thu Feb 09, 2012 10:52 pm

that is exactly what i needed ! Thanks !
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Post » Thu Feb 09, 2012 11:00 pm

[QUOTE=R0J0hound] Instead of "every 1 seconds" use a instance variable for a cooldown time between shots.

Here is an example of multiple turrets and multiple targets:
http://dl.dropbox.com/u/5426011/examples%209/turret.capx

In the example the turrets target the closest player within range. I didn't work it out but it could be modified so that only the first object in range will be targeted until it is out of range.[/QUOTE]

But it is supposed to become a multiplayer game. By using Delta-time won't one players Turrets Shoot faster than the other depending on the Frame Rate? Or is the Game alone defining the framerate?
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Post » Fri Feb 10, 2012 7:16 pm

Nope, using Delta-Time makes it frame rate independent.
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Thu Apr 05, 2012 10:36 pm

Can someone help me modify Rojo example so that the arc does not go over angle 270-90 (half a circle basically). I've been trying to do it by trial and error but its just not working out. I would like it so that the turret will only fire and detect within angles 270-90, if another player instance is in angles 91-269 it will ignore it. I've also tried the turret behavior but it doesn't seem to work when you enter in 180 into the arc field, so I need to do this manually using events.

Thanks
B
25
S
161
G
3
Posts: 51
Reputation: 18,702

Post » Fri Apr 06, 2012 6:11 pm

RockmanZero here you go
B
12
S
2
G
2
Posts: 96
Reputation: 1,583

Post » Fri Apr 06, 2012 6:45 pm

Many thanks Podpathos, can't believe it was so simple, seems I was going about it the wrong way with groups and the between angles event.
B
25
S
161
G
3
Posts: 51
Reputation: 18,702

Next

Return to How do I....?

Who is online

Users browsing this forum: Colorfish, Yahoo [Bot] and 4 guests