View Single Post
  #1  
Old 10-11-2005, 05:35 AM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
foo[0].add(stuff) and recursive nodes in showpoly

Firstly,
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
foo = new[2][0];
  
myfunction();
}
function 
onMouseDown() {
  
player.chat "YOU USED YOUR MOUSE!";
  
myfunction();
}
function 
myfunction() {
  
foo[0].add(4);
  
foo[0].add(2);
  echo(
"TEST"@foo);

This will output TEST"4,2",0 to the f2 window every time you press a mousebutton, despite the fact it should keep adding 4,2 to foo. This has been tested with
foo = {{0},{0}};
foo = new[2];
and
foo = {0,0};
just to be sure. All of the above work when the adds are done without using functions, so it is clearly something peculiar about the fact that this is done in the function.


Secondly,
showpoly(0,{playerx,playery,playerx+5,playery,play erx,playery});
Will not do anything, while
showpoly(0,{playerx,playery,playerx+5,playery});
works fine, as it should. Now, you may be wondering why I have an extra "playerx,playery" in the first, I shall explain:
In order to show a segmented line via showpoly with but one showpoly object (the usefulness of this practice should be obvious) one must retrace part of the path in the showpoly.
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial

Last edited by Dach; 10-11-2005 at 07:01 AM..
Reply With Quote