Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

MixService

A beginner-friendly Schedule I mod template for S1API.Forked, MelonLoader, and Harmony. The project currently pins S1API.Forked 3.1.4.

Milo's mixing service

Milo is a text-message contact. Select cocaine, meth, shrooms, or weed, then a discovered mix of that drug and an order of 1, 5, 10, or 20 bricks. For weed, Milo traces the game's loaded mix recipes to identify the starting strain (OG Kush, Sour Diesel, Green Crack, or Granddaddy Purple) and names it in the deposit instructions. If he cannot verify the recipe, he will not take an order or collect a pending batch. An older weed order with the wrong starting strain must be cancelled and rebooked. By default, he quotes $1,450 per brick ($29,000 for 20) and assigns an empty dead drop to the order. The assigned drop is saved so a reload does not change the handoff location. Milo charges the player's cash balance only when he collects a complete, valid batch. The debit is checked against the reported cash balance before any product is removed. A failed payment leaves the product in the drop; the player can add cash and use check my batch to retry. Cancelling before collection refunds any amount already paid, including a charge carried forward from an older save.

The product exchange remains one base-product brick for one target-product brick of the same drug family, with the input quality preserved and a default six-hour game-time processing period. Milo allows one active order. The wallet payment is isolated in Mixing/MiloWalletPayment.cs so a Milo-specific cash drop can replace it later. If a wallet operation produces an unexpected or unreadable balance, the order retains a saved review flag and Milo stops automatic payment and collection retries.

Run the focused economy checks with dotnet run --project Tests/MixService.Economy.Tests.csproj. In game, verify a 20-brick quote and cash debit at collection, insufficient-cash retry with the deposit intact, cancellation before collection, save/load with an assigned drop, migration of an older unpaid or prepaid order, and the existing six-hour pickup flow. The automated tests cover pricing and persisted job data; they do not exercise S1API or the game runtime.

The default path is CrossCompat: one mod assembly that stays on S1API/MelonLoader abstractions and avoids direct ScheduleOne or Il2CppScheduleOne game types. Use Mono or Il2cpp only when your mod intentionally needs runtime-specific game assemblies.

Configuration

Launch the game once with MixService installed to create the three settings in <game>/UserData/MelonPreferences.cfg. They appear under [MixService]:

[MixService]
PricePerBrick = 1450
ProcessingMinutes = 360
DebugLogs = false
Setting Default Accepted range When it applies
PricePerBrick $1,450 $1-$100,000 per brick, whole dollars New orders
ProcessingMinutes 360 (six game hours) 1-10,080 game minutes (seven game days) New orders
DebugLogs false true / false Immediately through the phone app

For manual editing, close the game, edit only the [MixService] section, and launch again. Other mods may use the same file. Price and duration entries include range validators, and runtime reads also limit numeric values to the supported bounds. Zero-cost and instant orders are not supported.

For in-game editing, optionally install Prowiler's Mod Manager - Phone App. Choose its beta build matching the game's runtime: IL2CPP for beta, Mono for alternate-beta. Open its phone Settings app (or main-menu Config panel), select MixService, edit the values, and press SAVE. MixService reads current preference values when creating an order and when logging, so these changes do not require a restart. SAVE persists the values for the next session.

Each order saves its quoted fee and processing duration when booked. Changing settings never reprices or reschedules an existing order, including one still waiting for a deposit. Older pending orders retain six hours; older active orders retain their saved completion deadline. Debug logging controls routine diagnostics, including conversation cleanup messages; warnings and errors remain visible.

The phone app is optional. MixService uses standard MelonPreferences entries without referencing the phone app DLL. Settings are local to the game installation; this change does not add multiplayer settings synchronization.

Verify in game: change the price and duration through the beta phone app, save, and book an order; change both settings while that order awaits its deposit, then collect and reload to confirm its original fee and timing remain intact. Book a subsequent order to confirm the new values. Toggle debug logging and confirm diagnostic messages change while warnings/errors remain available. Restart after editing the config file to verify persisted values.

Quick Start

  1. Clone this repository, or install it as a local .NET template and create a project:
dotnet new install .
dotnet new s1api -n MyScheduleOneMod
Set-Location .\MyScheduleOneMod
  1. Run the setup script once from the generated project:
.\setup.ps1
  1. Build the recommended starter configuration:
dotnet build .\MixService.sln -c CrossCompat

The script writes local.build.props with your local Schedule I install paths. That file is ignored by git.

