View Full Version : Simple script controller assignment question
josh3light 11-26-2006, 05:08 PM Hi, I am trying to write a simple script to set a list controller and a script controller on that, then assign the script of the script controller.
When I write this:
picked = $
picked.position.controller=position_list()
picked.position.controller.available.controller=position_script()
picked.position.controller.position_script.script= "[ 1, 1, 1 ]"
There is an error in the last line. Yet, I can't figure out what the syntax should be..
Can anyone point me in the right direction?
Thanks!
|
|
mustan9
11-26-2006, 05:20 PM
I feel your pain. I get confused doing the same things sometimes. It's very frustration, because there is no good debugger for MaxScript.
picked = $
picked.position.controller=position_list()
picked.position.controller.available.controller=position_script()
picked.position.controller[2].script= "[ 1, 1, 1 ]"
mustan9
11-26-2006, 05:22 PM
Forgot to tell you.
You can access list controllers as an array.
josh3light
11-26-2006, 05:28 PM
Hi, I wanted to avoid using the index number and base it on the name if possible. I guess I'll use the index number. Thanks for the quick response!
mustan9
11-26-2006, 05:34 PM
I don't think you can because there could be more then one position_script in the list. So it wouldn't know what one you were referring to.
If you are going to reference this script controller in another part of your code. Try setting it as the active controller, and then later just reference the active one.
This is what i do.
Here is how I would have done it - assigns the controller to a variable, then use the variable to assign or change properties instead of typing in ' picked.position.controller.' again and again...
picked = $
theListCtrl = position_list()
picked.position.controller= theListCtrl
theScriptCtrl = position_script()
theListCtrl.available.controller= theScriptCtrl
theScriptCtrl.script= "[ 1, 1, 1 ]"
CGTalk Moderation
11-26-2006, 06:43 PM
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.