Getting Item Creation Events - is this possible?

Hello,

I’m interested in seeing if it’s possible to get data via scripting about item creation events, or placement of items into the stash? Also, for items, is there meta data that is attached to item that has been created? How is that accessed if that exists? My goal is to get data about items stored in the stash dynamically as the game is running, and place that data into a sqlite like (AergoLite) database to be used in an item trade system using iron bars, creating an NPC character to interact with the player(s).

As far as I know, items don’t have metadata beyond the following:

Item DBR path (Required)
Prefix DBR path
Suffix DBR path
Component DBR path
Augment DBR path
Seed (Required)
Count (Required, usually one, except for stackables like Components/Materia)

Items have the following hooks for scripting:

onPickUp
onDrop
onInitialUpdate
onAddToWorld
onRemoveFromWorld
onDestroy

I am unsure if any of these fire when an item is placed in the stash, but I somewhat doubt it.

However, you can just monitor the stash file for changes and read it on the fly. Grim Dawn Item Assistant seems to be able to detect when the stash is opened/closed. May want to peruse its source code here: GitHub - marius00/iagd or consult the main thread.

Thank you this is insightful - basically if I can create such a mod, It would be great to facilitate trade with other players easily I think. I can always try to do something like hashing and public key cryptography to make items bound to a particular user or something to that effect, but the fine details need to be worked out, but this does seem very promising.

This is called when an item is added in any stash (inventory, shared stash, private stash)

Item Assistant overrides this and returns false when Item Assistant has taken the item. This allows IA to loot items instantly when placing them in the last stash tab.

What he wants is not possible without DLL injection, but it should be fairly trivial to get what he wants using the IA code.

GD MultiStash also uses the IA dll for stash detection.