How do I sell a tower without destroying the others

Get help using Construct 2

Post » Wed Nov 18, 2015 7:47 pm

How to sell a tower without destroying the other of the same type.
I have a game on Tower Defence format, I am facing problem in time to sell only one that is on the scene, when I try to sell only one all are sold and destroyed. It turns out it's not what I want, I want to sell and destroy just that I selected.
B
29
S
9
G
3
Posts: 280
Reputation: 4,187

Post » Thu Nov 19, 2015 3:00 pm

Anyone?
B
29
S
9
G
3
Posts: 280
Reputation: 4,187

Post » Thu Nov 19, 2015 3:12 pm

Create a GLOBAL VAR (sellTower)
On touch/click tower, sellTower = tower.UID
Pick element by UID (sellTower)
Sell
B
23
S
4
G
2
Posts: 96
Reputation: 2,442

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
29
S
9
G
3
Posts: 280
Reputation: 4,187

Post » Fri Nov 20, 2015 2:28 am

Hello, thank you
moebios
, i was found where the error was because I had already implemented the code another instance to sell the towers, but the wrong way, now found and fix all beauty, worked perfect thank you for helping me.
B
29
S
9
G
3
Posts: 280
Reputation: 4,187


Return to How do I....?

Who is online

Users browsing this forum: ColombageEnPLS, Google [Bot], Jhorbam, ninepixels and 13 guests