Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   foo[0].add(bar) and a showpoly thing (https://forums.graalonline.com/forums/showthread.php?t=61693)

Dach 10-11-2005 05:35 AM

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.

Admins 10-11-2005 03:37 PM

Showpoly with 2 points will draw a line, with >=3 points it will draw a polygon, which is not visible if it doesn't have a volume.
The sub-array update can be a problem yes, need to fix that.


All times are GMT +2. The time now is 06:57 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.