How do I Add Variable remainder to another Variable?

Get help using Construct 2

Post » Tue Oct 25, 2016 1:21 pm

So whenever I sell some of my currency/variables I get the gold/variable but the remaining just disappears. I have it on

[subtract crystal1 from cystal1]
This subtracts all of it and brings it to zero....How would I set it so the remaining goes back to crytal1?
If I have 13 crystal1's and I sell 4......9 should go back to crystal1


Video Example
https://youtu.be/XQ_oU_NWUXk

EventSheet
Image
B
47
S
33
G
19
Posts: 58
Reputation: 14,192

Post » Tue Oct 25, 2016 1:32 pm

Why would you subtract it from itself? Why not just remove the amount you want like you do in the very first line of the event?

Also, you are setting them to 0 a second later anyway, what's the point in that?
Vote for all the Construct 2 games on Steam Greenlight - Find them here
B
32
S
9
G
7
Posts: 444
Reputation: 6,731

Post » Tue Oct 25, 2016 1:40 pm

Logic could simply just be :
NumToSell = 4
Price = Green (4?)
On left click button :
Subtract NumToSell from Crystal1 Total
Add to Gold : NumToSell (4) * Green (4)
Set NumToSell to 0
B
45
S
15
G
73
Posts: 2,002
Reputation: 43,386


Return to How do I....?

Who is online

Users browsing this forum: jaytrott86 and 7 guests