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:
Client Manager:
Mod list
Get based on the ModAPI runtime configuration XML file:
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.
ModManager.Data.Modding exposes base classes for these types.
ModManager.Managers exposes a ready to use manager for these types.
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:
Then, use these properties to activate or deactivate a mod feature for multiplayer:
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:
The result would be for players:
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 ;)
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.4.0-3901ea62a5d058e8ecd5ac6fa3c01435.mod |
Compatible | U#21.2 |
Version | 1.0.4.0 |
Buttons | ||
Name | Description | Button |
---|---|---|
Press shortcut key | to open the main mod screen. | D0 |
videogame_asset
Green Hell
label
Other