Change of variable scope

Just started using Construct 2? Post your questions here

Post » Thu Jun 05, 2014 10:48 pm

I wonder if C2 could rename variable references when their scope changes.

e.g. you have a bunch of global constants and decide to move them into a group. The events that use them are removed (but luckily restored if you change the scope back as I found out).
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Thu Jun 05, 2014 11:05 pm

Moving a Global into a group makes it Local, which means nothing outside of the group can see it - it is now local to the group. If the reference is already inside the group, it is maintained.
ImageImageImage
B
71
S
22
G
247
Posts: 3,753
Reputation: 137,552

Post » Thu Jun 05, 2014 11:45 pm

Hmm ok so globals are a special case (in a sense). I guess you'd perhaps put them in a separate layout and include the layout or something similar. Thanks for the response.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Jun 09, 2014 12:00 am

That's what I usually do if I use more than one layout.. just put them into an event sheet called GLOBALS.. much easier to manage.
B
15
S
5
G
7
Posts: 876
Reputation: 5,650


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests