Maximum Values for Variables

This forum is currently in read-only mode.
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • 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.

  • I think the clamp function already does that, not sure though....

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

    Yeah, it would be nice, but I'll just stick to the clamping. :3

  • Yeah, but what if you wanted to make the object global, and you didn't want min, and max set?

  • Try Construct 3

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

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

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

  • 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 =)

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

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

  • You might remember Aeal made a variable object way back, perhaps you could get him to a a min/ max to that?

    http://www.scirra.com/forum/viewtopic.php?f=17&t=3414

  • i think this might be, or be similar to, what 'clamping' is, but try this:

    maximumvalue-(maximumvalue-(currentvalue))

    thats the basic structure... i dont know what context your using this is though... i agree it shud be in the UI though.

  • You might remember Aeal made a variable object way back, perhaps you could get him to a a min/ max to that?

    http://www.scirra.com/forum/viewtopic.php?f=17&t=3414

    lol I forgot I made that

  • It'd just streamline it quite a bit. Right now I have a whole event sheet just to clamp various variables. If the min / max stuff is hard coded into the UI, I wouldn't need to do that.

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