[Solved, I'm stupid] We need a way to move vars between...

0 favourites
  • 5 posts
From the Asset Store
This is a code so you can see the same skin on all screens (peers). Each peer gets a skin, in addition to 4 directions t
  • Hey all,

    Something I've found quite annoying recently is that there's literally no way to move variables (Global/local), or chunks of code containing those variables, between event sheets, without going through every place the variable is used in the ENTIRE project and replacing them with a temp value.

    For local variables you can workaround it OK by creating copies of those variables in the destination sheet, then copying the code over. For globals, there is no such luck.

    There really should be a way to do this. I feel like it might be difficult due to the architecture of the engine, but a workaround shouldn't be too hard (?)

    Anyone agree that this is needed?

  • I always create a separate Event sheet for Globals, so this isn't a problem form.

  • You can move global vars with a right click => move to event sheet, and before it existed, you could cut and paste them, every action and condition would just reappear after the pasting.

  • I used to feel that way. That's why I stopped and have suggested to not use variables in a way that get's you stuck like that.

    Global variables should be instead on an object that exists globally. Such as a Dictionary. For my self I make a Dictionary and call it global. Even if I don't use the Set/Get of the dictionary I just attach variables. Then I use the globals in a way such as global.var.

    When I need local vars they are always embded in a Group and only that group of Events will ever use them. Using local vars in a parent group can and has screwed me up. So I stopped. So if I do need to move stuff around I move things by the group as a whole.

    After a few months of using C2 in the way it was meant to be used. Procedural programming. It caused far more headaches than it's worth. It's why I believe that procedural is the wrong design choice. but nothing to do about it. The best thing to do now is just design a OOP structure inside c2 system and stick with it.

    So while I agree this is a usefull feature. it's a problem that can be worked around. But hey. I won't complain if it is added and I will certainly make use of it in some way. I still make the occasional variable fopaw.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Aphrodite d'oh... well I guess you learn something every day. I guess we can close this topic ._.

    jayderyu what's the difference between using global variables, and using instance variables on a global object?

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