Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

error on GetPrimitiveParams

DeepestBlue Luna
Registered User
Join date: 9 Aug 2006
Posts: 13
03-18-2007 16:59
I'm trying to set the primitive params of a prim from a notecard list, and am constantly getting the following message:- Child: llSetPrimitiveParams error running rule #1: non-integer rule.

The script with th command in is:-

integer t;
integer n;
integer p;
default
{
state_entry ()
{
llSay(0, "Touched.";);

}
on_rez(integer start_param)
{

p=start_param;
llGetNotecardLine("MODEL_PARAMS",p);

}

dataserver(key requested, string data)
{

llWhisper(0,"Child" +"," + (string)data + "/";);
llSetPrimitiveParams((list)data);
}
}



The notecard listings are:-

3, 0, <0.5, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 0.25, 0.0>, <0.0, 0.0, 0.0>, <0.0, 1.0, 0.0>, <1.0, 1.0, 0.0>, 1.0, 0.0, 0.0
2, 0, <0.5, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 0.25, 0.0>, <0.0, 0.0, 0.0>, <0.0, 1.0, 0.0>, <1.0, 1.0, 0.0>, 1.0, 0.0, 0.0
4, 0, <0.5, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 0.25, 0.0>, <0.0, 0.0, 0.0>, <0.0, 1.0, 0.0>, <1.0, 1.0, 0.0>, 1.0, 0.0, 0.0
1, 0, <0.5, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 0.25, 0.0>, <0.0, 0.0, 0.0>, <0.0, 1.0, 0.0>, <1.0, 1.0, 0.0>, 1.0, 0.0, 0.0

Ive tried these with semicolons as well as the following formats:-

PRIM_TYPE, PRIM_TYPE_TORUS, 0, <0.5, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 0.25, 0.0>, <0.0, 0.0, 0.0>, <0.0, 1.0, 0.0>, <1.0, 1.0, 0.0>, 1.0, 0.0, 0.0
PRIM_TYPE, PRIM_TYPE_TORUS, 0, <0.5, 1.0,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-18-2007 18:14
All data brought in from a notecard comes in as a string...

...therefore, your script is reading the string: "3, 0, <0.5, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 0.25, 0.0>, <0.0, 0.0, 0.0>,"...etc.

You will have to typecast everything before setting a primitive's parameters.

The easiest way to work that out would be through an llCSV2List and then a bunch of:

llList2Integer
llList2Vector

etc.
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
DeepestBlue Luna
Registered User
Join date: 9 Aug 2006
Posts: 13
03-18-2007 18:17
Thanks Kenn, will follow that through....
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
03-19-2007 05:03
But note, llList2Vector on a list element of type string will always return ZERO_VECTOR. You'll have to read from the list as a string and explicitly typecast to a vector:

CODE

vector SomeVect = (vector)llList2String( StringList, 1 );


Rotations have the same problem.
DeepestBlue Luna
Registered User
Join date: 9 Aug 2006
Posts: 13
03-20-2007 02:09
Thanks for this. Just when you think youve sorted it, you get a nasty twist! Its working fine now, finally managed to import Vectorwarks into SL