Stop Towers from targetting themselves?

Get help using Construct 2

Post » Wed Apr 10, 2013 6:54 pm

I am trying to create a TD game with a more complex aiming behaviour...
not only should towers (and enemys) be able to damage others of the same instance but also heal them later (in different cases of course )

Problem is... I cant even get them to Target each other properly =D

Example file:

https://www.dropbox.com/s/9w79dpe1zq0745q/Towerbehaviour.capx

-Drag and drop Green or Red boxes to place green or red towers
-Green Towers Target Red Towers and vice versa
-on clicking a red Tower (not the "buying box") this Tower should be toggled "confused" (Instance boolean)
-Confused red towers are supposed to target other red towers

Problems:

-On Clicking a Red Tower EVERY Red gets "confused"
-Confused Reds seem to Target themselves as they rotate to 0 degrees

If anybody would be able to help me?^^ I'm Confused!!   
B
3
Posts: 7
Reputation: 289

Post » Wed Apr 10, 2013 8:27 pm

I believe you need to look into IID and UID to specify specific instances of the tower... Sorry not in front of construct right now so can't provide a better example. Check the manual on using UID and IID. Unique ID and Instance ID.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Wed Apr 10, 2013 8:40 pm

[QUOTE=BluePhaze] Check the manual on using UID and IID. Unique ID and Instance ID.[/QUOTE]

Thank you for your reply:

I cant see a way to integrate UIDs into the default turret behaviour.

I tried to script the targeting without behaviors but couldnt find the possibility to check on a list of instances instead one.

I think that would be needed for terms as:

if - distance

(Sprite(self).x,Sprite(self).y,Sprite(notself).x,sprite(notself).y)

< range ----> fire at (notself)

Any Tips on that?
B
3
Posts: 7
Reputation: 289

Post » Mon Apr 15, 2013 1:07 pm

Hi,

I'm using the free version and thus am not able to use "families" could anyone spend a few minutes and try if using this option could help me out?

If yes i'll finally have to go for the full version.

Thanks a lot!
B
3
Posts: 7
Reputation: 289


Return to How do I....?

Who is online

Users browsing this forum: ETgirl79, semaso and 23 guests