LordVGames-DropSourceForItems icon

DropSourceForItems

Adds a drop source field to item pickups for modders to know what GameObject an item came from. Mod does nothing on it's own!

Last updated 5 hours ago
Total downloads 6
Total rating 0 
Categories Mods Libraries Items
Dependency string LordVGames-DropSourceForItems-1.0.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

bbepis-BepInExPack-5.4.2121 icon
bbepis-BepInExPack

Unified BepInEx all-in-one modding pack - plugin framework, detour library

Preferred version: 5.4.2121
MonoDetour-MonoDetour_BepInEx_5-0.7.15 icon
MonoDetour-MonoDetour_BepInEx_5

HarmonyX interop & BepInEx 5 logger integration for MonoDetour. Initializes MonoDetour early as a side effect.

Preferred version: 0.7.15

README

DropSourceForItems

This mod adds new fields to GenericPickupController, GenericPickupController.CreatePickupInfo and PickupPickerController that store what GameObject an item was spawned from and its name (eventually for the cases of enemies dropping an item on death). To use these new fields, use the extension methods GetPickupDropSource, SetPickupDropSource and GetCachedPickupDropSourceName. The cached name is set for you when using SetPickupDropSource.

The functionality for setting drop sources were manually added, so mods' own item drops won't support this unless added by this mod or themselves. Items from choice pickups have their drop source set to the choice pickup itself instead of the thing that spawned the choice pickup (i.e. drop source from void potential is the void potential instead of the thing that spawned the void potential. void potential itself will have its drop source set to the thing that dropped it)

To use this, just add the DropSourcePatcherInterop.dll file from the mod as a project reference. Adding the mod from thunderstore through nuget may also work, but I have not tested that yet

Mods supported

  • EnemiesReturns
    • Lynx shrine
  • RiskyTweaks
    • Combat shrine dropping items

Todo

  • Setup drop sources for items dropped by enemies on death
    • Then you could the cached drop source name (since the enemy would be null after death) to find the type of body that dropped the item