How do I compare the Range of a tower.

Get help using Construct 2

Post » Wed Nov 18, 2015 7:43 pm

I have a tower, but I do not know how to compare the tower range.
How I do it, how to set the action of the tower when the enemy is close?
B
26
S
9
G
3
Posts: 251
Reputation: 4,052

Post » Thu Nov 19, 2015 1:16 am

you mean something like:

system pick tower where distance(tower.x,tower.y,enemy.x,enemy.y) < 100
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 » Thu Nov 19, 2015 2:46 pm

How do I implement this? how does this pick?
B
26
S
9
G
3
Posts: 251
Reputation: 4,052

Post » Thu Nov 19, 2015 3:18 pm

sielxm3d wrote:How do I implement this? how does this pick?


I'm not sure what you mean..
This is a condition/event of the system..

add event/condition, choose system, choose pick by comparison..
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 » Thu Nov 19, 2015 9:10 pm

when you click on the tower assigns the value of weapon 1.UID to selltower.
When click on the image to sell and next to esteusa pick by comparision
if weapon1.UID if set to selltower. then it triggers:
Destroy weapon1 and add 25 of money

no debug saw so are assigning the value of UIDs for however selltower
in time to catch the individual still object so is destroying everyone.
B
26
S
9
G
3
Posts: 251
Reputation: 4,052

Post » Thu Nov 19, 2015 10:15 pm

Please share your capx or a screenshot of your events, because pick by comparison should work if used in the right way..
That is unless you have other conflicting events..
Picking the right objects in your event is the only way to have the attached actions only apply to the objects you want..
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 » Fri Nov 20, 2015 2:19 am

It seems, is conflicting somewhere, because to remove all objects and codes leave only some essential, I noticed that it worked as I wanted, the problem is now redo everything from the beginning and go testing to find where that is entering conflict.
B
26
S
9
G
3
Posts: 251
Reputation: 4,052


Return to How do I....?

Who is online

Users browsing this forum: AllanR, Bobbyneal100, LaurenceBedford, TRPaladin and 13 guests