Other languages
[Previous] [Main] [Next]

As well as its own scripting language, obmm also lets you script using iron python, C# and visual basic. In this case, access to obmm's scripting functions is provided via an interface.

C# and vb scripts must define a class named 'Script' which inherits from 'IScript' in the root namespace. It must contain a method called 'Execute' which takes an IScriptFunctions interface as a parameter. Both of these interfaces exist in the OblivionModManager.Scripting namespace. For example, a basic C# script would look like:

using OblivionModManager.Scripting;

class Script : IScript {
   public void Execute(IScriptFunctions sf) {
      sf.Message("This is a C# script");

Unlike C# and vb, python scripts don't require any special setup.

obmm attempts to enforce security restrictions on these scripts, but as I'm not certain of their safety, python, C# and vb scripts are disabled by default. If you want to enable them, you can do so from the options menu.