View Full Version : Maxscript errors
YEAROFTHEOX
04-06-2009, 01:22 PM
Ok this is the first time I've ever used maxscript, and I ran into problems. The Script was just a copy/paste from a tut, but it did not work. I believe I understand the script:
Loop script 49 times
assign piece I want copied a variable
assign new piece's increasing percent along spline position
instance the position controller for the new piece.
(is this right?)
What I don't understand is what the error means. what's position 143, and why didn't value calculate.
poopipe
04-06-2009, 01:37 PM
that big gap after the "=" on the second line probably isn't helping
I did find a pretty natty script that set this stuff up for you recently - probably on scriptspot
YEAROFTHEOX
04-06-2009, 02:19 PM
Thanks for the tip, the only programming I know/knew is BASIC, and that was 20 years ago. :eek: so Maxscript Language is as foreign to me as Mesopatamian. :haha: As for the "natty script", I'm want to figure this out, so I'm still struggling my way through the tutorial but it seems to have Flaws in it.
Still getting errors.
Buzzy
04-06-2009, 05:08 PM
The important part of that error message is Unknown property: "value" in undefined
This tells you that the script is attempting to access a property named 'value' which does not exist.
Looking at the script, there are several issues. (the undefined 'value' property is the least of your worries)
From what I gather, you are attempting to space these objects out evenly along a spline and constrain them to the spline....like a tank tread. Correct?
I am going to assume that the first object already has a path constraint.
It looks like you are making this too complex. Why are you trying to instance the position controller?
Here's how I would write the script.
for i in 1 to 49 do
(
newPiece = copy $Catepillar_Piece_01
newPercent = ((i*2.0)/100.0) as string
newExp = "percent + " + newPercent
paramWire.connect $Catepillar_Piece_01.position.controller[2][#percent] newPiece.position.controller[2][#percent] newExp
)
This should position all of the objects correctly and link them to the first one...so if you animate the first one, all the others will move accordingly.
YEAROFTHEOX
04-06-2009, 05:47 PM
From what I gather, you are attempting to space these objects out evenly along a spline and constrain them to the spline....like a tank tread. Correct?
Correct, But.. It's not me making this complicated.:) I'm following a tutorial, Here (http://www.3dtotal.com/team/Tutorials_3/tank_rig/tank_rig_part2_02.asp), (if anyone wants to look at it) ,and this is the first time i've tackled alot of maxscript/animation and controller concepts, but I have to start learning somewhere.
Ok, Ive read your script, and it I think I understand what your doing, or...how its written. I need to start studying the language more.
Thanks For the replys.
YEAROFTHEOX
04-06-2009, 06:51 PM
Hmmmm... I couldn't get your script to work either Buzzy. I'm not nearly fluent enough to troubleshoot any of this, So I'm going to leave it for another day. Thanks for the help though.
Buzzy
04-06-2009, 07:04 PM
your first piece needs to be named 'Catepillar_Piece_01'
looks like that is not the case and its causing the crash
YEAROFTHEOX
04-06-2009, 08:07 PM
Ahhh touche'.
vBulletin® v3.7.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.