![]() |
Joining Classes
When you use the join() function to join a class, what is the precedence of event handlers? Can event handlers share the same events with the NPC?
ex. let's say this is class "class": function onCreated() { setshape(1,32,32); } and call this an npc: join("class"); function onCreated() { setshape(1,64,64); } would the class event handler be called and then the npc event handler? Would they both have the capacity to be called? I'm just wondering because I just decided to propose an action handling structure for Classic, but it would probably encounter this a lot. |
You can just test this yourself.
|
that doesn't mean there's more to it that I can't test for.
|
Quote:
|
Quote:
|
Quote:
|
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:
|
Thank you Stefan <3!!!!!!!!
That's a lot more information than I thought was behind it. |
:o Stefan supports the wiki?
|
Yes I have added a lot of text there, but someone needs to remind Loriel to change the licensing thing
|
All times are GMT +2. The time now is 04:16 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.