Inventory & Dialogue System Integration
Posted: Fri May 27, 2022 8:53 am
So part of my planned game design is to pick up items in my game, and have that interact with my dialogue system. For example: Dog NPC wants a bone (have a conversation check to see if player.hasBone == true), give the dog the bone if you have it and the quest completes. That part is simple enough in theory, but I would like the ability for the dialogue system to interact with my inventory. The simple solution is the OnUse just set through lua the player boolean hasBone to true, and destroy the bone object on interaction, but that doesn't play well with an inventory system.
That solution doesn't add the bone to my existing inventory system where before it would add any item on trigger when I walked over it, however I want to change over to using a button interaction when clicking the object to add it to my inventory using the Proximity Selector instead (it'll be a detective game where I want to intentionally pick things up, not just run over them)
I have a script for item pick up using OnTriggerEnter2D from before, and I'd like to reuse that code, could this be done via lua or something when I interact with the object? Thanks.
That solution doesn't add the bone to my existing inventory system where before it would add any item on trigger when I walked over it, however I want to change over to using a button interaction when clicking the object to add it to my inventory using the Proximity Selector instead (it'll be a detective game where I want to intentionally pick things up, not just run over them)
I have a script for item pick up using OnTriggerEnter2D from before, and I'd like to reuse that code, could this be done via lua or something when I interact with the object? Thanks.