Vindictii Posted May 15, 2017 Share Posted May 15, 2017 Hi Guys, I am testing this script and I am getting the error "llSetPrimitiveParams error running rule #1: non-integer rule." The script seems to do what is expected, changing parameters, but still throws the error. Any thoughts on what is causing this? For those not testing the script in game, the value for 'DataList' is: [PRIM_DESC,"Description Here", PRIM_TYPE,0,0,<0.000000, 1.000000, 0.000000>,0.000000,<0.000000, 0.000000, 0.000000>,<0.750000, 0.750000, 0.000000>,<0.000000, 0.000000, 0.000000>, PRIM_SLICE,<0,0.88,0>, PRIM_PHYSICS_SHAPE_TYPE,0, PRIM_MATERIAL,3,PRIM_SIZE,<0.200000, 0.100000, 0.070000>, PRIM_TEXTURE,ALL_SIDES,"991641_11601655",<1.000000, 1.000000, 0.000000>,<0.000000, 0.000000, 0.000000>,0.000000, PRIM_TEXT,"TEXT HERE",<0,0,1>,1.000000, PRIM_COLOR,ALL_SIDES,<1.000000, 1.000000, 1.000000>,1.000000, PRIM_FULLBRIGHT,ALL_SIDES,TRUE, PRIM_GLOW,ALL_SIDES,0.000000] string URL ="https://docs.google.com/spreadsheets/d/1fNHznLmXLj0IiB5zWaOWJe5cEcripf9Uo935lAgq9w4/pub?gid=90308717&single=true&output=csv"; key httpkey; list DataList; integer CellCount; integer RowCount; integer ColumnCount; list params; default { state_entry() { httpkey=llHTTPRequest(URL, [] ,"");} http_response(key id, integer status, list meta, string body) { DataList = llParseString2List(body, ["\"","\n"], [] ); llSetPrimitiveParams(DataList); llSay(0,(string)DataList); } } Link to comment Share on other sites More sharing options...
Rolig Loon Posted May 15, 2017 Share Posted May 15, 2017 Oh..... your data are coming in as a string and you are parsing that to make DataList. You are parsing it by using the comma as a separator. That means that, for example, the section that says PRIM_COLOR,ALL_SIDES,<1.000000, 1.000000, 1.000000>,1.000000 which should consist of four elements (PRIM_COLOR, ALL_SIDES, <1.0,1.0,1.0>, and 1.0 ) will actually be parsed into six elements (PRIM_COLOR, ALL_SIDES, <1.0, 1.0, 1.0>, and 1.0 ). By the time DataList is evaluated by llSetPrimitiveParams, it's full of unrecognizable elements. You'll need to come up with a more reliable way to unpack list elements correctly and typecast them as vectors, floats, and integers. 2 Link to comment Share on other sites More sharing options...
arton Rotaru Posted May 16, 2017 Share Posted May 16, 2017 What is this appointed to do <0> ? Link to comment Share on other sites More sharing options...
Innula Zenovka Posted May 16, 2017 Share Posted May 16, 2017 I've read DataList in-world, using this: string URL ="https://docs.google.com/spreadsheets/d/1fNHznLmXLj0IiB5zWaOWJe5cEcripf9Uo935lAgq9w4/pub?gid=90308717&single=true&output=csv"; key httpkey; list DataList; integer CellCount; integer RowCount; integer ColumnCount; list params; default { state_entry() { httpkey=llHTTPRequest(URL, [] ,"");} http_response(key id, integer status, list meta, string body) { DataList = llParseString2List(body, ["\"","\n"], [] ); llSetPrimitiveParams(DataList); integer max = -llGetListLength(DataList); do{ llOwnerSay(llList2String(DataList,max)); } while (++max); } } This is what it returns. Each line is one list element, including the lines that contain a comma only. <0,0.88,0> ,<0>,3, <0.2,0.1,0.07> ,991641_11601655, <1,1,0> , <0,0,0> ,0, <0,0,1> ,1, <1,1,1> ,1,0,Description Here,0,0, <0,1,0> ,0, <0,0,0> , <0.75,0.75,0> , <0,0,0> The commas, apart the ones inside the vectors, are literals, not separators. I'm not completely sure how to strip them out. If you have any control over the source, I'd suggest you send the data to the http_response event using something like a tilde or a bar as the separator, then turn that into a list with llParseString2List, and feed that to llSetPrimitiveParams. But, as you'll have seen, you're not receiving what you think you are. 5 Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now