Maximum Values for Variables

New releases and general discussions.

Post » Sat Feb 13, 2010 5:46 am

Wouldn't that make sense? If we could simply set max and min values for variables in the UI without having to use events.

I'd love to see that implemented.
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Sat Feb 13, 2010 6:03 am

I think the clamp function already does that, not sure though....
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Sat Feb 13, 2010 6:30 am

[quote="OP":2sllya8g]Wouldn't that make sense? If we could simply set max and min values for variables in the UI without having to use events.[/quote:2sllya8g]

Yeah, it would be nice, but I'll just stick to the clamping. :3
B
2
S
1
G
3
Posts: 118
Reputation: 1,336

Post » Sat Feb 13, 2010 6:55 am

Yeah, but what if you wanted to make the object global, and you didn't want min, and max set?
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Sat Feb 13, 2010 7:03 am

It would dosent make much sense because it would increase the amount of variables needed for 1 variable. and it would end up essentially doing the same thing as the clamp function anyways.
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Sat Feb 13, 2010 12:17 pm

I am agree with Thomas. In some parts of my game I am using maximums and minimums, and need always to use conditions to fix values. It is quite easy doing with events but would be great to have this feature.
B
30
S
15
G
10
Posts: 285
Reputation: 7,144

Post » Tue Feb 16, 2010 8:52 pm

If you have global vars, then have a global event sheet with events for those vars

create a new event sheet named "global" containing
always: set global('asdf') to clamp(global('asdf'),0,10)

then include that sheet in every layout's global sheet.

You have now a centralized place where to set your maximum and minimum for these global variables, and the regular variables that do not need clamping are unaffected =)
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Wed Feb 17, 2010 8:16 pm

Hey Madster,

That's exactly what I'm doing right now and that's exactly what I'm talking about.

If that'd be directly integrated into Construct, you wouldn't have to bother setting up all these events for variables - You'd just set min and max values during the time you create the variables and Construct would take care of the rest internally.

It'd just be another way to streamline the workflow inside of construct.
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Fri Feb 19, 2010 5:01 am

Oh.

It's just that I've never seen a hard clamp on a variable, anywhere, ever. So that would be really confusing to me :)

Also: it's just one action per variable under a single event. Not really a lot of work to do.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Fri Feb 19, 2010 8:08 am

You might remember Aeal made a variable object way back, perhaps you could get him to a a min/ max to that?
[url:zy0p5rke]http://www.scirra.com/forum/viewtopic.php?f=17&t=3414[/url:zy0p5rke]
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 4 guests