Faking an array
eharetea

Faking an array in Hscript.

Since Hscript does not support arrays, you can fake them.

Date Created:Friday December 29th, 2006 03:41 AM
Date Modified:Wednesday July 30th, 2008 02:44 AM

Returns all the point positions of all points in $SOP, in the format that the curve sop likes...ie: 0,0,0 1,1,1 2,2,2 using the point expression to get the values.

Then use opparm on the curves coords parameter to set it to the $coords variable we created.

(opparm is used to change values of parameters.)

The key is to put the $coords variable in parenthesis to get it to work, because its a string with spaces.


set SOP = /obj/model/node

set coords=""

 for 0 to `npoints($SOP)`

       set pex = `point("$SOP","$i","P",0)`

       set pey = `point("$SOP","$i","P",1)`



       set pez = `point("$SOP","$i","P",2)`

       set coords $coords $pex,$pey,$pez " "

 end

opparm /obj/model/curve1 coords ("$coords")




Downloads:
Download: 1.sh 327 B
Download: old.sh 14 KB

Please login or Click Here to register for downloads
Creative Commons License
Faking an array by Dan Lynch
is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
Based on a work at www.3daet.com
Permissions beyond the scope of this license may be available at http://www.3daet.com