Need Help Stopping Dublications

Get help using Construct 2

Post » Thu Apr 09, 2015 8:55 am

Hello. i just ran into a problem that i'm pretty sure i've steered myself totally blind on.

I'm gonna try and explain this problem as good as i can.

Keep in mind that this game is based on money making / upgrading.

Whenever you have 5 Coins, you can upgrade to another level.
With that in mind, IF you don't have 5 Coins, you can't upgrade to another level.

With that said, my problem occurs.
Image
This is what i got so far, and which, in my head ( atm ) seems the most obvious.

To explain further, what's going on, on this picture.

1) Everytime to touch the "button( Anotherline )" and you have less than 5 coins, the system creates the text at a self chosen location.
2) When the text is created, it sets the text variable to 1.
3) When the system detects that the variable of the text is set to 1. the system wait 2 seconds.


What it needs to do, is simply to display a text ( you need atleast 5 coins to upgrade ) if you don't have 5 coins.
it does work tho. what i'm trying to do, is to shrink the possibility of "GAME CRASH" due to heavy amount of dublications.

As of now, the text just stacks up.
It doesn't go higher than 181 stacks because it has a fade behavior on which destroys it after 2sec.

I want only to be able to show this text, once it's destroyed again.

All in all. once the text has disappeared, the text is able to show again, if you have less than 5 Coins.
BUT, lets say you have 4 Coins, and you click the button.
the text should appear.
the text then disappears after 2sec.
but in the meantime, the player gets another coin and presses the button.
nothing would happen if i disable the button for 2sec.
so the button, needs to be enabled at all time.
ONLY the text, needs to have a timer on min. 2sec.

I hope this is enough info, and not to confusing.
also i hope there's someone who has the solution for this :geek:
B
9
S
3
Posts: 27
Reputation: 754

Post » Thu Apr 09, 2015 9:02 am

If you use on touched Anotherline instead of is touching the stacking will be less.

Adding another condition like system compare Need5Coins.count = 0
will make sure the text won't be created unless there are no instances of the text, assuming the text has a destroy after fade out.
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 Apr 09, 2015 9:17 am

LittleStain wrote:If you use on touched Anotherline instead of is touching the stacking will be less.

Adding another condition like system compare Need5Coins.count = 0
will make sure the text won't be created unless there are no instances of the text, assuming the text has a destroy after fade out.


Thanks to you LittleStain.

The Solution is:
Image
B
9
S
3
Posts: 27
Reputation: 754


Return to How do I....?

Who is online

Users browsing this forum: ijust8, imhotep22, tetuan, Yahoo [Bot] and 2 guests