playMaker

Author Topic: Convert float to... float[SOLVED]  (Read 2974 times)

Raknill

  • Playmaker Newbie
  • *
  • Posts: 20
Convert float to... float[SOLVED]
« on: October 23, 2016, 10:13:01 PM »
So, I thought this might be easy (you've probably heard that before), but I'm hitting a roadblock.

Basically, I have a slider that has it's value set between 40-80. I want to control an animation using Set Animation Time, which requires a value between 0-1.

I'm looking to sync the animation with the slider, basically taking the sliders float value of 40-80 and converting that to a 0.0-1.0 to control the animation. 

I tried messing with Convert Float to Int, and then converting that back to a float, but I'm not getting the synchronous behavior I need. I think this should be relatively simple, but I'm here to learn.

Thanks in advance for any help, let me know if more explanation is needed.
« Last Edit: October 25, 2016, 02:49:28 AM by jeanfabre »

Raknill

  • Playmaker Newbie
  • *
  • Posts: 20
Re: Convert float to... float
« Reply #1 on: October 24, 2016, 12:59:22 AM »
Just thought I'd simplify my question; I want one float that is clamped between 40-80 to control the interpolation of another float that is clamped between 0-1.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Convert float to... float
« Reply #2 on: October 24, 2016, 06:26:37 AM »
Hi,
If you are using a ugui slider you can use the action "U Gui Slider Get Normalized Value"
If you can not find the action you should get the 'ugui proxy full' package from the Ecosystem

4ppleseed

  • Full Member
  • ***
  • Posts: 226
Re: Convert float to... float
« Reply #3 on: October 24, 2016, 11:58:14 AM »
Just thought I'd simplify my question; I want one float that is clamped between 40-80 to control the interpolation of another float that is clamped between 0-1.

I think you want sample curve:
https://hutonggames.fogbugz.com/default.asp?W241


Raknill

  • Playmaker Newbie
  • *
  • Posts: 20
Re: Convert float to... float
« Reply #4 on: October 24, 2016, 09:40:21 PM »
Hi,
If you are using a ugui slider you can use the action "U Gui Slider Get Normalized Value"
If you can not find the action you should get the 'ugui proxy full' package from the Ecosystem

This was exactly what I needed, very easy to implement. I had an animated element that I wanted to control in accordance with the slider (an "awareness meter" and an animated eyeball for a stealth game).

All works great now, appreciate it.