Why system don't want to remember this "substract"?

Get help using Construct 2

Post » Wed Jul 26, 2017 10:38 pm

I have diffrent layout where user can upgrade tower. He click on Sprite57 and Experience points are - 20. But when I out from this layout and back again it's still same value of Experience. System don't save this but this works (he got this item).
Player should lost this 20 exp. Maybe I should have any action for displaying downgrade experience in this layout.
Image

Or maybe this is reason. I have this on every layout:
Image
B
7
S
4
G
2
Posts: 119
Reputation: 2,147

Post » Wed Jul 26, 2017 11:03 pm

I'm not sure what you're doing here, setting a global variable to itself? You might be setting experience on start of layout somewhere.
B
45
S
15
G
73
Posts: 2,023
Reputation: 43,428

Post » Wed Jul 26, 2017 11:04 pm

Save a copy of your project. Just in case, because this is gonna be dangerous.

Add a new Event Sheet. Call it 'Globals'.
Open both your event sheets (the one you have been coding in & the new one, so you have a tab for each one of them.
Click the tab of your event sheet. Select the global variables. Press CTRL + X.
The system will complain. Click Yes. All your events will look messed up. Do not panic.
Click the tab for 'Globals', to bring that event sheet into focus.
Press CTRL+v. The global variables are now moved to the new event sheet 'Globals'.
Return to your event sheet and it will look complete again.

Do NOT include that new event sheet in any other event sheet. Do not go make events in there.
Just use it for all your global variables.

Why ? When not included, those global variables will not re-initialise when you rerun layouts.
B
33
S
18
G
28
Posts: 2,475
Reputation: 20,914

Post » Wed Jul 26, 2017 11:37 pm

thanks guys but is this first image is correct? Is this tower upgrade system it's ok?
B
7
S
4
G
2
Posts: 119
Reputation: 2,147

Post » Thu Jul 27, 2017 12:05 am

Yeah looks okay, its working, right?
B
45
S
15
G
73
Posts: 2,023
Reputation: 43,428

Post » Thu Jul 27, 2017 7:22 am

plinkie wrote:Yeah looks okay, its working, right?

Yes it working, but when I change layout and back again to upgrade layout - I see the same amount of Experience.
I will do this upgrade system on difffrent layout because now it's on old template example of full game that a bought
B
7
S
4
G
2
Posts: 119
Reputation: 2,147

Post » Thu Jul 27, 2017 10:58 am

99Instances2Go, you're a god for me :) I was struggling with this problem and you answered without knowing my question ^^
B
6
S
1
Posts: 29
Reputation: 408


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest