Trouble with Turrets [Solved]

Get help using Construct 2

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

Post » Sat Dec 07, 2013 5:18 pm

the turret behaviour automaticaly sets the right bullet direction on shoot so setting the bullet angle conflicts with the behaviour. Actually the turret behaviour uses predictive aim, so the bullet will fly to where the enemy will be if he keeps moving in the same direction at the same speed.
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 » Sat Dec 07, 2013 6:19 pm

okay, first question.. what is the green loop icon? you have it next to system in several places. That is new to me. I guess it's related to "for each" but i don't see why this would have an icon where other actions don't. Is there something special about it I should know?

another thing. you have a system/else on line 3 all by itself. seeing it as it is by itself, i am surprised to see that works. wouldn't the else need to be linked to something to know what the other option is or is it simply that because it's the next function below the 2 line that it works?

So you use this "for each" function, is this a key part of how you differentiate the saving of UID's to each tower individually?

You use TargetUID for both Tower and Bullet. Is this needed or could they have been named uniquely?

Also I noticed that you're not using the turret behavior stuff. As you can see in my prior capx, its about having a turret rotate and point to the target and i'm not sure if that would effect anything with your approach.

Sadly after having gone through it to try and reproduce what you made in yours somehow it didn't work. I've attached the project here if you want to see what i did.

I have to say this IS a very advanced / complex way to solve this problem. very impressive, but for noobs like me its a clearly easy to mix something up.

here is the project https://www.dropbox.com/s/jt6g4icsdokxrx5/TD_Test_2.capx

the only difference i can see is that i have two enemies on the screen already where you spawn an enemy from a spot. i'm not sure if that would matter.

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

Post » Sat Dec 07, 2013 6:24 pm

@LittleStain in it's simplest form, i have a have to have a bullet behavior on the bullet object or it doesn't move.

when i add the unaltered basic bullet behavior, the bullet shoots to the right regardless of turret rotation.

So I'm just not seeing where the turret is telling the bullet what direction to go.
B
59
S
9
G
1
Posts: 939
Reputation: 6,545

Post » Sat Dec 07, 2013 6:51 pm

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 » Sun Dec 08, 2013 1:25 am

booya! ok now that makes sense and it IS great to see that the tutorial points out that this is unique to this particular behavior. I got it to work once I understood this distinction.

However big props should go to JJList for coming up with a "roll your own" solution to turret independent behavior. :)

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

Previous

Return to How do I....?

Who is online

Users browsing this forum: lukewasthefish, marc254, Mayfly, tarek2 and 19 guests