### Plugin Output Folder Structure Source: https://github.com/gottyduke/elin.plugins/blob/master/PluginTemplate/README.md Files placed within the `package/` folder of the plugin template will be automatically copied to the output directory. This output directory is located within the Elin installation path, under `Package/Mod_AssemblyName/`, facilitating easy deployment of mods. ```bash # Example: Content of package/ folder # YourPluginConfig.json # YourPluginAsset.png # Will be copied to: # ElinGamePath/Package/Mod_AssemblyName/ ``` -------------------------------- ### Custom Character Creation with CWL API Source: https://context7.com/gottyduke/elin.plugins/llms.txt Automatically import custom characters with their equipment, inventory, and spawn locations using source sheet tags. This C# code demonstrates how to create and spawn characters, with examples of tags for zone, equipment, items, and dialogue. ```csharp using Cwl.API.Custom; // Create a custom character from source data if (CustomChara.CreateTaggedChara("my_custom_npc", out Chara? chara)) { // Character created successfully with all tags applied EMono._zone.AddCard(chara, EMono.pc.pos); Console.WriteLine($"Spawned: {chara.Name}"); } // Spawn character via console command CustomChara.SpawnTagged("my_custom_npc"); // In your source sheet (SourceChara.xlsx), use tags: // addZone_meadow - Spawn in meadow zones // addEq_sword_1#10 - Equip level 10 sword // addThing_gold#500 - Add 500 gold to inventory // addDrama_mycharacter - Link custom dialog // addBio_mycharacter - Link custom biography // addFlag_custom_flag - Set custom flag ``` -------------------------------- ### Setting ElinGamePath Environment Variable Source: https://github.com/gottyduke/elin.plugins/blob/master/PluginTemplate/README.md Before building the Elin plugin template, the `ElinGamePath` environment variable must be set. This variable points to the root directory of the Elin installation, ensuring that build processes can locate necessary game files and directories. ```bash # Example of setting the environment variable in a Unix-like shell export ElinGamePath="/path/to/elin/installation" ``` ```powershell # Example of setting the environment variable in PowerShell $env:ElinGamePath = "C:\path\to\elin\installation" ``` -------------------------------- ### Custom Merchant Stock System with CWL API Source: https://context7.com/gottyduke/elin.plugins/llms.txt Define and manage custom merchant inventories with custom restock behavior using the CWL API. This C# code demonstrates how to add and clear stock, with an example JSON structure for defining items and their properties. ```csharp using Cwl.API.Custom; // Add custom stock to merchant CustomMerchant.AddStock("merchant_npc_id", "special_items"); // Clear merchant stock CustomMerchant.ClearStock("merchant_npc_id"); // Define stock in Data/stock_special_items.json: { "Items": [ { "Id": "sword_fire", "Type": "Item", "Restock": true, "Price": 5000, "Rarity": 3 }, { "Id": "potion_legendary", "Type": "Item", "Restock": false, "Price": 10000 } ] } // Tag in SourceChara.xlsx: // addStock_special_items ``` -------------------------------- ### Elin.plugins Feature - Error Ignoring for Mods Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md Implementation of error ignoring for specific mods with invalid dependencies in Elin.plugins. This prevents the mod loader from crashing due to incompatible mod setups, such as Adventure Creator. ```csharp // Added error ignore for certain mods that were compiled with invalid dependencies. Such as, Adventure Creator which has UnityEditor dependency. ``` -------------------------------- ### Drama Expansion System with CWL API Source: https://context7.com/gottyduke/elin.plugins/llms.txt Extend the game's dialog and quest system with custom actions and conditions using the CWL API. This C# code provides an example of defining a custom drama action and explains how to use logical operators for conditions and build external method tables. ```csharp using Cwl.API.Drama; using Cwl.API.Attributes; // Define custom drama action [CwlDramaExpansion] public static bool my_custom_action(DramaManager dm, Dictionary line, params string[] parameters) { var targetName = parameters[0]; var amount = int.Parse(parameters[1]); // Perform custom logic EMono.pc.ModCurrency(amount, "gold"); EMono.pc.Say($"Received {amount} gold from {targetName}!"); return true; } // Use in Drama Excel file: // Action column: emit_call, my_custom_action, "Merchant", "1000" // Combine conditions with logical operators // Action: and, has_quest "main_quest", is_in_zone "meadow" // Action: or, has_karma 50, has_fame 100 // Action: not, is_night // Build external method table from assembly // Action: build_ext, "MyModAssembly" ``` -------------------------------- ### C# Animated Custom Sprites API: Playback Control Source: https://context7.com/gottyduke/elin.plugins/llms.txt Control sprite animations programmatically for characters using the Animated Custom Sprites (ACS) API. This includes starting animations by name or type, playing specific clip instances, stopping animations, and accessing the animation controller to get playback status and clip information. Requires ACS.API. ```csharp using ACS.API; Card character = EMono.pc.party.members[0]; // Play animation by name character.StartAcsClip("idle"); // Play animation by type character.StartAcsClip(AcsAnimationType.Combat); // Play specific clip instance var clip = character.GetAcsClip("special_action"); if (clip != null) { character.StartAcsClip(clip); } // Stop current animation character.StopAcsClip(); // Get animation controller var controller = character.GetAcsController(); if (controller != null) { Console.WriteLine($"Current clip: {controller.CurrentClip?.name}"); Console.WriteLine($"Is playing: {controller.IsPlaying}"); } // Get all clips of specific type var combatClips = character.GetAcsClips(AcsAnimationType.Combat); foreach (var combatClip in combatClips) { Console.WriteLine($"Combat animation: {combatClip.name}, {combatClip.sprites.Length} frames"); } ``` -------------------------------- ### Animated Custom Sprites API - Clip Control Source: https://github.com/gottyduke/elin.plugins/blob/master/AnimatedCustomSprites/README.md Provides extension methods for controlling animation clips on a card object. These methods allow starting and stopping animations by clip name or type, and retrieving clip information. Usage requires referencing the AnimatedCustomSprites.dll and accessing the ACS.API namespace. ```csharp // clip control card.StartAcsClip(clipName) card.StartAcsClip(clipType) card.StopAcsClip() ``` -------------------------------- ### Configure Equipment Comparison Settings in C# Source: https://context7.com/gottyduke/elin.plugins/llms.txt This C# snippet illustrates how to configure the Equipment Comparison plugin, which provides visual equipment comparison in tooltips. Settings include keybindings for toggling the display and options for what information to show, such as stat differences and equipped items. Configuration is typically managed via a .cfg file. ```csharp // Default keybinding: (Left)Shift + C // Configure in: Elin/BepInEx/config/dk.elinplugins.equipmentcomparison.cfg [Keybindings] ToggleComparisonKey = LeftShift ToggleComparisonModifier = C [Display] ShowStatDifferences = true ShowEquippedItem = true CompareForPets = true // Automatically compares unequipped items with currently equipped // Shows difference in stats (damage, armor, enchantments) // Works for player and pet inventories ``` -------------------------------- ### BGM Handling and Playlist Management in Elin.plugins Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md Significant updates to the BGM system in Elin.plugins, enabling the addition of new BGM tracks, defining zone-specific playlists, and implementing seamless streaming. Includes configuration options and bug fixes for playlist handling. ```csharp // BGM update! Now you can freely add new BGMs into the game, and define your zone specific playlist. // Added seamless streaming for current playing BGM if it's also in the new playlist when switching. Configurable. // Disabled playlist streaming when new playlist is blank (game intends to stop BGM). // Stream load the BGM clips to reduce load time. ``` -------------------------------- ### Build Custom Whatever Loader Project Source: https://github.com/gottyduke/elin.plugins/blob/master/README.md These commands build the CustomWhateverLoader project in Debug and DebugNightly configurations. The output is placed in the './out' directory. The '--no-restore' flag indicates that dependencies have already been restored. ```powershell dotnet build ./CustomWhateverLoader -c Debug -o ./out --no-restore dotnet build ./CustomWhateverLoader -c DebugNightly -o ./out --no-restore ``` -------------------------------- ### Runtime API Enhancements in Elin.plugins Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md New additions to the runtime API in Elin.plugins, including MethodStubHelper and DebugSampler for generating runtime stubs and performance analysis. Console commands are provided for stub management. ```csharp // Added runtime API MethodStubHelper, MethodStub to assist in generating runtime stubs. // Added runtime API DebugSampler and console commands for performance analysis of runtime methods. // ・cwl.stub.attach typeName methodName [nested:true/false] // ・cwl.stub.detach // ・cwl.stub.clear // ・cwl.stub.dump ``` -------------------------------- ### Clone Elin.Plugins Repository Source: https://github.com/gottyduke/elin.plugins/blob/master/README.md This command clones the Elin.Plugins repository from GitHub. It is the first step to obtaining the project's source code. ```powershell git clone https://github.com/gottyduke/Elin.Plugins.git cd Elin.Plugins ``` -------------------------------- ### Elin.plugins - Reflection Attribute [CwlContextMenu] Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md Addition of the reflection attribute [CwlContextMenu] in Elin.plugins. This attribute facilitates the automatic registration of system menu entries, enhancing mod extensibility. ```csharp // Added reflection attribute [CwlContextMenu] for automatic registration of system menu entries. ``` -------------------------------- ### Custom Religion System with CWL API Source: https://context7.com/gottyduke/elin.plugins/llms.txt Create custom deities with unique offerings, elements, and persistence using the CWL API. This C# code shows how to create or retrieve a religion, configure its properties, and check if an element belongs to it. ```csharp using Cwl.API.Custom; // Create or retrieve custom religion var religion = CustomReligion.GerOrAdd("my_god") .SetMinor(false) .SetCanJoin(true) .SetElements(new[] { "featGod_my_god1", "featGod_my_god2" }) .SetOfferingMtp(new Dictionary { { "wine", 150 }, { "corpse_human", 300 } }); // Check if element belongs to this religion if (religion.IsFactionElement(element)) { Console.WriteLine("This is a god ability!"); } // Religion data is automatically saved/loaded // Access all custom religions foreach (var god in CustomReligion.All) { Console.WriteLine($"Religion: {god.id}, Mood: {god.mood}"); } ``` -------------------------------- ### Custom Character Creation API Source: https://context7.com/gottyduke/elin.plugins/llms.txt Automatically import custom characters with equipment, inventory, and spawn locations using source sheet tags. ```APIDOC ## Custom Character Creation API ### Description Automatically import custom characters with equipment, inventory, and spawn locations using source sheet tags. ### Method N/A (Code examples provided) ### Endpoint N/A (Code examples provided) ### Parameters N/A (Code examples provided) ### Request Example ```csharp using Cwl.API.Custom; // Create a custom character from source data if (CustomChara.CreateTaggedChara("my_custom_npc", out Chara? chara)) { // Character created successfully with all tags applied EMono._zone.AddCard(chara, EMono.pc.pos); Console.WriteLine($"Spawned: {chara.Name}"); } // Spawn character via console command CustomChara.SpawnTagged("my_custom_npc"); // In your source sheet (SourceChara.xlsx), use tags: // addZone_meadow - Spawn in meadow zones // addEq_sword_1#10 - Equip level 10 sword // addThing_gold#500 - Add 500 gold to inventory // addDrama_mycharacter - Link custom dialog // addBio_mycharacter - Link custom biography // addFlag_custom_flag - Set custom flag ``` ### Response N/A (Code examples provided) ### Response Example N/A (Code examples provided) ``` -------------------------------- ### Elin.plugins Feature - Custom Religions and Factions Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md Enhancements in Elin.plugins for custom religions, including detailed tooltips for feats and support for faction elements and god artifacts. This allows for more intricate custom religion systems. ```csharp // Added detailed tooltip for feats from custom religions. // Added support for faction elements / god artifacts of custom religions. ``` -------------------------------- ### Elin.plugins Bug Fixes - Runtime and Exceptions Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md Bug fixes related to runtime operations and exception handling in Elin.plugins. This includes issues with DebugSampler, material bugs, BGM refresh errors, and exception analyzer display. ```csharp // Fixed DebugSampler using constrained calls with pos 0 insertion. // Fixed a material bug that happens with dark matter. // Fixed a bug when exiting to main menu that might cause BGM refresh to throw. // Added a popup display after CWL handles exceptions. // Added exception analyzer. ``` -------------------------------- ### Elin.plugins Bug Fixes - CustomConverter and Duplication Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md Fixes for bugs within the CustomConverter API in Elin.plugins, specifically addressing issues with product duplication and the handling of product conversion. ```csharp // Fixed a bug that causes product duplication from CustomConverter API. ``` -------------------------------- ### Custom Religion System API Source: https://context7.com/gottyduke/elin.plugins/llms.txt Create custom deities with offerings, elements, and persistence. ```APIDOC ## Custom Religion System API ### Description Create custom deities with offerings, elements, and persistence. ### Method N/A (Code examples provided) ### Endpoint N/A (Code examples provided) ### Parameters N/A (Code examples provided) ### Request Example ```csharp using Cwl.API.Custom; // Create or retrieve custom religion var religion = CustomReligion.GerOrAdd("my_god") .SetMinor(false) .SetCanJoin(true) .SetElements(new[] { "featGod_my_god1", "featGod_my_god2" }) .SetOfferingMtp(new Dictionary { { "wine", 150 }, { "corpse_human", 300 } }); // Check if element belongs to this religion if (religion.IsFactionElement(element)) { Console.WriteLine("This is a god ability!"); } // Religion data is automatically saved/loaded // Access all custom religions foreach (var god in CustomReligion.All) { Console.WriteLine($"Religion: {god.id}, Mood: {god.mood}"); } ``` ### Response N/A (Code examples provided) ### Response Example N/A (Code examples provided) ``` -------------------------------- ### Restore Dependencies for Custom Whatever Loader Source: https://github.com/gottyduke/elin.plugins/blob/master/README.md This command restores the necessary dependencies for the CustomWhateverLoader project. It ensures all required packages are downloaded and available for building. ```powershell dotnet restore ./CustomWhateverLoader --locked-mode ``` -------------------------------- ### Elin.plugins Bug Fixes - Data and Parsing Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md Various bug fixes in Elin.plugins addressing issues with data handling, parsing, and file processing. Includes fixes for null sprite file paths, custom converter products, empty traits, and default index usage. ```csharp // Fixed a bug if sprite file path is null when using SpriteCreator. // Fixed(?) a CustomConverter bug that products don't convert. // Fixed a source parsing bug if Chara sheet contains empty trait and empty defaults. // Fixed a material/obj mapping bug if -1 default index is used by game. ``` -------------------------------- ### Elin Plugin Project Structure Source: https://github.com/gottyduke/elin.plugins/blob/master/PluginTemplate/README.md The Elin plugin template follows a specific directory structure for BepInEx and Elin game data. Understanding this structure is crucial for correctly placing plugin files and ensuring compatibility with the Elin game environment. ```tree ElinGamePath/ ├─ BepInEx/ │ ├─ core/ │ │ ├─ *.dll ├─ Elin_Data/ │ ├─ Managed/ │ │ ├─ *.dll ``` -------------------------------- ### Elin.plugins Bug Fixes - Positioning and Display Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md A collection of bug fixes in Elin.plugins related to character positioning and display issues. This includes adjustments for custom skin renderers and fixes for vanilla bugs affecting bark bubbles and emoticons. ```csharp // Added a scaled TcPos adjustment to custom skin renderers to fix vanilla bug where bubble and icons would display way above. // Fixed a bug where custom skin renderer would get position re-adjusted. // Fixed a vanilla bug where characters with @chara tiles will have the bark bubble shown way above their heads. // Fixed a vanilla bug where characters with @chara tiles will have the emoticons shown way above their heads. ``` -------------------------------- ### C# Context Menu Extensions for Game Objects Source: https://context7.com/gottyduke/elin.plugins/llms.txt Extend game object context menus with custom actions using declarative C# attributes. This allows for adding new interaction options to characters or items, enabling custom game logic to be triggered by the player. Requires Cwl.API.Attributes. ```csharp using Cwl.API.Attributes; public class MyContextMenus { [CwlContextMenu("chara/tame/special_taming", "Tame with Magic")] public static bool SpecialTaming(AI_PlayCard source, Card target) { if (target is not Chara chara) return false; // Custom taming logic if (EMono.pc.HasElement("magic_taming")) { chara.MakeFriend(); EMono.pc.Say("Tamed with magic!"); return true; } EMono.pc.Say("You need Magic Taming ability!"); return false; } [CwlContextMenu("thing/consume/my_custom_action", "my_lang_id")] public static bool CustomThingAction(AI_PlayCard source, Card target) { if (target is not Thing thing) return false; thing.ModNum(-1); EMono.pc.ModExp("cooking", 10); return true; } } ``` -------------------------------- ### JSON AI Service Configuration for Emmersive Source: https://context7.com/gottyduke/elin.plugins/llms.txt Configure various AI service providers for the Emmersive integration, including options for Google AI Studio, OpenAI ChatGPT, and DeepSeek. This JSON configuration defines the provider, API key, model, and endpoint for each service, allowing for automatic fallback mechanisms. Configuration can be done via the game UI or BepInEx config files. No direct code is provided, but these JSON snippets represent the configuration structure. ```json { "provider": "google", "apiKey": "YOUR_API_KEY", "model": "gemini-2.0-flash-exp", "endpoint": "https://generativelanguage.googleapis.com/v1beta" } ``` ```json { "provider": "openai", "apiKey": "YOUR_API_KEY", "model": "gpt-4o-mini", "endpoint": "https://api.openai.com/v1" } ``` ```json { "provider": "openai", "apiKey": "YOUR_DEEPSEEK_KEY", "model": "deepseek-chat", "endpoint": "https://api.deepseek.com/v1" } ``` -------------------------------- ### Drama Expansion Methods Added in Elin.plugins Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md This section details new methods added to the drama expansion in Elin.plugins, allowing for more dynamic and interactive storytelling. These methods control elements, key items, character positioning, and text display. ```lua add_element(elementAlias, optional power) mod_keyitem(keyItemId, optional valueExpression) if_keyitem(keyItemId, optional valueExpression) move_next_to(charaId) pop_text(text) if_element(elementAlias, valueExpression) if_faith(religionId, optional giftRank) ``` -------------------------------- ### Elin.plugins Bug Fixes - Playlists and Cache Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md Bug fixes in Elin.plugins concerning BGM playlists and caching mechanisms. Addresses issues with playlist resetting, ambiguous cache keys, lot-specific playlist caching, and invalid zone types. ```csharp // Fixed a bug lot specific playlist didn't reset after leaving lot room. // Fixed a bug where playlists of the same zone may end up using same ambiguous cache key. // If mod author used invalid zone types, CWL will prompt on creation and use random zone instead. // Fixed a bug where lot specific playlist didn't use unique cache key. ``` -------------------------------- ### Elin.plugins Feature - Restock Event Patching Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md Change in Elin.plugins to patch the restock event using pre-post transpiler instead of the original method. This ensures CWL stocks are executed even if mods intentionally skip the original method. ```csharp // Changed the restock event to pre-post patch from transpiler because some mods may intentionally skip the original method (BAD!) and cause CWL stocks to not get executed. ``` -------------------------------- ### Customize AI Context Prompts in C# Source: https://context7.com/gottyduke/elin.plugins/llms.txt This snippet shows how to define custom character backgrounds, relationships, and zone descriptions for AI generation in C#. These definitions are typically stored in text files within specific directories based on language and content type. ```csharp // Character background file: LangMod/{LANG}/Emmersive/Characters/{character_id}.txt Ashland is a fierce warrior from the northern tribes. She values honor above all else and speaks directly. Her past is marked by loss but she never shows weakness. // Character relationship file: LangMod/{LANG}/Emmersive/Relations/{char1}+{char2}.txt Ashland and Fiama have a complicated history. They were once rivals but now share mutual respect. Ashland saved Fiama's life during the Great War. // Zone background file: LangMod/{LANG}/Emmersive/Zones/{zone_id}.txt The meadow is peaceful during spring, filled with wildflowers. Travelers often stop here to rest before the mountain pass. // System prompt customization via UI // Adjust context toggles: nearby characters, recent actions, environment, items ``` -------------------------------- ### Drama Expansion System API Source: https://context7.com/gottyduke/elin.plugins/llms.txt Extend dialog and quest system with custom actions and conditions. ```APIDOC ## Drama Expansion System API ### Description Extend dialog and quest system with custom actions and conditions. ### Method N/A (Code examples provided) ### Endpoint N/A (Code examples provided) ### Parameters N/A (Code examples provided) ### Request Example ```csharp using Cwl.API.Drama; using Cwl.API.Attributes; // Define custom drama action [CwlDramaExpansion] public static bool my_custom_action(DramaManager dm, Dictionary line, params string[] parameters) { var targetName = parameters[0]; var amount = int.Parse(parameters[1]); // Perform custom logic EMono.pc.ModCurrency(amount, "gold"); EMono.pc.Say($"Received {amount} gold from {targetName}!"); return true; } // Use in Drama Excel file: // Action column: emit_call, my_custom_action, "Merchant", "1000" // Combine conditions with logical operators // Action: and, has_quest "main_quest", is_in_zone "meadow" // Action: or, has_karma 50, has_fame 100 // Action: not, is_night // Build external method table from assembly // Action: build_ext, "MyModAssembly" ``` ### Response N/A (Code examples provided) ### Response Example N/A (Code examples provided) ``` -------------------------------- ### Custom Converter API Enhancements in Elin.plugins Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md Updates to the CustomConverter API in Elin.plugins, introducing new functionalities like event handling for custom traits and improved localization. This allows for more flexible custom item and product conversions. ```csharp // Reworked CustomConverter API, added CWL event _OnProduce, allowing the use of custom traits. // Added localization text for CustomConverter API context menu entry. ``` -------------------------------- ### JSON Schema for Response Format Source: https://github.com/gottyduke/elin.plugins/blob/master/Emmersive/bbcode.txt This code snippet demonstrates how to configure the 'response_format' for AI services that support JSON schema output. It's crucial for ensuring structured data is returned by the AI model. ```json { "response_format": { "type": "json_schema", "json_schema": { ... } } } ``` -------------------------------- ### Elin.plugins Feature - Text Synchronization Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md Implementation of auto-synchronization for texts across different text files (text, text_JP, text_EN) in Elin.plugins. This ensures consistency in localized text content. ```csharp // Added support for auto syncing texts between text, text_JP, and text_EN. ``` -------------------------------- ### Elin.plugins Feature - Thing Generation Tags Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md Introduction of new tags 'forceRarity', 'fixedElement', and 'randomElement' for Thing rows in Elin.plugins. These tags allow for specific control over rarity and element sources during Thing generation. ```csharp // Added a new tag "forceRarity" for Thing rows that uses a category with "fixedRarity" which defaults the rarity to normal. // Added two new tags "fixedElement" and "randomElement" to override the element source value for Thing generation. ``` -------------------------------- ### Custom Merchant API Enhancements in Elin.plugins Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md Improvements to the CustomMerchant API in Elin.plugins, adding support for the 'Identified' field in stock files. This enhances the customization options for in-game merchants. ```csharp // Reworked CustomMerchant API, added supoort for "Identified" field in stock file. ``` -------------------------------- ### Custom Merchant Stock System API Source: https://context7.com/gottyduke/elin.plugins/llms.txt Define and manage custom merchant inventories with restock behavior. ```APIDOC ## Custom Merchant Stock System API ### Description Define and manage custom merchant inventories with restock behavior. ### Method N/A (Code examples provided) ### Endpoint N/A (Code examples provided) ### Parameters N/A (Code examples provided) ### Request Example ```csharp using Cwl.API.Custom; // Add custom stock to merchant CustomMerchant.AddStock("merchant_npc_id", "special_items"); // Clear merchant stock CustomMerchant.ClearStock("merchant_npc_id"); // Define stock in Data/stock_special_items.json: { "Items": [ { "Id": "sword_fire", "Type": "Item", "Restock": true, "Price": 5000, "Rarity": 3 }, { "Id": "potion_legendary", "Type": "Item", "Restock": false, "Price": 10000 } ] } // Tag in SourceChara.xlsx: // addStock_special_items ``` ### Response N/A (Code examples provided) ### Response Example N/A (Code examples provided) ``` -------------------------------- ### Elin.plugins Feature - Exception Analyzer Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md Addition of an exception analyzer in Elin.plugins, featuring a 'close and do not show' button. This tool aids in debugging and managing exceptions encountered during gameplay or modding. ```csharp // Added "close and do not show" button for the exception analyzer. ``` -------------------------------- ### Elin.plugins - EffectSetting.guns Data Spec Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md Updates to the EffectSetting.guns data spec in Elin.plugins, adding CaneColor and CaneColorBlend. SpriteId has been renamed to IdSprite, maintaining backwards compatibility. ```csharp // EffectSetting.guns: // + Added CaneColor, CaneColorBlend to the data spec. // + Renamed SpriteId to IdSprite. This change is backwards compatible. ``` -------------------------------- ### Elin.plugins Feature - Zone Alias and Levels Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md Support for zone alias usage in Elin.plugins, including the designation of levels using '/n'. This improves the flexibility and organization of zone definitions within the modding system. ```csharp // Added support for Zone alias usage in addZone_ tags, also with /n to designate levels. ``` -------------------------------- ### Elin.plugins Feature - Element Fuzzy Lookup Optimization Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md Optimization of the caching code for element fuzzy lookup in Elin.plugins. This improves the performance of operations involving element identification and retrieval. ```csharp // Optimized the caching code for element fuzzy lookup. ``` -------------------------------- ### Customize Discord Rich Presence in C# Source: https://context7.com/gottyduke/elin.plugins/llms.txt This C# snippet demonstrates how to configure the Discord Rich Presence API for status display customization. It includes settings for language overrides, update intervals, and display options for in-game elements like class name, race, map, and danger level. It also shows how to customize presence phrases via localization files. ```csharp // Configuration file: Elin/BepInEx/config/dk.elinplugins.discordrpc.cfg [Language] LangCodeOverride = en # Override language (en, cn, jp) [Performance] UpdateTicksInterval = 8 # Ticks between updates [Display] ShowClassName = true ShowRaceName = true ShowMapName = true ShowDangerLevel = true // Customize presence phrases // Edit: Elin/BepInEx/config/erpc_localization_*.json { "building": [ "Building a base", "Constructing facilities", "Designing home layout" ], "combat": [ "Fighting monsters", "In heated battle", "Clearing dungeons" ], "exploring": [ "Exploring the world", "Discovering new places", "On an adventure" ] } ``` -------------------------------- ### Elin.plugins Bug Fixes - Quest Board and Dialogs Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md Bug fixes in Elin.plugins related to the quest board display and unique dialogs for NPCs. Includes a fix for a bug occurring after a game update in the quest board. ```csharp // Fixed a bug after game update in quest board display. // Fixed a bug where unique chat option was inserted for NPCs that don't have unique dialogs. ``` -------------------------------- ### Custom Element System with CWL API Source: https://context7.com/gottyduke/elin.plugins/llms.txt Register custom abilities, feats, and spells with automatic type qualification using the CWL API. This C# code shows how to define a custom element and access all registered custom elements in the game. ```csharp using Cwl.API.Custom; using Cwl.API.Attributes; // Define custom element in SourceElement sheet with qualified type public class CustomFeat : Element { public override void OnGain() { owner.Say("I gained a custom feat!"); } } // Auto-load element on game start using tag // In SourceElement.xlsx, add tag: addEleOnLoad // This will grant the element to player automatically // Access all custom elements foreach (var element in CustomElement.All) { Console.WriteLine($"Custom element: {element.id} - {element.type}"); } ``` -------------------------------- ### Elin.plugins Feature - Merging Excel Files Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md Support for merging Excel files such as god_talks.xlsx and dialog.xlsx with overwrites in Elin.plugins. This facilitates easier data management and updates for game content. ```csharp // Added support for god_talks.xlsx merging with overwrites. // Added support for dialog.xlsx merging with overwrites. ``` -------------------------------- ### Custom Converter as Container Functionality in Elin.plugins Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md The CustomConverter API in Elin.plugins has been extended to allow modders to transform containers into custom converters, similar to existing brewery barrels or drying racks. This expands item transformation possibilities. ```csharp // Added support for custom converter to allow modders turn containers into custom converter akin to brewery barrel/drying rack. ``` -------------------------------- ### Configure DeepSeek for Emmersive Mod Source: https://github.com/gottyduke/elin.plugins/blob/master/Emmersive/bbcode.txt This snippet demonstrates how to adjust the configuration for DeepSeek and other OpenAI-compatible models within the Emmersive mod. It covers changing the base URL and disabling JSON schema output if not supported by the model provider. ```text base_url: http://api.deepseek.com/v1 model_name: deepseek-chat response_format: type: json_object ``` -------------------------------- ### C# Event Attributes for Game Events Source: https://context7.com/gottyduke/elin.plugins/llms.txt Hook into various game events using declarative C# attributes. These attributes allow for custom logic to be executed at specific points in the game's lifecycle, such as scene initialization, action performance, character creation, source reloads, and save/load operations. No external dependencies are strictly required beyond the Cwl.API. ```csharp using Cwl.API.Attributes; [CwlEvent] public class MyEventHandlers { [CwlSceneInitEvent(Scene.Mode.StartGame, runOnce: true)] public static void OnGameStart() { EMono.pc.Say("Game started with CWL!"); } [CwlActPerformEvent] public static void OnActPerform(Act act) { if (act.HasTag("myCustomTag")) { Console.WriteLine($"Custom act performed: {act.id}"); } } [CwlOnCreateEvent] public static void OnCharaCreate(Chara chara) { if (chara.id == "my_custom_npc") { chara.SetStr(50); chara.SetDex(30); } } [CwlSourceReloadEvent] public static void OnSourceReload() { // Clear cached data MyCustomCache.Clear(); } [CwlGameIOEvent] [CwlPreSave] public static void BeforeSave() { Console.WriteLine("Saving game..."); } [CwlPostLoad] public static void AfterLoad() { Console.WriteLine("Game loaded!"); } } ``` -------------------------------- ### Animated Custom Sprites API - Clip Creation Source: https://github.com/gottyduke/elin.plugins/blob/master/AnimatedCustomSprites/README.md Provides extension methods for creating custom animation clips programmatically. These methods allow the creation of a single clip from a sprite array with specified name, type, and interval, or the creation of multiple clips from a sprite array. Requires referencing AnimatedCustomSprites.dll and using the ACS.API namespace. ```csharp // clip creation card.CreateAcsClip(sprites[], clipName, clipType, interval) card.CreateAcsClips(sprites[]) ``` -------------------------------- ### Patch BepInEx Assembly Loading with Harmony Transpiler Source: https://github.com/gottyduke/elin.plugins/blob/master/FixedPackageLoader/README.md This C# code snippet uses the Harmony library to patch the `BaseChainloader.LoadPlugins` method in BepInEx. It replaces calls to `Assembly.LoadFile` with `Assembly.LoadFrom` to resolve assembly dependencies correctly from the plugin's directory. This is a temporary fix for the Elin PackageChainloader bug. ```csharp using HarmonyLib; using System.Collections.Generic; using System.Reflection.Emit; using System.Reflection; [HarmonyPatch] internal class AssemblyLoadContextPatch { [HarmonyTranspiler] [HarmonyPatch(typeof(BaseChainloader), "LoadPlugins", [typeof(IList)])] internal static IEnumerable OnLoadPluginsIl(IEnumerable instructions) { return new CodeMatcher(instructions) .MatchForward(false, new CodeMatch(OpCodes.Call, AccessTools.Method( typeof(Assembly), nameof(Assembly.LoadFile), [typeof(string)]))) .SetOperandAndAdvance(AccessTools.Method( typeof(Assembly), nameof(Assembly.LoadFrom), [typeof(string)])) .InstructionEnumeration(); } } ``` -------------------------------- ### C# Animated Custom Sprites API: Clip Creation Source: https://context7.com/gottyduke/elin.plugins/llms.txt Create and manage animated sprite clips for custom characters using the Animated Custom Sprites (ACS) API. This involves loading sprite frames and defining animation properties like name, frame interval, and animation type. Supports automatic clip creation from named sprite files or manual creation from provided sprite arrays. Requires ACS.API. ```csharp using ACS.API; // Naming convention for sprite files: // character_acs_idle#66_0.png // character_acs_idle#66_1.png // character_acs_combat#100_0.png // Format: {name}_acs_{clipName}#{interval}_{index} // Automatically create clips from sprites Card character = CharaGen.Create("my_character"); var sprites = character.GetSprites(); // Get all sprites var clips = character.CreateAcsClips(sprites); Console.WriteLine($"Created {clips.Count} animation clips"); // Manually create single clip Sprite[] idleFrames = LoadIdleSprites(); var idleClip = character.CreateAcsClip( sprites: idleFrames, clipName: "idle", interval: 66f, // milliseconds per frame type: AcsAnimationType.Idle ); ``` -------------------------------- ### Custom Element System API Source: https://context7.com/gottyduke/elin.plugins/llms.txt Register custom abilities, feats, and spells with automatic type qualification. ```APIDOC ## Custom Element System API ### Description Register custom abilities, feats, and spells with automatic type qualification. ### Method N/A (Code examples provided) ### Endpoint N/A (Code examples provided) ### Parameters N/A (Code examples provided) ### Request Example ```csharp using Cwl.API.Custom; using Cwl.API.Attributes; // Define custom element in SourceElement sheet with qualified type public class CustomFeat : Element { public override void OnGain() { owner.Say("I gained a custom feat!"); } } // Auto-load element on game start using tag // In SourceElement.xlsx, add tag: addEleOnLoad // This will grant the element to player automatically // Access all custom elements foreach (var element in CustomElement.All) { Console.WriteLine($"Custom element: {element.id} - {element.type}"); } ``` ### Response N/A (Code examples provided) ### Response Example N/A (Code examples provided) ``` -------------------------------- ### Sprite Naming Convention for Animation Clips Source: https://github.com/gottyduke/elin.plugins/blob/master/AnimatedCustomSprites/README.md Defines the file naming convention for sprite frames to create animation clips. Frames are named using the format `id_acs_name#interval_index`, where `id` is the character/item identifier, `name` is the clip name, `interval` is the frame delay in milliseconds, and `index` is the frame number. This convention allows for automatic loading and playback of animations. ```text boxchicken_acs_idle#66_1.png boxchicken_acs_combat#66_1.png boxchicken_acs_customClipName#66_0.png ``` -------------------------------- ### Configure DeepSeek JSON Output Mode Source: https://github.com/gottyduke/elin.plugins/blob/master/Emmersive/README.md This snippet demonstrates how to modify request parameters for DeepSeek to enable JSON output mode. This is necessary because DeepSeek does not support JSON schema output mode. The change involves replacing the 'response_format' block. ```json { "response_format": { "type": "json_object" } } ``` -------------------------------- ### Custom Character Flag 'StayHomeZone' in Elin.plugins Source: https://github.com/gottyduke/elin.plugins/blob/master/CustomWhateverLoader/assets/changelogs_old_EN.md Introduction of the 'StayHomeZone' custom character flag in Elin.plugins. This flag allows custom characters to remain within their designated home zone, with the flag value adjustable in the drama sheet. ```csharp // Added support for the custom character flag "StayHomeZone" to keep custom characters in the home zone. // The flag value can be modified in the drama sheet. ``` -------------------------------- ### Animated Custom Sprites API - Clip Access Source: https://github.com/gottyduke/elin.plugins/blob/master/AnimatedCustomSprites/README.md Provides extension methods for accessing animation clips associated with a card object. Methods allow retrieving specific clips by name or type, multiple clips by name or type, or all associated clips. This functionality is available after referencing AnimatedCustomSprites.dll and the ACS.API namespace. ```csharp // clip access card.GetAcsClip(clipName) card.GetAcsClip(clipType) card.GetAcsClips(clipName) card.GetAcsClips(clipType) card.GetAllAcsClips() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.