Plugin manifest (temp page)

Sam edited this page Dec 1, 2017 · 1 revision

Specifying which plugins to load (new, unfinished)

Plugins are loaded from a file that lists all plugins. This is called a plugin manifest. Listed in this file are all plugins to load, in the form of individual files, directories to search and other manifest to include.

Plugin configuration files are named name.plugin.xml, where name is the name you want to give the plugin; although this doesn't have to match the name specified in the configuration file, it is recommended to use similar names. This name is used in the manifest when adding specific plugins and is used to uniquely identify plugins during loading.

A plugin's configuration file could look like this:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
	<!--The name that will be used by administrative console commands. Keep it simple and short, but unique-->
	<name value="Killer Plugin"/>

	<!--A short description for the plugin.-->
	<description value="A plugin that will blow you away"/>

		Uncomment this to enable debug features
		Scripts are included in the order that they are specified here, so including this first enabled the debug features used by the main script
	<script name=">
	<script name=""/>
		Minimum lifetime for the plugin. Controls when plugins are unloaded or reloaded when a server operator requests it.
		Available options are:
		HOTRELOADABLE: can be unloaded/reloaded at any time.
		MAP: unloaded/reloaded when a new map starts.
		SERVER: once loaded, will never be unloadable or reloadable. Always loaded when a new map starts.
		If not specified, defaults to HOTRELOADABLE. Plugins can specify the minimum required lifetime for themselves, and some API calls may increase the lifetime as needed to ensure that API functionality works as expected.
	<lifetime value="HOTRELOADABLE"/>

	<!--Console command namespace to prepend to any commands registered by this plugin. Used to distinguish between identically named commands in different plugins.-->
	<concommandns value="foo"/>

		Command line to pass to the plugin. The plugin will be able to retrieve these as a list of keyvalue pairs
		Allows for more advanced configuration of the plugin in a manner specific to the plugin itself
		Plugins can choose to process this for cvars, a helper function is provided in "scripts/util/", named cvar::ProcessCommandline.

		arguments is optional, if not specified it defaults to an empty command line
		Quoted values are considered as a single token
		Note that quotes must be added using &quot; due to XML parsing limitations
	<commandline arguments=".mycvar=&quot;Hello World!&quot; .mycommand=&quot;disable_kills&quot;"/>

Note that the name specified in the configuration file must also be unique, if two or more plugins have conflicting names the first listed plugin is used, and the other ignored.

Manifest files are named name.pluginmanifest.xml, where name is the name of the manifest, used with the manifest element to add others.

The format of the manifest is as follows:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
	<!--Add a single plugin-->
	<file name="cool_boy/KillerPlugin"/>

	<!--Look for all *.plugin.xml files in the given directory-->
	<directory path="cool_guy"/>

	<!--Add a plugin and pass additional command line arguments that are appended to any specified in the config file-->
	<file name="cool_girl/ComplexPlugin">
			Specifies a command line for the plugin

			arguments is optional, if not specified it defaults to an empty command line
			action is optional and can be one of the following:
			replace: Default. If a command line is specified, even if empty, it will replace the command line specified in the plugin configuration file
			append: Append arguments to the existing arguments, with a space automatically added.
			prepend: Prepend arguments to the existing arguments, with a space automatically added.
			merge: Replace any existing arguments with keys matching those specified here, append remaining arguments.
		<commandline arguments="remove_all_weapons=true" action="append"/>

	<!--Add all plugins listed in the given manifest.-->
	<manifest name="some_other_manifest"/>

Any number of files and directories may be listed in the file. If multiple plugins have the same name, the duplicates are ignored.

Plugins are loaded after all manifests have been loaded.

You cannot add the same manifest multiple times; if a manifest includes a manifest already included elsewhere -or one of its parents- it will be ignored.

By default, plugins are loaded from the file default.pluginmanifest.xml. This file is located in the main mod directory.

To load another file, set the cvar as_plugin_manifest_file to the name of another file. This allows you to host multiple servers using the same mod installation while using different plugins on them.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.