[aps]gnat 28 Posted December 16, 2007 A script to force the seabed lower .... Can someone explain to me why this simple script doesn't work ? LowerSeaBed <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> private["_params", "_doc", "_area", "_vertices", "_test", "_returnValues", "_tempX", "_tempY", "_tempZ"]; // gets document and area _params = _this; _doc = _params select 0; _area = _params select 1; // gets the vertices under the area _vertices = _doc getVerticesUnder _area; // ------------------------ // gets the vertices number // ------------------------ _nVertices = count _vertices; _newVertices = []; { _tempX = _x select 0; _tempY = _x select 1; _tempZ = _x select 2; if(_tempZ <= -18) then { _tempZ = _tempZ - 50; _newVertices = _newVertices + [[_tempX, _tempY, _tempZ]]; }; } forEach _vertices; _newVertices setVerticesTo _doc; Error comes like this which seems useless. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _doc = _params select 0; _area = _params select 1; _vertices = _doc getVerticesUnder _area; _nVertices = count _vertices; _newVertices = []; { _tempX = _x select 0; _tempY = _x select 1; _tempZ = _x select 2; if(_tempZ <= -18) then { _tempZ = _t> Â Error Share this post Link to post Share on other sites
Linker Split 0 Posted December 16, 2007 Sorry, sensless, i din't see the "forEach" command Share this post Link to post Share on other sites
[aps]gnat 28 Posted December 17, 2007 Nobody ? BTW, that is my whole script there, do you have to have a Dialog for every script maybe? Share this post Link to post Share on other sites