From def8c0dce95f29c0aef372eeefdfbb25d92ea731 Mon Sep 17 00:00:00 2001 From: Raphtalia Date: Fri, 26 Jul 2024 05:48:24 +0000 Subject: [PATCH] Update Setup --- Setup.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Setup.md b/Setup.md index 8e8a53d..8a7dfb3 100644 --- a/Setup.md +++ b/Setup.md @@ -1,6 +1,6 @@ ### Setting up the plugin in your Unity project -Download the `DunGenPlus.dll` through Thunderstore or through this Github repository. Drag and drop the `.dll` file into your interior Unity project. This mod also requires the LethalLevelLoader plugin to be installed in your Unity project. With just those simple steps, the mod is installed. You can now setup and use this mod's features. +Download the `DunGenPlus.dll` through Thunderstore or through this Github repository. Drag and drop the `.dll` file into your interior Unity project. This mod also requires the [LethalLevelLoader](https://thunderstore.io/c/lethal-company/p/IAmBatby/LethalLevelLoader/) plugin to be installed in your Unity project. With just those simple steps, the mod is installed. You can now setup and use this mod's features. This goes without saying, this mod also requires the DungeonGenerationPlus mod to be installed in your Lethal Company mod pack. @@ -22,4 +22,18 @@ After any of the two previous steps, verify that the Extender was registered by ### Setting up the API Callbacks -Inside the Project tab, right click to open the Assets tab. Select `Create/DunGenExtender` to create the `DunGenExtender` asset. Inside that asset, reference the `DungeonFlow` that will be linked to this Extender asset. Finally, set it's AssetBundle name to the same one as your interior's asset, `DungeonFlow` or `ExtendedDungeonFlow` whichever it may be. If it's I'm not sure if the extension must be `.lethalbundle` or if Unity automatically fixes it; either way set the extension as `.lethalbundle` to be safe. \ No newline at end of file +After your interior is selected but before it is generated, a shallow copy of the DunGenExtender's properties is passed to an event caller thing. You can register a function call to this event caller thing to modify the properties before they are used. This is useful if you have configs for your dungeon's generation. The following is a code example of how to register a function call and how you may want to use it. + +```cs +dunGenExtender.Events.OnModifyDunGenExtenderProperties.AddListener(UpdateDunGenExtenderProperties); + +public void UpdateDunGenExtenderProperties(DunGenExtenderProperties props) { + props.MainPathCount = PluginConfig.Instance.mainPathCountValue; + if (PluginConfig.Instance.disableBasementValue) { + props.MainPathCount = Mathf.Min(props.MainPathCount, 2); + } + + props.DungeonSizeBase = new Vector3(PluginConfig.Instance.dunGenWidthBaseValue, props.DungeonSizeBase.y, PluginConfig.Instance.dunGenLengthBaseValue); + props.DungeonSizeFactor = new Vector3(PluginConfig.Instance.dunGenWidthMultiFactorValue, props.DungeonSizeBase.y, PluginConfig.Instance.dunGenLengthMultiFactorValue); +} +``` \ No newline at end of file