RT

Get help using Construct 2

Post » Mon Dec 31, 2012 7:34 pm

RT
Last edited by CarHazy on Sun Jun 14, 2015 3:08 am, edited 1 time in total.
B
20
S
7
G
5
Posts: 24
Reputation: 4,455

Post » Mon Dec 31, 2012 7:36 pm

If you are only sending the amount of gold into a local key and not retrieving it then once you start it up again it will set the gold variable to 0 which is what you start out with. Make sure that on start of layout you set gold to the keys value.
B
40
S
12
G
7
Posts: 603
Reputation: 7,656

Post » Mon Dec 31, 2012 7:43 pm

R2
Last edited by CarHazy on Sun Jun 14, 2015 3:12 am, edited 1 time in total.
B
20
S
7
G
5
Posts: 24
Reputation: 4,455

Post » Mon Dec 31, 2012 7:52 pm

R2
Last edited by CarHazy on Sun Jun 14, 2015 3:12 am, edited 1 time in total.
B
20
S
7
G
5
Posts: 24
Reputation: 4,455

Post » Mon Dec 31, 2012 7:55 pm

Image Example

From what you have told us, you are only giving the browser your amount of gold and not actually getting it back. Because of that, when you start the game the 'every tick' event will send the amount of 0 gold to the local key since that is what you start with. In the picture there is an on start of layout event that retrieves the gold number that is saved in the browser and sets it as the global variable. That event MUST go above the sending one since C2 reads events from top to bottom.EncryptedCow2012-12-31 19:56:12
B
40
S
12
G
7
Posts: 603
Reputation: 7,656

Post » Mon Dec 31, 2012 7:58 pm

EncryptedCow means that everytime the game is run, the global variable will be reset to whatever you defined it as in the start layout.

The layout where you define the global Gold, include this...
On Start of Layout -> Gold = local key "Money" (or whatever it is)
B
15
S
5
G
7
Posts: 877
Reputation: 5,650


Return to How do I....?

Who is online

Users browsing this forum: Kagubro and 22 guests