Coder Social home page Coder Social logo

sutandotsukai181 / modorganizer-basic_games Goto Github PK

View Code? Open in Web Editor NEW

This project forked from modorganizer2/modorganizer-basic_games

0.0 0.0 0.0 363 KB

Mod Organizer 2 meta-plugin to make creating game plugins easier and faster.

License: MIT License

Python 99.72% CMake 0.28%

modorganizer-basic_games's Introduction

Mod Organizer 2 - Simple Games Plugin

Mod Organizer 2 meta-plugin to make creating game plugins easier and faster.

Why?

In order to create a MO2 game plugin, one must implement the IPluginGame interface. This interface was initially designed for Bethesda games such as the Elder Scrolls or Fallout series and thus contains a lot of things that are irrelevant for most games.

The goal of this meta-plugin is to allow creating game plugins for "basic" games by providing a very simple python class.

How to install?

Download the archive for your MO2 version and extract it directly into your MO2 plugins folder.

  • Mod Organizer 2.3.2: Download and extract in your plugins/ folder (see below).
  • Mod Organizer 2.4: Basic games is included in Mod Organizer 2.4.
    • If you want to use new game plugins that have not been included in the release, download the latest archive and extract the files in the existing basic_games folder, overwriting existing files.

Important: Extract the folder in your plugins folder, not the individual files. Your plugins folder should look like this:

dlls/
plugins/
  data/
  basic_games/
    games/
      __init__.py
      ...
    __init__.py
    basic_game.py
    ...
  bsa_extractor.dll
  ...
ModOrganizer.exe

You can rename modorganizer-basic_games-xxx to whatever you want (e.g., basic_games).

Supported games

Game Author File Extras
The Binding of Isaac: Rebirth — STEAM EzioTheDeadPoet game_thebindingofisaacrebirth.py
  • profile specific ini file
Darkest Dungeon — GOG / STEAM erri120 game_darkestdungeon.py
  • save slot parsing
  • mod data checker
Dark Messiah of Might & Magic — STEAM Holt59 game_darkmessiahofmightandmagic.py
  • save game preview
Dark Souls — STEAM Holt59 game_darksouls.py
Divinity: Original Sin (Classic) — STEAM LostDragonist game_divinityoriginalsin.py
  • save game preview
Divinity: Original Sin (Enhanced Edition) — STEAM LostDragonist game_divinityoriginalsinee.py
  • save game preview
  • mod data checker
Dragon's Dogma: Dark Arisen — GOG / STEAM EzioTheDeadPoet game_dragonsdogmadarkarisen.py
Dungeon Siege II — GOG / STEAM Holt59 game_dungeonsiege2.py
  • mod data checker
Kingdom Come: Deliverance — GOG / STEAM Silencer711 game_kingdomcomedeliverance.py
  • profile specific cfg files
Mirror's Edge — GOG / STEAM EzioTheDeadPoet game_mirrorsedge.py
Mount & Blade II: Bannerlord — GOG / STEAM Holt59 game_mountandblade2.py
  • mod data checker
No Man's Sky - GOG / Steam EzioTheDeadPoet game_nomanssky.py
S.T.A.L.K.E.R. Anomaly — MOD Qudix game_stalkeranomaly.py
  • mod data checker
Stardew Valley — GOG / STEAM Syer10, Holt59 game_stardewvalley.py
  • mod data checker
STAR WARS™ Empire at War: Gold Pack - GOG / STEAM erri120
Valheim — STEAM Zash game_valheim.py
  • mod data checker
  • overwrite config sync
  • save game support (no preview)
The Witcher: Enhanced Edition - GOG / STEAM erri120 game_witcher1.py
  • save game parsing (no preview)
The Witcher 3: Wild Hunt — GOG / STEAM Holt59 game_witcher3.py
  • save game preview
Yu-Gi-Oh! Master Duel — STEAM The Conceptionist & uwx game_masterduel.py
Zeus and Poseidon — GOG / STEAM Holt59 game_zeusandpoiseidon.py
  • mod data checker

How to add a new game?

You can create a plugin by providing a python class in the games folder.

Note: If your game plugin does not load properly, you should set the log level to debug and look at the mo_interface.log file.

You need to create a class that inherits BasicGame and put it in a game_XX.py in games. Below is an example for The Witcher 3 (see also games/game_witcher3.py):

