Slider value question

  • Hi everyone,

    Is it possible to set up a condition where slider value is changed by +1 or -1 instead of just equal to or more/less than a certain number. There is an option which says 'on changed', but there is no value to enter with this one.

    At the moment I've set up dummy conditions where slider value goes up by 200 up to a maximum value of 1000, and each step it changes the temperature of the engine.

    The only thing I can think of is making 1000 events for each number from 1 - 1000 to alter the temperature.

    Thanks for any help.

    Obi

  • Not sure I understand your question.

    I made a little demo, hope it helps.

    https://www.dropbox.com/s/6qyxgl8y1hcgl ... .capx?dl=0

  • Hey Obi554!

    I didn't understand exactly what you'e trying either.

    When you change the slider, it will adjust its value to the value corresponding to the current position of the slider on the bar in relation to max and min values. So, if you have a slider with min 20, max 100 and step 10, you'll have a slider with 9 possible positions and you can change from each to any other of them. Sliders are not used to increase something step-by-step.

    You can force the slider to only go up or down one step at a time, but I wouldn't recommend, since it feels very weird and counter-intuitive. Another option would be to use the slider just as a feedback object, instead of an input object, and control its values with buttons. But, again, I'm not sure what you're trying to acomplish here.

    The capx below has both situations I explained above. The first slider let's you change it, but limits the change to one step up or down. The second one doesn't let you interact directly with it, but, instead, is controled by the buttons.

    https://www.dropbox.com/s/2ej7ti9kb9phh ... .capx?dl=0

    Hope this helps. Cheers!

  • Not sure I understand your question.

    I made a little demo, hope it helps.

    https://www.dropbox.com/s/6qyxgl8y1hcgl ... .capx?dl=0

    I'm unable to open your file in my version of construct: 244.

    I downloaded and installed the beta release: 247 but now it doesn't allow me to load the run layout using chrome, as I get an error message.

    Are u able to save the project so it's compatible with 244? I think i'm gonna downgrade.

  • Here is the file for version 244:

    https://www.dropbox.com/s/no1fe3ln9rp2g ... .capx?dl=0

    You can change the browser used for preview in project properties. If it doesn't work in chrome, try another browser.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey Obi554!

    I didn't understand exactly what you'e trying either.

    When you change the slider, it will adjust its value to the value corresponding to the current position of the slider on the bar in relation to max and min values. So, if you have a slider with min 20, max 100 and step 10, you'll have a slider with 9 possible positions and you can change from each to any other of them. Sliders are not used to increase something step-by-step.

    You can force the slider to only go up or down one step at a time, but I wouldn't recommend, since it feels very weird and counter-intuitive. Another option would be to use the slider just as a feedback object, instead of an input object, and control its values with buttons. But, again, I'm not sure what you're trying to acomplish here.

    The capx below has both situations I explained above. The first slider let's you change it, but limits the change to one step up or down. The second one doesn't let you interact directly with it, but, instead, is controled by the buttons.

    https://www.dropbox.com/s/2ej7ti9kb9phh ... .capx?dl=0

    Hope this helps. Cheers!

    Hi,

    Thanks for your detailed message <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" />

    What I want to be able to do is:

    When I change the slider value, it will directly alter the value of another separate dependant variable. So if my min and max are 0 - 1000 on the slider, I would like to be able to move it in the smallest possible increments so I can get a really cool changing of values on the dependant variable.

    So far (i'm a complete beginner), the only coding I understand and am able to achieve is the following:

    If slider = number > make other variable value = number

    I'd prefer something like:

    If slider goes up by x > make other variable value go up/down by x

  • Here is the file for version 244:

    https://www.dropbox.com/s/no1fe3ln9rp2g ... .capx?dl=0

    You can change the browser used for preview in project properties. If it doesn't work in chrome, try another browser.

    Thank you so much!

    Will test it out and get back to you.

  • Here is the file for version 244:

    https://www.dropbox.com/s/no1fe3ln9rp2g ... .capx?dl=0

    You can change the browser used for preview in project properties. If it doesn't work in chrome, try another browser.

    Sorry I don't use Chrome, I meant Mozilla. <img src="{SMILIES_PATH}/icon_e_confused.gif" alt=":?" title="Confused" /> <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" />

  • Just change the Preview Browser to Firefox then. It's in project properties.

  • [quote:33z4b3e6]If slider goes up by x > make other variable value go up/down by x

    You can get the slider value at any time with the expression SliderBar.value

    I'm using it in my demo to output temperature as text, you can assign it to a variable or use in formula.

  • Hi guys sorry for the late reply!

    Just wanna say it worked fantastically, and thank you so much dop2000 for your file - it was really helpful to be able to see someone else's code for the first time and learn directly from it. Taught me several things which are invaluable.

    Thanks again!

    Actually today I got the message that I can no longer create new events because my game is too large, and I have to purchase the full version lol.

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