If detection picks the wrong installs, pass paths explicitly:

.\setup.ps1 -MonoPath "<path-to-mono-install>" -Il2CppPath "<path-to-il2cpp-install>" -Force

To copy successful builds into the target Mods folder, generate props with deployment enabled:

.\setup.ps1 -EnableDeployment -Force

Build Configurations

CrossCompat is the recommended default for S1API mods.

dotnet build .\MixService.sln -c CrossCompat

Mono targets the Mono/alternate branch and includes direct Mono game assembly references.

dotnet build .\MixService.sln -c Mono

Il2cpp targets the IL2CPP/default branch and includes generated Il2Cpp assembly references.

dotnet build .\MixService.sln -c Il2cpp

Players still need MelonLoader and S1API installed in the game at runtime.

Developing Against a Local S1API Checkout

The default package reference is recommended for released mods. To compile against a sibling S1API checkout, build the matching S1API target and enable the local reference in local.build.props:

dotnet build ..\S1API\S1API.sln -c MonoMelon -p:AutomateLocalDeployment=false
dotnet build ..\S1API\S1API.sln -c Il2CppMelon -p:AutomateLocalDeployment=false
<UseLocalS1APIForked>true</UseLocalS1APIForked>
<LocalS1APIRoot>..\S1API</LocalS1APIRoot>

CrossCompat and Mono consume the local MonoMelon build; Il2cpp consumes the local Il2CppMelon build. Override LocalS1APIForkedPath only for a non-standard output layout.

Included References

The project includes the common references that S1API mods usually need so new modders do not have to add Unity assemblies manually:

  • S1API.Forked, LavaGang.MelonLoader, and HarmonyX from NuGet for compile-time access.
  • Newtonsoft.Json, TextMeshPro, and common UnityEngine.* modules from the selected game install when local.build.props is configured.
  • Assembly-CSharp and Assembly-CSharp-firstpass for Mono and Il2cpp only.
  • Il2CppInterop.Runtime for Il2cpp.

If your mod needs a less common Unity, FishNet, Steamworks, or Schedule One assembly, add it near the matching reference group in MixService.csproj.

Project Layout

MixService/
|-- .agents/
|   `-- skills/
|       |-- schedule-one-modding/
|       `-- schedule-one-custom-npcs/
|-- Core.cs
|-- Dialogue/
|   |-- MiloDialogueBank.cs   <- all of Milo's text; add lines here
|   |-- MiloDialogue.cs
|   |-- MiloIntent.cs
|   |-- MiloLineFacts.cs
|   |-- MiloBank.cs
|   |-- MiloLineFormatter.cs
|   `-- MiloRepeatGuard.cs
|-- Mixing/
|-- NPCs/
|-- Tests/
|-- Utils/
|   `-- Constants.cs
|-- example.build.props
|-- setup.ps1
|-- MixService.csproj
`-- MixService.sln

Included Agent Skills

This template includes repo-local Codex/agent skills under .agents/skills/:

  • schedule-one-modding: general Schedule I modding guidance for Mono, IL2CPP, CrossCompat, Harmony, S1API, MAPI, SteamNetworkLib, local game inspection, and packaging safety.
  • schedule-one-custom-npcs: focused S1API custom NPC guidance for prefab configuration, appearance, schedules, dialogue, customer/dealer behavior, and save/load lifecycle.

They are development guidance only. They are not compiled into the mod DLL and should not include game assemblies, generated IL2CPP wrappers, decompiled dumps, AssetRipper exports, private logs, or local machine paths.

Where To Put Code

  • Add or change what Milo says in Dialogue/MiloDialogueBank.cs. It is grouped by intent, so appending a line to the right tier is the whole job. Lines are capped at 20 words, button labels hold exactly one line each, and Tests/DialogueTests.cs fails if a line has an unfilled fact, a speech-length line, a subject-verb disagreement, a repeated drop name, or a composed message that grew too long.
  • Use GameLifecycle.OnPreLoad for stable content definitions that save deserialization must resolve.
  • Use GameLifecycle.OnLoadComplete for systems that need the loaded world, managers, or player state.
  • Put IDs, version strings, config names, and log tags in Utils/Constants.cs.
  • Keep CrossCompat code on S1API wrappers and public abstractions. If a file needs direct game types, guard it with #if MONO / #if IL2CPP or keep it out of CrossCompat.

Useful Links

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages