How to use global Variables?

Discussion and feedback on Construct 2

Post » Wed Aug 03, 2011 8:07 pm

hi,

i have 2 questions...

how can access the value of a global variable for a condition/subevent of an event?

can i use defined global variables in every event sheet? if so, how and shouldn't it be displayed as compendium in every event sheet?

thank you :)
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Wed Aug 03, 2011 8:12 pm

[QUOTE=xeed]how can access the value of a global variable for a condition/subevent of an event?[/quote]
If it's global, it appears everywhere. So it should just appear in the 'set/add/subtract variable' system actions.

[quote]can i use defined global variables in every event sheet?[/quote]
Yep, go ahead and try it, it should work just fine. That's the purpose of global variables.

[quote]if so, how and shouldn't it be displayed as compendium in every event sheet?[/QUOTE]
I'm not sure what you mean - they should just appear in the system actions as before. If you don't want a variable to appear in another event sheet, move it in to a subevent or a group and it'll become a local variable. Then, you can only access it in that "scope" (that group or that event's subevents).
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,528

Post » Wed Aug 03, 2011 8:24 pm

like last time, i forgot to check the options above "System". did think it is listed as object in the main event sheet.

as a global variable, i would recommend to list it in every event sheet.

btw hope u had a nice holiday, Ashley :)

greets xeedxeed2011-08-03 20:27:10
B
15
S
3
G
5
Posts: 396
Reputation: 4,977


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 16 guests