How do I do this one last thing

Get help using Construct 2

Post » Wed Aug 13, 2014 5:40 am

So my tower defense game is finally all coming together but there is still one last thing that I need as far as I know for my game engine to be complete. I can upgrade each individual tower but once the upgrade has hit my instance variable of 3 I want to hide the highlight for the tower that has been fully upgraded but it hides it for all of the towers. How can I make this work, how can I make it so each individual tower stop from upgrading after it has reached it's max upgrade. Any help would be greatly appreciated. I have attached a screen shot of my upgrade group. Thanks in advance.
You do not have the required permissions to view the files attached to this post.
B
4
S
1
Posts: 27
Reputation: 504

Post » Wed Aug 13, 2014 7:17 am

Assuming event 91 is a top-level event (i.e. perhaps only in a group), it looks like you're adding 1 to highlight.maxUpgrade on all highlight objects in event 92, as none have been picked, it will pick them all. Just a stab in the dark.

edit: unless you are using containers
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Aug 18, 2014 2:16 am

@codah this is in a group, you are correct about that. I can't figure out how to add 1 to an individual instance of highlight. I have been trying to make it work for a few days now and I just can't seem to get it.
B
4
S
1
Posts: 27
Reputation: 504

Post » Mon Aug 18, 2014 2:36 am

Event 95 is checking if ANY highlight objects have MaxUpgrade=3, it is not PICKING that one. Use 'Pick by comparison', instead, to pick that one.
ImageImageImage
B
71
S
22
G
240
Posts: 3,734
Reputation: 133,994

Post » Mon Aug 18, 2014 10:29 am

I think event 95 is fine (C2 ensure picking is done by using the compare instance variable). And since you actually wanted the ones that have it to 3, it is not a problem.

However, event 92 would not work well unless gunner1 and highlight were in the same container, which explain that everyone of the highlight actually increase their values.

https://www.scirra.com/manual/150/containers

Since the highlight I think is proper to each instance of the tower, using containers seems logic to do

Unless you are using families, in that case, you would have to link them using instance variables to store and pick by uid
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo and 17 guests