# How do I get C/sec when u buy A to get B.

Get help using Construct 2

### » Tue Feb 28, 2017 5:47 pm

Hi!
Here is what I want to make:
Each time u buy A, u get B and B is to make C/sec and the price of A increases 2x each time clicked.

So:
On clicking A & If money is same or greater than A = B bought. And A+A = new A (got it til here).

And now, since every tick = 60times/sec right? Then I want to make every X seconds = 1.

So I made it like this - every 1 sec = 0.01
But when I tried it, when I cliked it only executed it once and therefore the value of C is only 0.01 (what??) I alrdy made the text auto-update though.

Thank you very much!

Any help would be appreciated
B
6
S
1
Posts: 7
Reputation: 364

### » Tue Feb 28, 2017 9:59 pm

Could you give more details to the "C/sec" process?
1. What do you want to calculate?
2. What is C?
3. What does C depend on? Does it increase when you buy more B?
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

### » Wed Mar 01, 2017 3:15 am

Message: Felarivera can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Here is the image: (Sorry Ashley but I really need help right now x.x)
What I mean is when I click it: I'll get Fans every second. But by this It doesn't do the thing like I wanted it to do.

remove the (;[.][;[;)
https://scontent-sit4-1.xx.fbcdn.(;[.][;[;)net/v/t34.0-12/17092122_622835954592251_487185459_n.png?oh=2bc92d20a365edd6eabe9b1a309fec35&oe=58B8546F
B
6
S
1
Posts: 7
Reputation: 364

### » Wed Mar 01, 2017 3:34 am

That's because you have the fans action under the event as a sub-event. It'll only trigger once due to that condition. You should put it elsewhere on it's own and add a boolean variable, like:

>"B Bought" variable = 1 (true)
>Every 1 second*dt

Adding "*dt" makes it framerate-independent, so it'll probably run better regardless of end-user specs.
Zelda Gamekit (my project)

Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

B
62
S
27
G
30
Posts: 561
Reputation: 20,252

### » Wed Mar 01, 2017 4:44 am

So:
Every 1 second & for every +1 to the Cameraman (New variable) = +1 to the Fans right?
But how can I make the every +1 to the cameraman while the available thing is compare variables? Thanks
B
6
S
1
Posts: 7
Reputation: 364

### » Wed Mar 01, 2017 5:21 am

Seems so. My example was operating off of a static variable...a simple on/off boolean that activates the first time item-b is bought. You may have to do more work for this.

If you link the capx, I can try to set this up for you so it works as described.
Zelda Gamekit (my project)

Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

B
62
S
27
G
30
Posts: 561
Reputation: 20,252

### » Wed Mar 01, 2017 7:26 am

Here is the capx: (remove the }[\][)
http:/}[\][)/www8.zippyshare.}[\][com/v/OxTfJZLs/file.html
B
6
S
1
Posts: 7
Reputation: 364

### » Wed Mar 01, 2017 8:52 am

B
33
S
18
G
29
Posts: 2,493
Reputation: 21,450

### » Wed Mar 01, 2017 10:29 am

Okay, but I want to trigger it for each clicks. How can I do it?
B
6
S
1
Posts: 7
Reputation: 364

### » Wed Mar 01, 2017 10:46 am

How do you want it 'un-triggered' ?

To trigger it on 'each click' it must be in a state of 'not triggered' b4 the click.
B
33
S
18
G
29
Posts: 2,493
Reputation: 21,450