Sneak peek: r36 Local Variables

Discussion and feedback on Construct 2

Post » Mon May 23, 2011 8:00 pm

Yeah, I guess it sounds fine since a hash table is so close to the same thing if I want persistent variables. Also, good point Aeal.
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Mon May 23, 2011 9:33 pm

I like it. I remember times when I'd use these in C.x. Do you know, when David is going to finish the graphic editor? That's probably last thing, that's stopping me from using C2 more.
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Mon May 23, 2011 10:32 pm

I think that would be more intuitive if the local variable declarations were actions and not something similar to events. It is probably harder for non coders to understand as it's not so consistent with the condition>>action system. In fact I think it would be even more intuitive if local variables don't need to be declared at all. They should be automatically declared when you add, set or substract a local variable. This would probably make things simpler.
Scirra Employee
B
129
S
45
G
15
Posts: 705
Reputation: 15,413

Post » Tue May 24, 2011 1:02 am

This is pretty cool, very nice feature. Don't have to create pointless clutter sprites to store variables anymore!
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Tue May 24, 2011 1:33 am

[quote="Noga":1kc9nphs]Do you know, when David is going to finish the graphic editor? That's probably last thing, that's stopping me from using C2 more.[/quote:1kc9nphs]
Hopefully not more than a couple of months - we're not fulltime just yet. I'm well aware this is the biggest shortcoming in C2 at the moment, we're going to sort it out ASAP.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Tue May 24, 2011 2:41 am

Would there be a way to make something like layout variables? Variables that are specific to a layout, and every time you reset the layout the variables would be reset with it.
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Tue May 24, 2011 5:29 am

Scoped variables, sounds good. Just one thought: what happens when you change layout? In that case all variables in event sheet of the old layout are forgotten.

Or did you mean "global" to the event sheet if declared at the start?
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Tue May 24, 2011 2:41 pm

We just decided local variables are forgotten every tick anyway, and global variables work like they used to, so nothing special happens when you change layout. Variables declared at root scope become global.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Tue May 24, 2011 4:01 pm

Sorry, I'm a little confused. Do you mean variables declared at root scope become global for the event sheet, then they disappear when switching to a layout that doesn't use that event sheet, or do you mean they become the exact same as global variables, with persistent values and are accessible even when going to a layout without the declared variable in the event sheet?
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Tue May 24, 2011 4:52 pm

They're the exact same as global variables when at the root scope. Otherwise, they're not global at all!
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 8 guests