Move global variables to other event sheet

Get help using Construct 2

Post » Sat Mar 23, 2013 1:00 pm

Hello all, I have quite a big number of global variables (mostly constants) that I want to move to another event sheet.
Of course these cannot be cut and pasted normally, and I also would like to avoid the following procedure:
(1) duplicate all the globals with a slightly different name in the destination event sheet
(2) going through the whole project renaming every use of all the moved variables
(3) delete the now unused original globals
(4) rename the remaining globals to their old names

Any tips for making this process less painful?
Thanks in advanceAlcemon2013-03-23 13:01:07
B
19
S
4
G
4
Posts: 70
Reputation: 3,896

Post » Sat Mar 23, 2013 1:45 pm

Not sure quite what you mean, but I know that they literally are global. If you have the other sheet included atleast in the sheet that has the globals already.

I have an AI sheet, and a HUD sheet, my HUD sheet is displaying variables that come from my AI sheet.

Unless you wanted to duplicate them intentionally?
B
26
S
5
G
5
Posts: 98
Reputation: 4,734

Post » Sat Mar 23, 2013 4:14 pm

Cut and paste. Ignore the warning.
B
54
S
28
G
18
Posts: 1,520
Reputation: 24,990

Post » Sat Mar 23, 2013 6:58 pm

Yes, like Ramones said, you can ignore the warning if you paste them immediately. You can put all your Globals on their own event sheet which doesn't have to be linked to a layout or included in another eventsheet.

Edit: Yes, it is scary the first time you do it. ;-)Paradox2013-03-23 19:00:44
B
200
S
51
G
30
Posts: 896
Reputation: 36,494

Post » Sat Mar 23, 2013 7:58 pm

Thanks Everyone, I thought that it would kill all events where the constants were referenced (as the warning said) but it seems like good guy C2 spared all my events

Edit: To be precise, C2 actually DOES delete all the events that reference your cut globals when you cut their definitions but they are all re-added as soon as you paste them back.

So yes, it's safe to ignore the warning if you paste what was cut right awayAlcemon2013-03-23 20:03:18
B
19
S
4
G
4
Posts: 70
Reputation: 3,896

Post » Sat May 04, 2013 2:38 am

Crikey - I didn't realise this I have been agonising about this very issue for a few days now. @Ashley and chance of making this more user friendly?
B
31
S
8
G
5
Posts: 436
Reputation: 5,836


Return to How do I....?

Who is online

Users browsing this forum: Governador, RookieDev, tarek2, Thelegendvinny and 18 guests