Move global variables to their own sheet

Discussion and feedback on Construct 2

Post » Fri Jul 18, 2014 7:49 pm

Hi!

I'm starting to have so many global variables, that I wanted to make my main event sheet a bit cleaner looking. So I had the idea that I would make a new event sheet called "globalVariables" and include that event sheet into my main event sheet.

That didn't work however: After I have copied the variables and included the globalVariables event sheet to my main even sheet, I deleted the old global variables from the main event sheet. At that point Construct will think those global variables got deleted (even when they are really in the included event sheet) and removes all references to them from the events.

It would be nice if Construct would also check the includes before determining if global variables don't exist anymore.
B
9
S
1
Posts: 97
Reputation: 715

Post » Fri Jul 18, 2014 7:56 pm

Select your Global, right-click, Move to event sheet... Sadly you have to do them one-by-one, but it works.
ImageImageImage
B
71
S
21
G
232
Posts: 3,695
Reputation: 129,866

Post » Fri Jul 18, 2014 10:39 pm

Thanks for this workaround, it's certainly better than nothing!
B
9
S
1
Posts: 97
Reputation: 715

Post » Fri Jul 18, 2014 10:41 pm

You might ask yourself why you need so many globals. You might be able to declare them inside the events that use them, or as instance variables. Just a suggestion.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 10 guests