Moddy-ModEnforcementAgency icon

ModEnforcementAgency

M.E.A. - Alpha Modding Framework

Last updated 5 days ago
Total downloads 1019
Total rating 1 
Categories Libraries
Dependency string Moddy-ModEnforcementAgency-0.1.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

LavaGang-MelonLoader-0.7.0 icon
LavaGang-MelonLoader

The World's First Universal Mod Loader for Unity Games compatible with both Il2Cpp and Mono

Preferred version: 0.7.0

README

M.E.A.

WIP Readme, WIP Plugin.

ModEnforcementAgency is meant to lay out basic groundwork for modding. It allows for loading AssetBundles at runtime, adding custom items to game Registry, and injecting custom items into specific shops.

Custom Items completely untested on Multiplayer.

Users:

Without another mod using MEA, the mod does not do much. It does, however, include a built in mod-viewer, that shows list of installed mods. (See Settings)

Modders:

Make sure to include Schedule I\MelonLoader\net6\UnityEngine.Il2CppAssetBundleManager.dll and ModEnforcementAgency.dll as Dependencies for your project.

using ModEnforcementAgency.Managers.Items;
using ModEnforcementAgency.Utils;
public override void OnApplicationStarted()
{
    // Example of loading a custom item from an asset bundle
    // First, load asset bundle
    Il2CppAssetBundle bundle = AssetUtils.LoadAssetBundleFromResources("testbundle", MelonAssembly.Assembly);

    // Load PropertyItemDefinition from the bundle 
    StorableItemDefinition propertyItemDef = bundle.LoadAsset<PropertyItemDefinition>("TestItem");

    // Register it in the game's item manager
    CustomItemManager.RegisterItem(propertyItemDef);

    // Now add it to the shop, the api will wait to add it until the shop is loaded
    CustomItemManager.AddItemToShop(CustomItemManager.EShopType.GasStation, propertyItemDef.ID);
}

Please take careful note of special IL2Cpp types, like Il2CppAssetBundle. (and Lists)

AssetUtils contain functions for loading bundles from paths and embedded resources.

FontUtils caches some fonts for you to use for UI creation.

See GitHub Repo - Contributions welcomed and encouraged.

https://github.com/modestimpala/ModEnforcementAgency

Join the Schedule 1 Modding Discord!