Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Priority Question! (https://forums.graalonline.com/forums/showthread.php?t=69805)

Novo 11-02-2006 11:22 AM

Priority Question!
 
How would I be able to make one function prioritized over another function?

PHP Code:

// Class Human
public function getDance()
  {
  return 
"human_"races::getDance();
  } 

PHP Code:

// Class Races
public function getDance()
  {
  return 
"dance";
  } 

How can I favor the "getDance" function in human over the "getDance" function in Races?

excaliber7388 11-02-2006 08:22 PM

...change the names?
Make them different, and have script determine which one to call?
Of course, there's probably a real answer to your question...but that may work :)

Yen 11-02-2006 09:27 PM

I'm not sure how NPCs determine which class to call from first, so you may want to try joining them in different orders and seeing which is called..

Alternatively, you can call a specific class by doing human::getDance() or races::getDance() instead of just getDance()

Admins 11-03-2006 12:23 AM

The function in the script/class that has been joined first will be called. So if you want that the function of a specific class is called, then join that class first before joining the other classes. You can echo("classes: " @ joinedclasses) to see the order.


All times are GMT +2. The time now is 02:56 AM.

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