Skip to content

GamemodeDescriptor

public sealed class GamemodeDescriptor

Namespace SideHustle

Everything a gamemode mod tells Side Hustle about itself. Pass one of these to API.Register (usually from your mod’s OnInitializeMelon). Only Id, DisplayName and the launch callback for your Support mode are required; every multiplayer field is optional so a singleplayer-only mod registers minimally.

Example

A multiplayer World gamemode with one host setting:

var d = new GamemodeDescriptor
{
Id = "you.yourmode",
DisplayName = "Your Mode",
Support = GamemodeSupport.Multiplayer,
Surface = GamemodeSurface.World,
DownloadUrl = "https://github.com/you/yourmode",
OnHostMultiplayer = Start,
OnJoinMultiplayer = Start,
OnExitToHub = Stop,
HostSettings = new[]
{
new SettingDescriptor { Key = "len", Label = "Round length", Type = SettingType.Slider,
Min = 10, Max = 120, Step = 10, WholeNumbers = true, Default = "30", Unit = "s" }
}
};
API.Register(WorldHygiene.CleanWorld(d));
public string Id

Stable, unique key (e.g. “doodesch.inkubator”). Used for de-duplication and, later, lobby filtering.

Value 3-48 characters of a-z, 0-9, ’.’, ’_’ or ’-’, e.g. “doodesch.prophunt”. Another form logs a warning and still registers. Compared exactly, case included. Required: null or empty makes API.Register throw.

public string DisplayName

Name shown in the gamemode list.

Value E.g. “PropHunt”. Null or empty shows Id instead.

public string Description

Short one-line description shown under the name.

public string Author

Author shown in the list (optional).

public Sprite Icon

Icon sprite for the list row. If null, Side Hustle builds one from IconTex.

public Texture2D IconTex

Icon texture; Side Hustle wraps it in a Sprite when Icon is null.

public string IconResource

Added in 3.0.0

Name of a PNG embedded in your mod’s assembly (the manifest resource name, e.g. “YourMod.icon.png”). Used only when Icon and IconTex are both null: the hub loads it into IconTex the first time it draws the row, so you need no Unity image code. A name that does not resolve is logged together with the resource names the assembly does have. Since 3.0.0.

Embed the PNG as <AssemblyName>.hub-icon.png (csproj: <EmbeddedResource Include="icon.png" LogicalName="YourMod.hub-icon.png" />) and the hub finds it without this field, and also while the boot gate holds your mod back, when none of your code has run yet.

public GamemodeSupport Support = GamemodeSupport.Singleplayer

Type: GamemodeSupport

Which play modes this gamemode supports.

public GamemodeSurface Surface = GamemodeSurface.MenuSpace

Type: GamemodeSurface

Whether the gamemode runs as a menu overlay or needs the game world.

public string DownloadUrl

Added in 2.0.0

Where to get this mod (its Thunderstore/Nexus/GitHub page). When set, Side Hustle advertises this gamemode’s live public lobbies to players who do NOT have it installed, with a “Download Mod” button that opens this page. Null = still advertised by name (see Advertise) but with no download link. Only links on known mod hosts (Thunderstore, Nexus, GitHub) are opened.

Value An absolute https link on thunderstore.io, nexusmods.com, github.com or doodesch.de, or a subdomain of one, e.g. “https://github.com/you/yourmode”. Any other link is shown but never opened.

public bool Advertise = true

Added in 2.0.0

When true (default), this gamemode’s PUBLIC lobbies are advertised in the Side Hustle menu of players who do not have it installed, so they can discover it. Set false to stay invisible to non-installers - e.g. a work-in-progress gamemode you do not want discovered during development. This only affects that discovery listing; the gamemode is always fully hostable and joinable by people who have it.

public bool BlockVanillaQuests = false

Added in 1.5.0

When true, Side Hustle blocks every vanilla quest from starting for the duration of the session (a Harmony prefix on Quest.Begin). Keeps a clean slate - no tutorial/dealer quest chains, phone prompts, or NPC waypoints fighting the gamemode. Quests are host-authoritative so this matters on the host. Default false.

public string[] AllowedQuestTitles

Added in 1.5.0

Quest titles EXEMPT from BlockVanillaQuests - e.g. a gamemode’s own guide quest. Their Quest.Begin is allowed through even while vanilla quests are blocked. Default none.

