Thread: Joining Classes
View Single Post
  #7  
Old 12-17-2005, 05:13 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
The onCreated() part is called for each joined class, if you pre-join a class (put the join outside of any function) or you join a class in an onCreated() function.
Other events only choose the first event handler they find. That makes it possible to overwrite the event handler of a class. If you overwrite the event handler and want still that the original event handler is executed, call classname::function yourself, like
PHP Code:
function onCreated() {
  
join("myitems");
  
// no need to call myitems::onCreated() here since it is executed anyway
}
function 
onPlayerEnters() {
  echo(
"player enters!");
  
myitems::onPlayerEnters();

We should may be add a wiki page for the Graal script classes.
Reply With Quote