Variables persist through layouts?

Get help using Construct 2

Post » Fri Feb 01, 2013 6:41 am

I couldn't seem to find a tutorial or a bit in the manual to help with this.

Basically I have an item that I want the player to be able to pick up and place in his inventory.
However I have different levels in different layouts currently.

Is there a way for the variable that's attached to the item to persist through to other layouts the player may travel to, or is there some other way to do that?

Thanks in advance!
B
4
Posts: 78
Reputation: 606

Post » Fri Feb 01, 2013 6:43 am

@Hexxiss - i think someone in another thread mentioned that global variables will persist in different layouts that that event sheet is attached too.

as long as you don't have events that reset the global variable on the start of the layout or some where in the event sheet (unless you want something to reset them).
B
14
S
6
G
2
Posts: 136
Reputation: 3,210

Post » Fri Feb 01, 2013 6:47 am

There is 'global' switch for every object, turn that on and object will persist through layout keeping it's variables and stuff. :)

EDIT: @wretchedshark For some reason I read question was about global variables as well the first time :)vee412013-02-01 06:50:16
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Sat Apr 13, 2013 8:40 pm

Ok ive found my problem using set text to global variable to see which one wasnt working and it turn out to be the Npc 2 object variable Is there anyway to keep it throughout the next layouts ?

Edit: its solved i just had to use global var instead of object var. but still my question remain is it possible to define where and how many layout an object variable is and is there a way to keep some global var and reset the other i do not see that function anywhere dragoonblade2013-04-13 21:31:42
B
7
S
2
G
3
Posts: 58
Reputation: 2,284


Return to How do I....?

Who is online

Users browsing this forum: Zebbi and 23 guests