ModAPI Hub keyboard_arrow_right Mods keyboard_arrow_right ModManager

ModManager

Immaanuel
Subscribe to this mod
Like
Many thanks and kudos to community member Moritz. This mod is based on his hard work for the mod DebugMode.

ModManager is a mod for Green Hell, which aims to be a tool for players who would like to be able to use ModAPI mods in multiplayer when not being host. It can also help troubleshoot mod keybinding issues, as it shows a list of currently loaded mods.

YT demo for host manager


Host Manager:
  • Press Alpha0 or the key configurable in ModAPI to open/close the main mod screen
  • Get/set game info settings
  • Enable/disable both Debug Mode / supported mods in multiplayer with the related switch
  • Cheat options
    When enabled, switch any cheat off / on:
    • God mode
    • Ghost mode
    • One shot AI
    • One shot constructions
    • No item decay
    • Instant build
  • Quickly switch from singleplayer to multiplayer or vice versa;
  • Multiplayer Manager
    • Get multiplayer session info
    • Kick player from session (feel free to test)
    • Send message to player

Client Manager:
  • Press Alpha0 or the key configurable in ModAPI to open/close the main mod screen
  • Send max. 6 chat request to host to allow mods in multiplayer or to enable Debug Mode with the related switch
  • When cheat options are enabled, switch any cheat off / on:
    • God mode
    • Ghost mode
    • One shot AI
    • One shot constructions
    • No item decay
    • Instant build

Mod list
Get based on the ModAPI runtime configuration XML file:
  • A list with all currently loaded ModAPI mods
  • Mod Info
    See more details of a selected mod's runtime config;

Guide for modders
Get mod list and mod details from runtime
ModManager.Data.Interfaces exposes interfaces for used types to create the mod list based on the runtime configuration file.
  • IConfigurableMod
  • IConfigurableModButton

ModManager.Data.Modding exposes base classes for these types.
  • ConfigurableMod
  • ConfigurableModButton

ModManager.Managers exposes a ready to use manager for these types.
  • ModdingManager with methods
    Code:
    public interface IModdingManager { List GetModList(); string[] GetModNamesList(); IConfigurableMod GetSelectedMod(string modID); KeyCode GetShortcutKey(string modID, string buttonID); bool HasConflicts(); }

Adding multiplayer features to a mod

Modders could simply add multiplayer possibility to their mod by importing the ModManager library into their modding project and adding the following properties to the mod class:
Code:
public bool IsModActiveForMultiplayer { get; private set; } public bool IsModActiveForSingleplayer => ReplTools.AmIMaster();

Then, use these properties to activate or deactivate a mod feature for multiplayer:
Code:
private void CreateMultiplayerOption() { if (IsModActiveForSingleplayer || IsModActiveForMultiplayer) { using (new GUILayout.VerticalScope(GUI.skin.box)) { MultiPlayerOption = GUILayout.Toggle(MultiPlayerOption,$"{nameof(MultiPlayerOption)}", GUI.skin.toggle); } } else { using (new GUILayout.VerticalScope(GUI.skin.box)) { GUILayout.Label("Multiplayer option is only for single player or when host", GUI.skin.label); GUILayout.Label("Host can activate using ModManager.", GUI.skin.label); } } }

Note, that the value for the property IsModActiveForMultiplayer is depending on the permission set through ModManager.
Modders will need to add an event listener that toggles the IsModActiveForMultiplayer value to support this behaviour:
Code:
public void Start() { ModManager.ModManager.onPermissionValueChanged += ModManager_onPermissionValueChanged; } private void ModManager_onPermissionValueChanged(bool optionValue) { IsModActiveForMultiplayer = optionValue; }

The result would be for players:
  • to use the multiplayer feature automatically, when host sets the permission
  • to be able to request the host by chat to use your mod in multiplayer

The client player should send a chat message !requestMods
The host player should then send a chat message !allowMods{randomly generated number}

Should support Debug Mode - one chat request for all is the goal ;)
File ModManager-1.0.3.9-d70a0f568c9fe999a2ac6d6476e50c1d.mod
Compatible 2.4.2
Version 1.0.3.9

Buttons
Name Description Button
Press shortcut key to open the main mod screen. D0
videogame_asset Green Hell label Other
  • Version 1.0.3.9 (2.4.2) 29. Apr 2023
    44.54 kB
    16,106 downloads
  • Version 1.0.3.8 (2.4.2) 27. Apr 2023
    29.61 kB
    96 downloads
  • Version 1.0.3.7 (2.4.2) 25. Apr 2023
    29.27 kB
    61 downloads
  • Version 1.0.3.5 (2.4.2) 20. Apr 2023
    23.71 kB
    147 downloads
  • Version 1.0.3.4 (2.1.3) 09. Oct 2021
    15.65 kB
    21,317 downloads
  • Version 1.0.3.3 (1.8.1) 01. Dec 2020
    14.06 kB
    12,180 downloads
  • Version 1.0.3.2 (1.8.1) 30. Nov 2020
    13.99 kB
    85 downloads
  • Version 1.0.3.0 (1.8.1) 24. Oct 2020
    13.25 kB
    1,097 downloads
  • Version 1.0.2.8 (1.8.1) 04. Oct 2020
    12.71 kB
    675 downloads
  • Version 1.0.2.5 (1.8.1) 12. Sep 2020
    11.06 kB
    689 downloads
  • Version 1.0.2.4 (1.8.1) 07. Sep 2020
    10.22 kB
    164 downloads
  • Version 1.0.2.1 (1.8.1) 30. Aug 2020
    9.68 kB
    162 downloads
  • Version 1.0.2.0 (1.8.1) 21. Aug 2020
    5.86 kB
    281 downloads
  • Version 1.0.0.0 (1.8.1) 15. Aug 2020
    5.34 kB
    275 downloads

Download

Downloading ModAPI...

1 Your download is ready!

Extract the .zip file to
C:/Program Files (x86)/
Or choose another location. Do not extract it inside the Steam game folder.

2 Start ModAPI.exe

3 Enable mods

4 Start the game

You can launch your game regularly through Steam without ModAPI after the first launch.

FAQ