Quest Items as Scriptable Objects

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
JamesTFreaknKirk
Posts: 13
Joined: Mon Jan 16, 2023 9:44 am

Quest Items as Scriptable Objects

Post by JamesTFreaknKirk »

Hello,

I've finished making my first quest with the dialogue system and so far it works incredibly well.

I'd like each quest to give a specific item to the player.

Right now my inventory system works with scriptable objects, and the item is given to the player through a method on a monobehavior that takes that scriptable object (and triggers UI components and all that jazz).

Question 1. is there a way to reference a scriptable object as a variable? so when the quest is complete I could somehow pass it through the method. (when I was looking at the variable system I thought, maybe I could make a reference table with integers, that refers to an item to give the player)

Question 2. How would I go about invoking a method that passes through that scriptable object?

alternatively, is there just a better way of doing this that is already designed into the dialogue system

Thanks so much for your time! :D
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Items as Scriptable Objects

Post by Tony Li »

Hi,

The Dialogue System has a tradeoff in that its content is all text. On the plus side, this means you can export and import (e.g., import from external formats such as articy:draft, export to CSV) without losing anything. But on the minus side, it doesn't allow for asset-based references since those are Unity GUID-specific. You could either specify the item by name, or write a custom field type that shows the items in a dropdown menu. Internally, the info stored in the field would be a string or int representing an item in an item database asset or something like that. Several Dialogue System games use this approach.
JamesTFreaknKirk
Posts: 13
Joined: Mon Jan 16, 2023 9:44 am

Re: Quest Items as Scriptable Objects

Post by JamesTFreaknKirk »

Thanks for your help!

It works fine if I just refer to an indexed table of my scriptable objects! thanks for your help!
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Items as Scriptable Objects

Post by Tony Li »

Glad to help!
Post Reply