Expand Inventory through Quest completion

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
munchyou
Posts: 1
Joined: Sat Nov 20, 2021 5:29 am

Expand Inventory through Quest completion

Post by munchyou »

Hello! I'm currently using Corgi Engine + Inventory Engine and Dialogue system. I've very little experience with using Unity and engines in general, so I might be slow to understand... :?

I'm wondering if is it possible for the quest system to reward player with inventory slot expansion upon completing quest? If not then should I create 2 inventories disable/destroy the small inventory when the quest completes? What would be the best course of action to expand the player's current inventory?
User avatar
Tony Li
Posts: 22158
Joined: Thu Jul 18, 2013 1:27 pm

Re: Expand Inventory through Quest completion

Post by Tony Li »

Hi,

Yes, you can do that. Here's an updated Inventory Engine Support package that will make it easier:

DS_InventoryEngineSupport_2021-11-20.unitypackage

It adds a new Lua function: mmResizeSlots("inventoryName", columns, rows)

For example, to resize your "MainInventory" inventory to 6 columns x 2 rows, use this Lua code when completing a quest:

Code: Select all

mmResizeSlots("MainInventory", 6, 2)
Note that this doesn't save the new size of the inventory in saved games. If you need to do this, you could record the inventory size in Dialogue System variables. Then add a Dialogue System Trigger to the scene that's set to OnStart. Select Add Action > Run Lua Code, and use the mmResizeSlots() Lua function to set the size.
Post Reply