Story as In Game purchase

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Cussa
Posts: 22
Joined: Sat Jun 03, 2023 3:50 am

Story as In Game purchase

Post by Cussa »

I am planning to do a game app that has several stories inside it.

My idea was that when you purchase the story, it allows you to download that story and play it inside the game.

Basically, this means that instead of sending the Dialogue database inside the game app, I would like to distribute it via internet, accordingly to the fact that you have purchased that story.

I tried to see if this would be able to be done, but didn't found a way.

My innitial tought was to export the database as a JSON, with the sprites/pictures with it (or even the file itself, if possible). In the game, when you ask to start a story, I dynamically load the story based on the file downloaded via internet.

Is that possible?
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Story as In Game purchase

Post by Tony Li »

Hi,

Instead of using JSON, you could distribute the database and images as Addressables. Sequencer commands can load addressables, so you can use the SetPortrait() sequencer command to set the characters' portraits, AudioWait() to play audio, etc.

But if you wanted to distribute the database as JSON, that's fine, too. Use JsonUtility.FromJson<DialogueDatabase>() to convert it back to a dialogue database.
Cussa
Posts: 22
Joined: Sat Jun 03, 2023 3:50 am

Re: Story as In Game purchase

Post by Cussa »

Tony Li wrote: Sat Jun 03, 2023 8:12 am Instead of using JSON, you could distribute the database and images as Addressables. Sequencer commands can load addressables, so you can use the SetPortrait() sequencer command to set the characters' portraits, AudioWait() to play audio, etc.
Could you share some docs about how to use that this way?
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Story as In Game purchase

Post by Tony Li »

Hi,

Addressables require some programming. You can read more about them here: Addressables.

Briefly:

First, you'll need to prepare your database so its internal IDs don't overlap other databases. The easiest way is to set a unique Base ID value, as described in Working With Multple Databases.

Then you'll load your dialogue database from the Addressables system and then call DialogueManager.AddDatabase() to add it to the Dialogue System's runtime environment.

If the database uses AudioWait() sequencer commands to play audio, they will automatically look for the audio clips in the addressables that you've made available to the Dialogue System.
Post Reply