IPluginGame¶
-
class
mobase.IPluginGame¶ Bases:
mobase.IPluginBase classes for game plugins.
Each game requires a specific game plugin. These plugins were initially designed for Bethesda games, so a lot of methods and attributes are irrelevant for other games. If you wish to write a plugin for a much simpler game, please consider the basic_games plugin: https://github.com/ModOrganizer2/modorganizer-basic_games
Methods Summary
- returns
The current list of active Creation Club plugins.
- returns
The list of esp/esm files that are part of known DLCs.
- returns
The name of the default executable to run (relative to the game folder).
- returns
The path to the directory containing data (absolute path).
Detect the game.
- returns
The directory of the documents folder where configuration files and such for this game reside.
- returns
A list of automatically discovered libraries that can be force loaded with executables.
- returns
A list of automatically discovered executables of the game itself and tools surrounding it.
feature(feature_type)Retrieve a specified game feature from this plugin.
Retrieve the list of game features implemented for this plugin.
- returns
The directory containing the game installation.
gameIcon()- returns
The icon representing the game.
gameName()- returns
The name of the game (as displayed to the user).
- returns
The name of the game identifier for Nexus.
- returns
The short name of the game.
Retrieve the list of variants for this game.
- returns
The version of the game.
- returns
The name of the launcher executable to run (relative to the game folder), or an
iniFiles()- returns
The list of INI files this game uses. The first file in the list should be the
initializeProfile(directory, settings)Initialize a profile for this game.
- returns
True if this game has been discovered as installed, False otherwise.
listSaves(folder)List saves in the given directory.
- returns
The load order mechanism used by this game.
looksValid(directory)Check if the given directory looks like a valid game installation.
Retrieve the Nexus game ID for this game.
Retrieve the Nexus mod ID of Mod Organizer for this game.
- returns
The list of plugins that are part of the game and not considered optional.
Retrieve primary alternative ‘short’ names for this game.
- returns
The directory where save games are stored.
setGamePath(path)Set the path to the managed game.
setGameVariant(variant)Set the game variant.
- returns
The sort mechanism for this game.
Retrieve the Steam app ID for this game.
Retrieve the valid ‘short’ names for this game.
Methods Documentation
-
abstract
CCPlugins()¶ - Returns
The current list of active Creation Club plugins.
- Return type
List[str]
-
abstract
DLCPlugins()¶ - Returns
The list of esp/esm files that are part of known DLCs.
- Return type
List[str]
-
abstract
binaryName()¶ - Returns
The name of the default executable to run (relative to the game folder).
- Return type
str
-
abstract
dataDirectory()¶ - Returns
The path to the directory containing data (absolute path).
- Return type
QDir
-
abstract
detectGame()¶ Detect the game.
This method is the first called for game plugins (before init()). The following methods should work properly after the call to detectGame() (and before init()):
gameName()
isInstalled()
gameIcon()
gameDirectory()
dataDirectory()
gameVariants()
looksValid()
See IPlugin.init() for more.
-
abstract
documentsDirectory()¶ - Returns
The directory of the documents folder where configuration files and such for this game reside.
- Return type
QDir
-
abstract
executableForcedLoads()¶ - Returns
A list of automatically discovered libraries that can be force loaded with executables.
- Return type
-
abstract
executables()¶ - Returns
A list of automatically discovered executables of the game itself and tools surrounding it.
- Return type
List[ExecutableInfo]
-
feature(feature_type)¶ Retrieve a specified game feature from this plugin.
- Parameters
feature_type – The class of feature to retrieve.
- Returns
The game feature corresponding to the given type, or None if the feature is
not implemented.
- Return type
~GameFeatureType
-
featureList()¶ Retrieve the list of game features implemented for this plugin.
Python plugin should not implement this method but _featureList().
- Returns
A mapping from feature type to actual game features.
- Return type
Dict[Type[~GameFeatureType], ~GameFeatureType]
-
abstract
gameDirectory()¶ - Returns
The directory containing the game installation.
- Return type
QDir
-
abstract
gameIcon()¶ - Returns
The icon representing the game.
- Return type
QIcon
-
abstract
gameName()¶ - Returns
The name of the game (as displayed to the user).
- Return type
str
-
abstract
gameNexusName()¶ - Returns
The name of the game identifier for Nexus.
- Return type
str
-
abstract
gameShortName()¶ - Returns
The short name of the game.
- Return type
str
-
abstract
gameVariants()¶ Retrieve the list of variants for this game.
If there are multiple variants of a game (and the variants make a difference to the plugin), like a regular one and a GOTY-edition, the plugin can return a list of them and the user gets to chose which one he owns.
- Returns
The list of variants of the game.
- Return type
List[str]
-
abstract
gameVersion()¶ - Returns
The version of the game.
- Return type
str
-
abstract
getLauncherName()¶ - Returns
The name of the launcher executable to run (relative to the game folder), or an
empty string if there is no launcher.
- Return type
str
-
abstract
iniFiles()¶ - Returns
The list of INI files this game uses. The first file in the list should be the
‘main’ INI file.
- Return type
List[str]
-
abstract
initializeProfile(directory, settings)¶ Initialize a profile for this game.
The MO app does not yet support virtualizing only specific aspects but plugins should be written with this future functionality in mind.
This function will be used to initially create a profile, potentially to repair it or upgrade/downgrade it so the implementations have to gracefully handle the case that the directory already contains files.
- Parameters
directory – The directory where the profile is to be initialized.
settings – The parameters for how the profile should be initialized.
-
abstract
isInstalled()¶ - Returns
True if this game has been discovered as installed, False otherwise.
- Return type
bool
-
abstract
listSaves(folder)¶ List saves in the given directory.
- Parameters
folder – The folder to list saves from.
- Returns
The list of game saves in the given folder.
- Return type
List[ISaveGame]
-
abstract
loadOrderMechanism()¶ - Returns
The load order mechanism used by this game.
- Return type
-
abstract
looksValid(directory)¶ Check if the given directory looks like a valid game installation.
- Parameters
directory – Directory to check.
- Returns
True if the directory looks like a valid installation of this game, False otherwise.
- Return type
bool
-
abstract
nexusGameID()¶ Retrieve the Nexus game ID for this game.
Example: For Skyrim, the Nexus game ID is 110.
- Returns
The Nexus game ID for this game.
- Return type
int
-
abstract
nexusModOrganizerID()¶ Retrieve the Nexus mod ID of Mod Organizer for this game.
- Example: For Skyrim SE, the mod ID of MO2 is 6194. You can find the mod ID in the URL:
- Returns
The Nexus mod ID of Mod Organizer for this game.
- Return type
int
-
abstract
primaryPlugins()¶ - Returns
The list of plugins that are part of the game and not considered optional.
- Return type
List[str]
-
abstract
primarySources()¶ Retrieve primary alternative ‘short’ names for this game.
This is used to determine if a Nexus (or other) download source should be considered as a primary source for the game so that it is not flagged as an alternative one.
- Returns
The list of primary alternative ‘short’ names for this game, or an empty list.
- Return type
List[str]
-
abstract
savesDirectory()¶ - Returns
The directory where save games are stored.
- Return type
QDir
-
abstract
setGamePath(path)¶ Set the path to the managed game.
This is called during instance creation if the game is not auto-detected and the user has to specify the installation location. This is not called if the game has been auto-detected, so isInstalled() should call this.
- Parameters
path – Path to the game installation.
-
abstract
setGameVariant(variant)¶ Set the game variant.
If there are multiple variants of game (as returned by gameVariants()), this will be called on start with the user-selected game variant.
- Parameters
variant – The game variant selected by the user.
-
abstract
sortMechanism()¶ - Returns
The sort mechanism for this game.
- Return type
-
abstract
steamAPPId()¶ Retrieve the Steam app ID for this game.
If the game is not available on Steam, this should return an empty string.
If a game is available in multiple versions, those might have different app ids. The plugin should try to return the right one
- Returns
The Steam app ID for this game. Should be empty for games not available on steam.
- Return type
str
-
abstract
validShortNames()¶ Retrieve the valid ‘short’ names for this game.
This is used to determine if a Nexus download is valid for the current game since not all game variants have their own nexus pages and others can handle downloads from other nexus game pages and should be allowed to do so (e.g., you can install some Skyrim LE mod even when using Skyrim SE).
The short name should be considered the primary handler for a directly supported game for purposes of auto-launching an instance.
- Returns
The list of valid short names for this game.
- Return type
List[str]