If (any instance) has same value ....

Get help using Construct 2

Post » Thu Aug 22, 2013 1:42 am

I'm trying to set up a condition that tests to see if any of the instances of a sprite has a certain value, then affect all of them.

The use is for an upgrade button on an RTS, so that if one of the town halls is upgrading the UnitSpeed, then no other town hall can upgrade that ability.

What I'm needing is to see if there is a simple IF ANY INSTANCE condition can be made. This is a stripped back version of the code https://dl.dropboxusercontent.com/u/108799982/Capx%20Demos/Upgrade.capx so hopefully someone here can help.
Using R243 for all examples
B
69
S
20
G
6
Posts: 379
Reputation: 9,699

Post » Thu Aug 22, 2013 11:47 am

When you are upgrading the unitspeed set a global variable for upgrading to true. When upgrading has finished on a building, set it to false. While the variable is set to true, disable any logic linked to upgrading the unitspeed ability. i.e. when bUnitSpeedUpgrade=true > lock out all upgrade buttons.
B
47
S
17
G
81
Posts: 2,223
Reputation: 48,093

Post » Thu Aug 22, 2013 12:16 pm

The solution I thought of is probably too easy, but who knows..

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


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 45 guests