View Full Version : need help with simple script IF. POS.
raining 12-20-2006, 09:50 AM I have a very simple code here...
a = $Box.pos.z/$Box.pos.x
$Sphere.pos.z = a * -$Sphere.pos.x
If I change the BOX position, and click on Script Button, the SPHERE will move.
I want that happen automatically without clicking on script button, so as I move the BOX, the SPHERE should move to.
I read the max script help and I guess it is about controller.... I don’t know how to do that.
please can you write the script for me? :love:
|
|
Deadalus
12-20-2006, 01:49 PM
Raining take a look on CallBack in the help file.
basically it a way to call back (duh) a function at certain condition
for instance
BTW its just an example so their might be typo since i dont have max open right now
function spheremove =
(
a = $Box.pos.z/$Box.pos.x
$Sphere.pos.z = a * -$Sphere.pos.x
)
registerTimeCallback Spheremove
so this will call the function spheremove everytime the Timeslider change.
have fun
-D-
Zbuffer
12-20-2006, 02:21 PM
I think this is a job for WireParameters
mustan9
12-20-2006, 02:24 PM
Oh I won't do that with a callback.
Create a MaxScript controller and assign it to the $Sphere's position controller under the X_Position float controller.
Then create a varaible called B (for box), and assign it to the $Box.
Then assign another varaible for the Sphere's X position as SX.
a = B.pos.z / B.pos/x
return a * -SX
raining
12-21-2006, 08:48 AM
Oh I won't do that with a callback.
Create a MaxScript controller and assign it to the $Sphere's position controller under the X_Position float controller.
Then create a varaible called B (for box), and assign it to the $Box.
Then assign another varaible for the Sphere's X position as SX.
a = B.pos.z / B.pos/x
return a * -SX
I don't know how to create Controller:sad:
Raining take a look on CallBack in the help file.
basically it a way to call back (duh) a function at certain condition
for instance
BTW its just an example so their might be typo since i dont have max open right now
function spheremove =
(
a = $Box.pos.z/$Box.pos.x
$Sphere.pos.z = a * -$Sphere.pos.x
)
registerTimeCallback Spheremove
so this will call the function spheremove everytime the Timeslider change.
have fun
-D-
I'm not making any animation, so time doesn't matter.
and this CallBack seems so comlicated at help fles, I didn't understand any thing..just started learning maxscript:twisted:
I think this is a job for WireParameters
before I ask you guys, I tried with Wire Parameters, But couldn't make it...I tried again and now it seems working.
thank u for your replies.:applause:
a = $BOX.pos.z/$BOX.pos.x
Z_Position = a * -$SPHERE.pos.x
CGTalk Moderation
12-21-2006, 08:48 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.