eugene.litvinov Posted April 2, 2011 Share Posted April 2, 2011 I use next code: Unigine::Vector matrix[0]; for (int i = 0; i < 30; i++) { matrix.append(new Unigine::Vector()); for (int j = 0; j < 30; j++) { matrix[i].append(new Unigine::Vector()); for (int k = 0; k < 30; k++) { matrix[i][j].append(2); } } } this causes error: source/scripts/game/Matrix.h:141: Interpreter::parse_user_array_variable(): unknown operation ".append(2)" for array variable instead of it we must use: Unigine::Vector(matrix[i][j]).append(2); // that's all right When I want get value from Vector, I use: int b = matrix[0][0][0]; it causes error too: source/scripts/game/Matrix.h:148: Interpreter::parse_expression(): unknown token '[' in "matrix[0][0][0]" expression instead of it I must use: Unigine::Vector a = matrix[0][0]; int b = a[0]; This is not very convenient, and, maybe, it's a bug? Link to comment
serega Posted April 4, 2011 Share Posted April 4, 2011 No, It's not bug. This line of code will cause an error too: matrix[i].append(new Unigine::Vector()); You can use this: Unigine::Vector matrix2 = matrix[i]; matrix2.append(new Unigine::Vector()); Link to comment
eugene.litvinov Posted April 4, 2011 Author Share Posted April 4, 2011 No, It's not bug. This line of code will cause an error too: matrix[i].append(new Unigine::Vector()); I use this code right now, all works. Check it. Link to comment
serega Posted April 4, 2011 Share Posted April 4, 2011 Yes, you are right! :) I did not notice it: Unigine::Vector matrix[0]; Link to comment
Recommended Posts