Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-02-2006, 11:22 AM
Novo Novo is offline
[TServerDeveloper]
Join Date: Jun 2006
Posts: 448
Novo will become famous soon enough
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?
Reply With Quote
  #2  
Old 11-02-2006, 08:22 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
...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
Reply With Quote
  #3  
Old 11-02-2006, 09:27 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
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()
Reply With Quote
  #4  
Old 11-03-2006, 12:23 AM
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 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.
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 12:29 PM.


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