View Single Post
  #14  
Old 05-19-2007, 05:25 AM
MegaMasterX90875 MegaMasterX90875 is offline
Retired Graalian (2009)
MegaMasterX90875's Avatar
Join Date: Feb 2006
Location: North Carolina
Posts: 132
MegaMasterX90875 is on a distinguished road
Send a message via AIM to MegaMasterX90875
Quote:
Originally Posted by Stefan View Post
Today the npcservers have been updated. Here some of the updates:

- /style works again
- improved /scripthelp which also lists object types that match
- fixed int(random(lowerlimit, upperlimit)) which sometimes reached upperlimit (when the random number was too close to the upperlimit it was rounding to upperlimit)
- scripts can now access image files (png, gif, jpeg) and also files inside the levels folder if the npcserver has the rights for that
- if you call a function of another object which is non-public, then it will display that the function is not accessible, instead of saying that the function doesn't exist
- graal script now supports function objects: this will print "param: 123"

PHP Code:
function onCreated() {
  
this.func this.func1;
  
this.func(123);
}
function 
func1(param) {
  echo(
"param: " param);

You can also do this, but keep care to add a semicolon behind the function declaration:

PHP Code:
this.func = function() {
  echo(
"nameless function");
}; 
This is only working on serverside, it will work on clientside with the next Graal version.
There is a protection against unsetting functions, since often scripts use the same name for functions and variables. If the variable is not linking to a function but the script contains a function with that name, then it will use the function defined in the script instead. You can however link to another function.
Yet another moment where GS2 has unlimited possibilities opened. Thanks Stefan, WHEEEEEEEE
__________________
Mess with the best, Die like the rest.



Reply With Quote