Graal Forums  

Go Back   Graal Forums > Development Forums > Tech Support
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #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
  #2  
Old 10-11-2005, 03:37 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:35 PM.


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