![]() |
Nuclide
Software Development Kit for id Technology (BETA)
|
This is a delegate class for individual active AddonC plugins.
These are dynamic server-side plugins, added on top of the current game. They can also be removed at any time. This is similar to MetaMod. Just integrated right into the SDK.
You can load a plugin using a series of commands.
Attempts to load the addon plugin at <gamedir>/plugins/[name].dat
.
Unloads the named addon plugin.
Lists the active addon plugins.
Here's an example "Hello world!" style plugin.
It is located under src/plugins/helloworld.qc
:
Because the engine does not allow us to unload progs, you have to handle any shutdown logic yourself, plus remove any entities from the game if the game no longer needs them.
Left = class method, right = name of the callback function for you to implement in progs.
ncAddonDelegate::Load = Plug_Load
ncAddonDelegate::Shutdown = Plug_Shutdown
ncAddonDelegate::ConsoleCommand = Plug_ConsoleCommand
ncAddonDelegate::ClientCommand = Plug_ClientCommand
ncAddonDelegate::PlayerConnect = Plug_PlayerConnect
ncAddonDelegate::PlayerDisconnect = Plug_PlayerDisconnect
ncAddonDelegate::PlayerSpawn = Plug_PlayerSpawn
ncAddonDelegate::PlayerDeath = Plug_PlayerDeath
ncAddonDelegate::NPCDeath = Plug_NPCDeath
The underlying return values and parameters are inherited from its class counter-part.
Public Member Functions | |
void | ncAddonDelegate (void) |
virtual void | Load (void) |
Overridable: Called when the plugin gets loaded. More... | |
virtual void | Shutdown (void) |
Overridable: Called when the plugin gets unloaded. More... | |
virtual bool | ConsoleCommand (ncPlayer, string) |
Overridable: Called when the server issues a console command. More... | |
virtual bool | ClientCommand (ncClient, string) |
Overridable: Called when a client issues a client command. More... | |
virtual void | PlayerConnect (ncPlayer) |
Overridable: Called when a ncPlayer joins the server. More... | |
virtual void | PlayerDisconnect (ncPlayer) |
Overridable: Called when a ncPlayer leaves the server. More... | |
virtual void | PlayerSpawn (ncPlayer) |
Overridable: Called when a ncPlayer spawns, called sometime after joining. More... | |
virtual void | PlayerDeath (ncPlayer, ncEntity, ncEntity, string) |
Overridable: Called when a ncPlayer dies in the game. More... | |
virtual void | NPCDeath (ncActor, ncEntity, ncEntity) |
Overridable:: Called when an NPC gets killed. More... | |
virtual void | LinkProgs (void) |
Called to link functions defined within multiprogs with the delegate's methods. More... | |
nonvirtual ncAddonDelegate | CreateFromProgs (string addonName, float progsHandle) |
Creates an addon delegate from a progs handle. More... | |
nonvirtual void | Close (void) |
Closes the addon. More... | |
nonvirtual string | Name (void) |
Returns the name of the addon. More... | |
void ncAddonDelegate::ncAddonDelegate | ( | void | ) |
|
virtual |
Overridable: Called when a client issues a client command.
void ncAddonDelegate::Close | ( | void | ) |
Closes the addon.
|
virtual |
Overridable: Called when the server issues a console command.
ncAddonDelegate ncAddonDelegate::CreateFromProgs | ( | string | addonName, |
float | progsHandle | ||
) |
Creates an addon delegate from a progs handle.
addonName | is the name of the addon. Required for look-up purposes. |
progsHandle | is the valid handle of a progs loaded via addprogs(). |
|
virtual |
Called to link functions defined within multiprogs with the delegate's methods.
|
virtual |
Overridable: Called when the plugin gets loaded.
string ncAddonDelegate::Name | ( | void | ) |
Returns the name of the addon.
Generally the name (without extension) of the progs.
Overridable:: Called when an NPC gets killed.
|
virtual |
Overridable: Called when a ncPlayer joins the server.
|
virtual |
Overridable: Called when a ncPlayer dies in the game.
|
virtual |
Overridable: Called when a ncPlayer leaves the server.
|
virtual |
Overridable: Called when a ncPlayer spawns, called sometime after joining.
|
virtual |
Overridable: Called when the plugin gets unloaded.