Maxscript Unable to Convert Type to Float

Code:

oldvalue = me.value at time (F-1)
newvalue = me.value
if oldvalue >= newvalue
oldvalue + newvalue

It throws the error "unable to convert type undefined to type FLOAT".

If I remover the comparison at line 3 then it works just fine, but if I have that >= statement then it throws the error

I am having trouble accessing a value and if then ing that value

my question in demonstration and detail
www.youtube.com/embed/5_Jcy0LZYaM

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
autodidactdystopia's picture

Here you go

With Song:
http://www8.zippyshare.com/v/70713484/file.html
47mb 0_o
without Song:
http://www60.zippyshare.com/v/66504508/file.html
18kb

I had to put the existing script in the description section otherwise it wouldn't let me save the script

Thank you SO much for your time.

barigazy's picture

...

Try like this

oldvalue = at time (F-1) me.value 
newvalue = me.value
if oldvalue >= newvalue do oldvalue + newvalue

barigazy

autodidactdystopia's picture

I was so exiced that someone answered Thank you :D

Unfortunately it throws the same error.

Unable to convert type undefined to float

http://gyazo.com/414246bc22e4f8907a88c1d3a1bd2d65

I wonder if this is a glitch in max or something or an intentional barrier. 0_0

barigazy's picture

...

Are you try without ".value" ei. uzing only "me" variable

barigazy

barigazy's picture

...

I asume also that U are using Assign Track instead of Assign Controller

barigazy

autodidactdystopia's picture

I am using assign to controller (variable "me")

I have edited to only use the name of the variable like you said
It throws a new error. :D

I think this might be some good info though

it says "no ">=" function for controller: audio float"

http://gyazo.com/7316bf34ce76a65b5a8f89fd4bebedca

Does this mean it doesn't allow the audio float data to be compared on purpose?

barigazy's picture

...

Can you post the file.
Try with Assign Track and pick same audio controller.
But file be useful thought

barigazy

autodidactdystopia's picture

Thank you :D

Will do immediately

I will also include an audio file to sub if you have one laying around then disregard :D

barigazy's picture

...

Ok. I will try tomorrow. My clock shows 4AM :)

barigazy

autodidactdystopia's picture

Here you go :D

With Song:
http://www8.zippyshare.com/v/70713484/file.html
47mb 0_o
without Song:
http://www60.zippyshare.com/v/66504508/file.html
18kb

I had to put the existing script in the description section otherwise it wouldn't let me save the script

Thank you SO much for your time.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.