why are quest state conditions referenced by string?

Announcements, support questions, and discussion for Quest Machine.
Post Reply
toro_rosso
Posts: 2
Joined: Mon Nov 06, 2023 10:02 pm

why are quest state conditions referenced by string?

Post by toro_rosso »

hello,

I'm talking about QuestStateQuestCondition.requiredQuestID

why isn't it a scriptableobject reference? managing strings seems error prone and not the unity-way

am I missing something?

thanks
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: why are quest state conditions referenced by string?

Post by Tony Li »

Hi - Some quests, such as procedurally-generated quests, aren't associated with a ScriptableObject asset.

However, you don't need to use strings. Create a StringAsset ScriptableObject asset and assign that to the quest's ID field and the requiredQuestID field.

Providing the flexibility to use strings, StringAssets, or text table references makes it easier for designers who are doing more complex quest management such as creating quests at runtime or pulling down new quests from a server.
toro_rosso
Posts: 2
Joined: Mon Nov 06, 2023 10:02 pm

Re: why are quest state conditions referenced by string?

Post by toro_rosso »

ok, I get it

I'm going to tweak that code locally to support both quest references and stringId

or create another type of condition maybe

thanks!
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: why are quest state conditions referenced by string?

Post by Tony Li »

Better to create a custom class. That way you won't lose your changes when you update.

Also, this change (ability to assign quest asset or quest ID) will be in version 1.2.41.
Post Reply