# I need help ASAP!

**URL:** https://forum.highend3d.com/t/i-need-help-asap/356
**Category:** Maya
**Tags:** mel
**Created:** [January 31, 2013, 1:50am UTC](https://forum.highend3d.com/t/i-need-help-asap/356 "2013-01-31T01:50:40Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![aschwe21](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/a/bc8723/32.png) [@aschwe21](https://forum.highend3d.com/u/aschwe21)
#### Post date: [January 31, 2013, 1:50am UTC](https://forum.highend3d.com/t/i-need-help-asap/356/1 "2013-01-31T01:50:40Z")

</div>

so... I have this programming project due , and I just can't seem to fix this bug.

--this is the script I'm using:

file -f -new;

string $window = `window -t "General Conditionions" -mnb false -mxb false         -widthHeight 400 110`;  
columnLayout -adjustableColumn true;  
&nbsp;&nbsp;&nbsp; text " ";  
&nbsp;&nbsp;&nbsp; text "Please ensure the following conditions are met:";  
&nbsp;&nbsp;&nbsp; text "1.) SmoothShade all is turned on";  
&nbsp;&nbsp;&nbsp; text "2.) High Quality is turned on";  
&nbsp;&nbsp;&nbsp; text "Thank you. Press ESC to pause playback.";  
&nbsp;&nbsp;&nbsp; text " ";  
&nbsp;&nbsp;&nbsp; button -l "Close Window" -command ("deleteUI -window " + $window) -w 55;  
showWindow;

// set up spiral process string  
global proc string spiral ( float $ht, float $radius, float $numRounds )  
{  
string $cone[] = `cone -ch off -po 0 -p 0 0.2 0 -hr 0.5 -r 1 -ax 0 -1 0`;  
scale $radius $ht $radius $cone[0];

string $cos = `curveOnSurface -d 1 -uv 0.0 0.0 -uv 1.0 ($numRounds*2.5) $cone[0]`;  
string $duplicatedCrv[] = `duplicateCurve -ch off $cos`;  
delete $cos;  
delete $cone[0];  
return $duplicatedCrv[0];  
}

// creating basic spirals and reversing direction  
// this is to have the particles move from the bottom to the top  
spiral(40, 10, 10);  
spiral(40, -10, 10);  
select -r duplicatedCurve1;  
rename "curve1" ;  
reverseCurve -ch off -replaceOriginal on curve1;  
select -r duplicatedCurve2;  
rename "curve2" ;  
reverseCurve -ch off -replaceOriginal on curve2;

select -r curve1 curve2;

string $selection\_list[] = `ls -selection`;

string $curveSelected;  
for ($curveSelected in $selection\_list)

{

string $curveSelected = $selection\_list[0];  
float $startOffset = 0.1;  
float $speed = (1.0 / 16.0);

offsetCurve -d $startOffset -n ($curveSelected + "guide");

float $startPoint[] = `pointOnCurve -pr 0 -p $curveSelected`;  
float $startTangent[] = `pointOnCurve -pr 0 -nt $curveSelected`;  
float $startGuide[] = `pointOnCurve -pr 0 -p ($curveSelected + "guide")`;  
float $startNormal[];

$startNormal[0] = $startGuide[0] - $startPoint[0];   
$startNormal[1] = $startGuide[1] - $startPoint[1];   
$startNormal[2] = $startGuide[2] - $startPoint[2];

// set up emitter and its attributes  
emitter -pos $startGuide[0] $startGuide[1] $startGuide[2]  
&nbsp;&nbsp; &nbsp;-dx $startTangent[0] -dy $startTangent[1] -dz $startTangent[2]   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -n ($curveSelected + "emitter") -spd 0.0  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -type dir;

particle -n ($curveSelected + "particles");  
setAttr ($curveSelected + "particlesShape.expressionsAfterDynamics") true;  
select -r ($curveSelected + "particlesShape");  
addAttr -ln "speed" -at "float";  
setAttr ($curveSelected + "particlesShape.speed") $speed;  
addAttr -ln "scaleOffset" -at "float";  
setAttr ($curveSelected + "particlesShape.scaleOffset") $startOffset;

connectDynamic -em ($curveSelected + "emitter")   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ($curveSelected + "particles");

parent ($curveSelected + "emitter") $curveSelected;

string $mainCurveInfoNode = `pointOnCurve -ch on     -pr 0 $curveSelected`;  
string $guideCurveInfoNode = `pointOnCurve -ch on     -pr 0 ($curveSelected + "guide")`;

// create expression for the particles movement alond the curve  
string $exprString =

&nbsp;&nbsp;&nbsp; "float $curve\_param = " + $curveSelected + "particlesShape.age \* " +   
&nbsp;&nbsp; &nbsp;$curveSelected + "particlesShape.speed;\n" +

&nbsp;&nbsp;&nbsp; "setAttr " + $mainCurveInfoNode + ".parameter $curve\_param;\n" +  
&nbsp;&nbsp;&nbsp; "setAttr " + $guideCurveInfoNode + ".parameter $curve\_param;\n" +

&nbsp;&nbsp;&nbsp; "float $pos[] = `getAttr " + $mainCurveInfoNode + ".position`;\n" +  
&nbsp;&nbsp;&nbsp; "float $tan[] = `getAttr " + $mainCurveInfoNode +                                     ".normalizedTangent`;\n" +   
&nbsp;&nbsp;&nbsp; "float $normEnd[] = `getAttr " + $guideCurveInfoNode +                                     ".position`;\n" +

&nbsp;&nbsp;&nbsp; "float $norm[];\n" +   
&nbsp;&nbsp;&nbsp; "$norm[0] = $normEnd[0] - $pos[0];\n" +  
&nbsp;&nbsp;&nbsp; "$norm[1] = $normEnd[1] - $pos[1];\n" +  
&nbsp;&nbsp;&nbsp; "$norm[2] = $normEnd[2] - $pos[2];\n" +

&nbsp;&nbsp;&nbsp; "vector $posvec = \<\>;\n" +  
&nbsp;&nbsp;&nbsp; "vector $tanvec = \<\>;\n" +  
&nbsp;&nbsp;&nbsp; "vector $normvec = unit(\<\>);\n" +  
&nbsp;&nbsp;&nbsp; "vector $norm2vec = cross($tanvec, $normvec);\n" +

&nbsp;&nbsp;&nbsp; $curveSelected + "particlesShape.position = $posvec + \n" +

// The oscillations are muliplied by "particlesShape.age"  
// to move the particles further away from the curves as they age.  
// '(frame/10)/time' magnifies that change in distance.

&nbsp;&nbsp;&nbsp; "(" + $curveSelected +   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "particlesShape.scaleOffset \* $normvec \* " +  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $curveSelected + "particlesShape.age \* (frame/10)/time \* cos(" +  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $curveSelected + "particlesShape.age\*20)) + \n" +

&nbsp;&nbsp;&nbsp; "(" + $curveSelected +   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "particlesShape.scaleOffset \* $norm2vec \* " +  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $curveSelected + "particlesShape.age \* (frame/10)/time \* sin(" +  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $curveSelected + "particlesShape.age\*20));\n";

// set up color ramp window for custom use  
// ramp defaults are defined below

string $ramp1 = `createNode ramp`;

window -t "Ramp Settings" -mxb false;  
columnLayout;  
&nbsp;&nbsp;&nbsp; rampColorPort -node $ramp1;  
showWindow;

// define ramp color defaults  
setAttr ramp1.colorEntryList[1].position 0.166;  
setAttr ramp1.colorEntryList[1].color -type double3 1 1 0;  
setAttr ramp1.colorEntryList[3].position 0.333;  
setAttr ramp1.colorEntryList[3].color -type double3 0 1 0;  
setAttr ramp1.colorEntryList[4].position 0.501;  
setAttr ramp1.colorEntryList[4].color -type double3 0 1 1 ;  
setAttr ramp1.colorEntryList[2].position 0.667;  
setAttr ramp1.colorEntryList[5].color -type double3 1 0 1;  
setAttr ramp1.colorEntryList[5].position 0.833;  
setAttr ramp1.colorEntryList[6].position 1;

// create arrayMapper and connect it&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;  
radial -pos 0 0 0 -name pushIn -m -2 -att 0 -typ 0 -mxd -1 -vsh   
sphere -vex 1-vof 0 0 0 -vsw 360 -tsr 0.5 ;  
scale 10 10 10;  
connectDynamic -f pushIn ($curveSelected + "particlesShape");  
addAttr -ln "rgbPP" -dt vectorArray ($curveSelected + "particlesShape");  
arrayMapper -mt ramp1 -target ($curveSelected + "particlesShape")  
&nbsp;&nbsp;&nbsp; -destAttr rgbPP -inputV rgbVPP;&nbsp; &nbsp;

// add distance expression to ramp,   
// so particles change color a they move away from the emitter  
dynExpression -s "rgbVPP = mag( position )/(frame/time);"   
&nbsp;&nbsp;&nbsp; -rbd ($curveSelected + "particlesShape");

// set up Point Size slider  
setAttr ($curveSelected + "particlesShape.particleRenderType") 3;  
addAttr -is true -ln "pointSize" -at long   
&nbsp;&nbsp;&nbsp; -min 1 -max 10 -dv 5 ($curveSelected + "particlesShape");

// Attach expression string to the particle object:  
dynExpression -rad -s $exprString ($curveSelected + "particles");  
dynExpression -c -s $exprString ($curveSelected + "particles");

}

// Set playback range and begin playback from min to max//  
currentTime 0;  
playbackOptions -minTime 0sec -maxTime 16sec -loop once;  
play -f true;

--- sorry, it's really long...  
so, I'm having trouble with the offestCurve part (\>offsetCurve -d $startOffset -n ($curveSelected + "guide")😉. It keep coming up with an error " line 53: Too many arguments.&nbsp; Expected 1, found 0."

anybody know what I can do to fix it?