Value Each entry is compared exactly, case included, with the quest’s title, e.g. “PropHunt” for PropHunt’s guide quest. Null or empty entries are skipped.

public bool SkipIntro = false

Added in 1.5.0

When true, Side Hustle skips the new-game intro cutscene + character-creator (sets the player’s HasCompletedIntro before the intro gate runs), so players drop straight into the world. Default false.

public bool ForceNewGame = false

Added in 1.5.0

Has no effect. Side Hustle boots a clean scratch world (clears the scratch folder and copies DefaultSave) on every World launch anyway, and never touches a real save slot. Kept so mods that set it still load. Default false.

public bool BlockSaveDuringSession = false

Added in 1.5.0

When true, Side Hustle blocks every vanilla save (both SaveManager.Save overloads) for the duration of the session. A gamemode runs on a throwaway scratch world and mutates transient state (teleports, locked doors, swapped appearances); persisting that to disk would corrupt the save. The Save button still appears but does nothing. Saving works normally again once the session ends. Default false.

public bool SuppressNpcCombatReactions = false

Added in 1.5.0

When true, Side Hustle stops NPCs from reacting to hunter/player GUNFIRE for the session (no panic/flee/cover, no civilian police-call, no WANTED pursuit, no bystander weapon-impact) - so a gamemode can fire weapons without derailing the NPC schedule. Purely subtractive (prefixes on NPCAwareness NoiseEvent/VisionEvent for the gunshot/discharge cases, NPC.SendImpact, and the ranged-weapon aim scan); every other NPC awareness (footsteps, deals, vandalism) is untouched. Default false.

public bool DisableVanillaPlayerDeath = false

Added in 1.5.0

When true, Side Hustle cancels all vanilla PLAYER death for the session (prefix on PlayerHealth.TakeDamage + SendDie) - players cannot die to real weapon damage while the session runs. Use this when elimination is the gamemode’s own concern (e.g. a host-validated catch) and vanilla death + medical-centre respawn would eject a player from the play area. Damage to NPCs/props is untouched. Default false.

public Action<LaunchContext> OnLaunchSingleplayer

Type: LaunchContext

Invoked to start singleplayer. Required for Singleplayer/Hybrid gamemodes.

public Action<LaunchContext> OnHostMultiplayer

Type: LaunchContext

Invoked to start hosting a multiplayer session. Optional.

public Action<LaunchContext> OnJoinMultiplayer

Type: LaunchContext

Invoked to join a multiplayer session. Optional.

public Action<LaunchContext> OnExitToHub

Type: LaunchContext

Invoked when Side Hustle tears the gamemode down (e.g. the player backs out). Optional.

public ModPolicy Policy

Type: ModPolicy

Added in 1.2.0

Optional policy controlling which other mods may stay loaded while this gamemode runs. Null = no restriction (default). See ModPolicy.

public bool DefaultRequiredModsOnly = false

Added in 1.5.3

When true, the Host form defaults the mod-set choice to “Required mods only” (an isolated profile with just this gamemode’s mods) instead of “Current installed mods” - e.g. a multiplayer gamemode that wants everyone on an identical, clean set. The host can still switch it before starting. Only takes effect when Policy is declared and would actually change the set (and is not blocked). Default false.

public SettingDescriptor[] HostSettings

Type: SettingDescriptor

Added in 1.4.0

Optional host-configurable settings. Side Hustle renders these as a form on the Host screen and ships the chosen values to your launch callbacks via LaunchContext.Multiplayer’s config blob. Null = none. See SettingDescriptor.

Value Shown in array order. Each SettingDescriptor.Key must be unique; a repeated key logs a warning and both controls write the same value.

public SettingPreset[] Presets

Type: SettingPreset

Added in 1.5.0

Optional one-click presets for HostSettings. Side Hustle shows a picker above the form; selecting a preset cascades its values into the matching controls (the host can still tweak after). Null/empty = no picker. See SettingPreset.

Value The form opens on the preset marked SettingPreset.DefaultSelected, else on the best fit for the lobby size, else on the first entry.

public bool AllowsSingleplayer { get; }

True when this descriptor can be launched in singleplayer.

public bool AllowsMultiplayer { get; }

True when this descriptor exposes multiplayer (host/join).