Upgrading individual towers

Get help using Construct 2

Post » Fri Oct 25, 2013 9:44 am

Hi everyone!


I ran into a problem with upgrading individual towers, as the title indicates.
In my setup you can drag turrets on to the desired position. When using the mouse on object clicked, it doesn't target that specific tower clicked and i ran out of possible solutions to tackle this. So i somehow need to store the IID of the tower clicked, but i didn't find any option to do this.
If i was programming let's say in Java I'd do something like this:

...
onObjectClicked(){ return getID(this.object)}
...

I found some really helpful posts on this forum, which sadly involved the solution beeing presented in a .capX file, which have been deleted by now.
The FAQs about picking instances helped aswell, but I didn't find a possible solution to my specific problem.

I appreciate your help!
B
3
Posts: 2
Reputation: 234

Post » Fri Oct 25, 2013 10:05 am

+ on click
- //object picked

everything in your on click event has an reference to the clicked object, if you also want it outside, there are many ways to do that.

You could save the UID of the clicked object in a variable.

+ on click Object
- variabel FuFu = Object.UID
B
15
S
6
G
6
Posts: 512
Reputation: 5,555

Post » Fri Oct 25, 2013 11:00 am

Thanks for your quick response, everything is working out now! Thanks a lot!
B
3
Posts: 2
Reputation: 234


Return to How do I....?

Who is online

Users browsing this forum: tdcostas and 7 guests