Trouble with Turrets [Solved]

Get help using Construct 2

Post » Tue Dec 03, 2013 3:18 am

Hi there,

I'm doing some work on a tower defense style game and i see the turret temple, but i'm still not seeing how i can have one turret on the screen and each behave independent..

the issue i have is that when my turrets spawn bullets which shoot towards their target, one turret alone is fine because i set angle for the bullet and it shoots in that direction.. but if I add a 2nd turret, they are both targeting different targets, but all bullets move the same direction rather than each firing in their own correct / independent direction.    

I suspect this is going to be a much bigger revelation than just turrets, but this seems like a good example to start with.

Thanks!
Calebpart12studios2013-12-08 06:29:22
B
59
S
9
G
1
Posts: 939
Reputation: 6,545

Post » Tue Dec 03, 2013 10:46 am

seems like you need to read up on how picking objects works. There are some great examples in the FAQ.

It's all about telling the computer which turret or bullet should react to the event you made.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Dec 04, 2013 5:41 am

Hey that's great. Where is the FAQ? I would love to know more about how picking objects works in Construct 2.

Maybe if anyone happens to see the Turret Defense Template they could quickly explain how those turrets are clones of each other, but able to behave independent of each other and tell individual bullets which direction to fly.

Thanks!
Caleb
B
59
S
9
G
1
Posts: 939
Reputation: 6,545

Post » Wed Dec 04, 2013 1:47 pm

@part12studios
Hi there! Just wanted to say I have the very same problem in my project.
I'm totally gonne note you once I manage to make that work!:)
B
18
S
5
G
1
Posts: 74
Reputation: 2,672

Post » Wed Dec 04, 2013 1:56 pm

As far as I can see in the turret example the bullet angle isn't set. The turret automatically aquires the target as specified in the turret behaviour. Just add the target in an event and all should work.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Dec 04, 2013 3:59 pm

Hey hey!
@part12studios , I think i have some good news! :D
It might be messy and needs optimisation, but.. Here, catch the capx!
Hope that helps!:) I'll be glad to answer any questions. JJList2013-12-04 20:03:18
B
18
S
5
G
1
Posts: 74
Reputation: 2,672

Post » Wed Dec 04, 2013 6:03 pm

[QUOTE=JJList] Hey hey!
@part12studios , I think i have some good news! :D
It might be messy and needs optimisation, but.. Here, catch the capx!
Hope that helps!:) I'll be glad to answer any questions. [/QUOTE]

Your capx is asking for a password.
B
75
S
30
G
35
Posts: 340
Reputation: 22,896

Post » Wed Dec 04, 2013 7:51 pm

@DrewMelton
Aww, my bad. Fixed it :)
B
18
S
5
G
1
Posts: 74
Reputation: 2,672

Post » Sat Dec 07, 2013 1:24 am

ok yea now see that is what i'm talking about! i'll pick it apart further to be sure i really understand it (I.E. actually make my game do the right thing). What mystifies me though is that while you're doing it in a way that makes some sense, how did they get their tutorial to work.. i'll have to investigate further. :)

Thanks!
Caleb
B
59
S
9
G
1
Posts: 939
Reputation: 6,545

Post » Sat Dec 07, 2013 4:55 pm

Also for anyone who wants to see exactly what i'm seeing here is a link to the project https://www.dropbox.com/s/u20cq4809ao2ds7/TD_Test_1.capx

I should have included this sooner.. see how the turrets track as they should but the bullets seem to be conflicted.

I'm trying the method JJList made now. I just can't figure out what the template version achieves the same effect with a bit less work.

Regardless I do like having a better understanding of how to utilize UID.

Thanks!
Caleb
B
59
S
9
G
1
Posts: 939
Reputation: 6,545

Next

Return to How do I....?

Who is online

Users browsing this forum: Lancifer, nahima and 11 guests