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

Discussion and feedback on Construct 2

Post » Thu Aug 21, 2014 2:46 pm

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?
Last edited by sqiddster on Thu Aug 21, 2014 3:13 pm, edited 1 time in total.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Thu Aug 21, 2014 2:49 pm

I always create a separate Event sheet for Globals, so this isn't a problem form.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
131
S
29
G
81
Posts: 5,328
Reputation: 56,630

Post » Thu Aug 21, 2014 2:52 pm

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.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Thu Aug 21, 2014 2:54 pm

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.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,013

Post » Thu Aug 21, 2014 3:11 pm

@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?
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679


Return to Construct 2 General

Who is online

Users browsing this forum: wmnjunior, Zamargo and 2 guests