How do I make a persistant variable between layouts

Get help using Construct 2

Post » Sun Apr 12, 2015 8:47 am

I am trying to make it so when I activate something on layout 1, it drains from a global variable, and when i switch to another layout the draining still continues from that variable, but when i deactivate the object, the variable stops draining.
B
4
Posts: 14
Reputation: 228

Post » Sun Apr 12, 2015 8:52 am

A global variable is global, so it is persistent.
The actions you perform on the variable are inside event sheets.
If the "draining" action is not in the event sheet of the new layout it will not be performed.
So I gues it would just be a case of adding the event and action to the new layout.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Apr 12, 2015 8:57 am

LittleStain wrote:A global variable is global, so it is persistent.
The actions you perform on the variable are inside event sheets.
If the "draining" action is not in the event sheet of the new layout it will not be performed.
So I gues it would just be a case of adding the event and action to the new layout.



But its a door that is activated on layer 1, So how would i make that activation register on the second layer aswelll so the draining continues?
B
4
Posts: 14
Reputation: 228

Post » Sun Apr 12, 2015 9:15 am

You could use another global variable to register if the door is open.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Apr 12, 2015 9:22 am

LittleStain wrote:You could use another global variable to register if the door is open.


THanks man, im a big time idiot, i should've realized that from the beginning, Thanks for the help man :)
B
4
Posts: 14
Reputation: 228


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go and 7 guests