Esports Godfather

Esports Godfather

Not enough ratings
Easy guide to develop module for Esports Godfather
By Zae
This guide primarily covers how to create functional mods (hereinafter referred to as plugins) and how to publish them to the Steam Workshop.
3
2
2
   
Award
Favorite
Favorited
Unfavorite
_
This is translated from the Chinese version:
https://steamproxy.com/sharedfiles/filedetails/?id=3293121941
Environment
To develop plugins, you need:

  1. Esports Godfather - as the plugin needs to rely on game files for compilation;

  2. Esports Godfather: ModTool (电竞教父: 开发工具) - this tool will be included with the main game and can be found under the "Software" category in your library;

  3. .NET SDK 8.0+[dotnet.microsoft.com]

  4. An IDE for coding, such as Visual Studio Code[code.visualstudio.com]

  5. You can also install ILSpy[github.com], which allows you to browse the decompiled code of Esports Godfather.
Creating Plugin
First create the module project:


Once created, go to the project. Double-click [Module Information (not created)] to create a module description:
(This file is used to record the list of plugins included in the module)


Click [Module - Add - Generate API Project] to create the plugin project;

Click ④ to select the directory where you want to place the plugin; note that this directory is the source code directory and SHOULD NOT be placed under Content.
(In the screenshot, a folder named MyPlugin is created under the Src directory of the module project)

Click [Generate Project] to create the plugin project:


Once generated, the tool should show the plugin item just created and explorer to the folder:

Coding
The plugin script inherits the ModScrptBase class, and this type provides the following callbacks:

OnModInit(ModInitContext context)
Called during plugin initialization, where you can configure custom options through context
OnSettingObjectLoaded(SettingObjectLoadedContext context)
Called when the setting source is loaded, where you can modify existing settings or add new ones
OnGameEntered(Game game)
Called after loading a save or starting a new game
OnClubAffairEntered(ClubAffair affair)
Called each time you enter a club affair
OnBattleEntered(Battle battle)
Called when entering a battle
OnBattleExited(Battle battle)
Called when a battle ends

Currently, most plugins add new settings such as equipment and cards to the game through the OnSettingObjectLoaded callback, and then modify existing season rules in OnGameEntered (such as changing the hero pool, unlocking equipment, etc.).

When developing, it is recommended to use ILSpy to view the game code in order to understand the internal logic of the game.

Please refer to more examples in the community.

Compilation

Plugin scripts need to be compiled into DLL files to be loaded by game. And the generated DLL files should be placed under Content/Dll/[AssemblyName].

If your project is generated through the DevTool, you can enter the following command in the console to generate DLL files to the folder above:

dotnet publish -p:PublishProfile=PublishToModFolder

Or you double-click PublishToModFolder.cmd file in the plugin directory to execute the above command.

After execution, confirm the generated DLL file under Content/Dll:

Testing and Publishing
Testing

First, check that your plugin is correctly displayed in the development tool, and that the list includes the compiled Dll file:


There is a Mods directory under the game save file folder for local mods. You can copy the mod directory (Content) to the above Mods directory. After copying, the directory structure is as follows:


Then start the game, click the Mod button, and you can see the plugin being loaded:


Note: You can change the name of the Content directory copied to the Mods folder to avoid conflicts between multiple local mods; remember to copy it to this directory after each compilation.

Publishing

Once ready, you can upload the mod to the Steam Workshop as shown below:

- Click on [Module - Publish] to enter the publishing page; if you have published before, you can edit the published information or upload new content here.

- For the first publication, you need to input the item title, tags, description, and specify an item icon.

- If you are unsure about the effect after uploading, you can adjust the visibility to [Hidden], and make further modifications on the Steam Workshop page before making it public.


Finally click the publish button to upload the mod. After the successful message, it may take minutes before your mod is visible on the Steam Workshop.