How do I move value between layouts

Get help using Construct 2

Post » Wed Oct 12, 2016 6:28 pm

Message: kab can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
I am trying to be able to access global variable score in my "Level 1" layout in "Highscore" layout.I think i wrongly use local storage or there might be issues with the logic.

How do i fix it ?

Demo here--> https://www.dropbox.com/s/gz2apzcdn70fwgv/workingdemolatest-improved%20-%20Copy.capx?dl=0

Thanks in advance
B
5
S
1
Posts: 32
Reputation: 389

Post » Wed Oct 12, 2016 7:47 pm

Could you explain your project or the use of your variable more detailed?
I'm afraid I can't download the capx since I'm in a location with very bad and slow internet connection atm.

Text is all I can up- or download...
"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

Post » Wed Oct 12, 2016 9:11 pm

Local storage is for loading data when you close the game down and reopen it. The issue here is because you have an event in level1 that on start of layout sets score to 0. Every time you include level1 it will reset score to 0 on the start of every layout. Because score is set to 0 by default this event is not needed, remove that and then it works.
B
46
S
16
G
73
Posts: 2,086
Reputation: 43,681

Post » Thu Oct 13, 2016 5:02 am

Thanks plinkie....That fixed it
B
5
S
1
Posts: 32
Reputation: 389


Return to How do I....?

Who is online

Users browsing this forum: plinkie and 26 guests