Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

random script problem

3 REPLIES 3
Reply
Message 1 of 4
jackietsteh
317 Views, 3 Replies

random script problem

Hi guys, i have problem with my random script, hoping someone can help me out.

 

i have create 2 spinners ( 1 spinner for set minimum value, 1 spinner for set maximum value) and 1 button for click to process in my rollout, when i set 1500 for minimum value and 3000 for maximum value and press the button, it work! except the random is incorrect, some value are below 1500, and some are above 3000??

 

how can i make the random value according or in between the range value?(in this example in between 1500 to 3000 ) and not below it or above it...

 

sorry about my poor english.

 

Regards,

Jackie

Best regards,
Jackie Teh
Portfolio: http://www.coroflot.com/jackieteh
Youtube Channel:https://www.youtube.com/user/jackieteh
3 REPLIES 3
Message 2 of 4

Hello,

 

Not sure what are you using but random() should do the trick.

From documentation:

random <number> <number>

Returns a pseudo random number inclusively between the two arguments. Return value type is the type of the first argument.

Message 3 of 4

Hi jeziorsk.jakub, thank you for reply, i have solved by put "zero" for the minimum value, don't know why cannot set minimum value to 1500....

my idea for the script is i want to limit the minimum and maximum range in between 1500 and 3000, but it not work?? any idea??
Best regards,
Jackie Teh
Portfolio: http://www.coroflot.com/jackieteh
Youtube Channel:https://www.youtube.com/user/jackieteh
Message 4 of 4

Hello,

 

I cannot replicate it. This line

random 1500 3000

 gives me strictly values in [1500, 3000] range. Maybe values you pass are not valid?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report