@REQUIRE plugin$[, table]
Please note that although Hollywood loads all plugins automatically on startup,
many plugins require you to call @REQUIRE
before they can be used. This is because
these plugins need custom initialization code which is only run if you explicitly
call @REQUIRE
on them. For example, plugins which install a display adapter will
not be activated unless you call @REQUIRE
on them. Plugins which just add a loader
or saver for additional file formats, however, will be automatically activated even
if you don't call @REQUIRE
on them.
This preprocessor command can also be used to load plugins which have been
exempt from automatic loading at startup. Plugins can be exempt from auto-loading
by prefixing their filename with an underscore character ('_') or by using
the ‘-skipplugins’ console argument. If you want to load a plugin that
has been skipped by the auto loader, just call @REQUIRE
on it from your script
and it will be loaded by the preprocessor. Alternatively, you can also load
these plugins using the LoadPlugin() function.
Starting with Hollywood 6.0 this preprocessor command accepts an optional table
argument which allows you to pass additional parameters to the plugin's initialization
routine. The parameters accepted here vary from plugin to plugin. Please consult
the documentation of the plugin to find out if it accepts any additional parameters
that can be passed to @REQUIRE
. The following two parameters are supported for
every plugin:
Version:
Revision:
Link:
True
, the specified plugin will be linked into your
executable when compiling your script. This will only work if you've set up the
plugin linker infrastructure correctly. See Linking plugins for details.
Make sure to carefully read the licenses of all plugins you link to your
executable because licenses like LGPL affect your project if you statically
link against LGPL software. This tag defaults to False
which means that the plugin
won't be linked. (V7.0)
Please note that you must not specify an absolute path in plugin$
. Just pass
the name of the plugin.
See Plugins for more information on plugins.
@REQUIRE "xml"Declares that your script requires the "xml.hwp" plugin to be installed. Any version will be accepted.
@REQUIRE "myplugin", {Version = 2, Revision = 1, User = "John"}The code above checks for version 2.1 of "myplugin.hwp" and also passes the additional argument "User=John" to the plugin's initialization code.