Move global variables to other event sheet

0 favourites
  • 6 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • 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 advance

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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?

  • Cut and paste. Ignore the warning.

  • 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. ;-)

  • 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 <img src="smileys/smiley36.gif" border="0" align="middle" />

    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 away

  • 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?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)