from PyQt5.QtCore import QDir
from ..basic_game import BasicGame


class Witcher3Game(BasicGame):

    Name = "Witcher 3 Support Plugin"
    Author = "Holt59"
    Version = "1.0.0a"

    GameName = "The Witcher 3"
    GameShortName = "witcher3"
    GameBinary = "bin/x64/witcher3.exe"
    GameDataPath = "Mods"
    GameSaveExtension = "sav"
    GameSteamId = 292030

    def savesDirectory(self):
        return QDir(self.documentsDirectory().absoluteFilePath("gamesaves"))

BasicGame inherits IPluginGame so you can override methods if you need to. Each attribute you provide corresponds to a method (e.g., Version corresponds to the version method, see the table below). If you override the method, you do not have to provide the attribute:

from PyQt5.QtCore import QDir
from ..basic_game import BasicGame

import mobase


class Witcher3Game(BasicGame):

    Name = "Witcher 3 Support Plugin"
    Author = "Holt59"

    GameName = "The Witcher 3"
    GameShortName = "witcher3"
    GameBinary = "bin/x64/witcher3.exe"
    GameDataPath = "Mods"
    GameSaveExtension = "sav"
    GameSteamId = 292030

    def version(self):
        # Don't forget to import mobase!
        return mobase.VersionInfo(1, 0, 0, mobase.ReleaseType.final)

    def savesDirectory(self):
        return QDir(self.documentsDirectory().absoluteFilePath("gamesaves"))

List of valid keys

Name Description IPluginGame method Python
Name Name of the plugin name str
Author Author of the plugin author str
Version Version of the plugin version str or mobase.VersionInfo
Description Description (Optional) description str
GameName Name of the game, as displayed by MO2 gameName str
GameShortName Short name of the game gameShortName str
GameNexusName Nexus name of the game (Optional, default to GameShortName) gameNexusName str
GameValidShortNames Other valid short names (Optional) validShortNames List[str] or comma-separated list of values
GameNexusId Nexus ID of the game (Optional) nexusGameID str or int
GameBinary Name of the game executable, relative to the game path binaryName str
GameLauncher Name of the game launcher, relative to the game path (Optional) getLauncherName str
GameDataPath Name of the folder containing mods, relative to game folder dataDirectory
GameDocumentsDirectory Documents directory (Optional) documentsDirectory str or QDir
GameSavesDirectory Directory containing saves (Optional, default to GameDocumentsDirectory) savesDirectory str or QDir
GameSaveExtension Save file extension (Optional) savegameExtension str
GameSteamId Steam ID of the game (Optional) steamAPPId List[str] or str or int
GameGogId GOG ID of the game (Optional) gogAPPId List[str] or str or int
GameOriginManifestIds Origin Manifest ID of the game (Optional) originManifestIds List[str] or str
GameOriginWatcherExecutables Executables to watch for Origin DRM (Optional) originWatcherExecutables List[str] or str

You can use the following variables for str:

  • %DOCUMENTS% will be replaced by the standard Documents folder.
  • %GAME_PATH% will be replaced by the path to the game folder.
  • %GAME_DOCUMENTS% will be replaced by the value of GameDocumentsDirectory.

Extra features

The meta-plugin provides some useful extra feature:

  1. Automatic Steam, GOG, and Origin game detection: If you provide Steam, GOG, or Origin IDs for the game (via GameSteamId, GameGogId, or GameOriginManifestIds), the game will be listed in the list of available games when creating a new MO2 instance (if the game is installed via Steam or GOG).
  2. Basic save game preview: If you use the Python version, and if you can easily obtain a picture (file) for any saves, you can provide basic save-game preview by using the BasicGameSaveGameInfo. See games/game_witcher3.py for more details.

Game IDs can be found here:

modorganizer-basic_games's People

Contributors

al12rs avatar anyoldname3 avatar ddbb07 avatar dekart811 avatar deorder avatar erri120 avatar eziothedeadpoet avatar falseilyu avatar holt59 avatar isanae avatar jaylcypher avatar ketsuban avatar laughinghyena279 avatar lostdragonist avatar modulozero avatar patchier avatar qudix avatar silencer711 avatar stpauljim avatar tottoko99 avatar track8regret avatar yoryan avatar zashin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.