konstantin magnus Posted July 29, 2017 Share Posted July 29, 2017 4@m = ch4('transform'); @test = @m[2][3]; The first line assigns a 4x4 matrix channel to 4@m. I tried different things, but unfortunately the second line does not read the corresponding value from the matrix. How would I do that? Quote Link to comment Share on other sites More sharing options...
f1480187 Posted July 29, 2017 Share Posted July 29, 2017 (edited) Strange. I have a feeling that it should work. Other methods still available: 4@m.zw and getcomp(4@m, 2, 3). The "[2][3]" syntax is documented in the array section. Probably just a bug with the parser. Edited July 29, 2017 by f1480187 Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted July 29, 2017 Author Share Posted July 29, 2017 Thank you. Your methods work! Just for the record: @test = @m[2][3]; throws: /obj/geo1/attribwrangle1/attribvop1/snippet1: Call to undefined array index operator 'matrix[int]', returning one of vector4, vector2, vector, float[], int[], vector4[] or vector[]. (2,25) /obj/geo1/attribwrangle1/attribvop1/snippet1: Ambiguous call to array index operator ''. Candidates are: 'float vector4[int]', 'float vector2[int]', 'float vector[int]', 'float float[][int]' (2,28). Error: Error in VOP 'snippet1'. Quote Link to comment Share on other sites More sharing options...
ikoon Posted July 31, 2017 Share Posted July 31, 2017 (edited) Even for arrays, I cannot read the value directly from @. So I define temporary "non" @ variable like this: vector array[] = v[]@atrail;vector position = array[i]; Even in the documentation, they don't acces directly the @ attribute. They say float a = m3[0][1]; // not @m3[0][1] EDIT: Now I have tried to read directly the v[]@atrail and my "workaround" is not needed. I think it was needed. Sorry for the confusion. Edited July 31, 2017 by ikoon Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.