Thread: Classes?
View Single Post
  #2  
Old 12-16-2003, 08:48 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Nope.
You can put scripts into units that are called classes. NPCs can join these classes using the 'join classname;' statement, obviously (which should be put outside of any block). These classes are then linked with the NPCs joining them as if they were a part of the main NPC's script. The NPC can call functions from the class, and the other way around, and events in the class get executed just as if you had placed them directly in the NPC.
The advantage is easier maintenance, and less memory use because code is not duplicated for multiple NPCs.
Reply With Quote