Hello everybody.
I have set up this simple script to randomize a volume knob.
I have two questions :
Is the correct way to do it? I think it make conflicts with the control of the volume....
I want that when I click the button goes to ON and when I release the click it goes to OFF.
Thanks for any help!
on init
declare ui_button $randomize
declare ui_slider $volume(0,1000000)
end on
on ui_control ($randomize)
set_engine_par($ENGINE_PAR_VOLUME,$mix_level1,0,-1,-1)
if($randomize = 1)
$volume := random(0,1000000)
end if
end on
Random Volume Script problem
- KVRAF
- 24464 posts since 7 Jan, 2009 from Croatia
No, you need to do it the other way around. Randomize first, then set parameter. Also there is no need for that "if". Just add $randomize := 0 at the end of the callback and it'll randomize every time you press the button, then set the button to "off".
