Saving database externally

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
irve
Posts: 53
Joined: Fri Jan 15, 2016 9:35 am

Saving database externally

Post by irve »

As you may remember we wanted to change the database at runtime and got the excellent importing function.

Now the database has grown considerably and the time to import the Articy XML is becoming an issue for writers on their laptops. It is a great benefit for them to change things without running Unity and messing with the source control so I'd like to keep the feature.

While I can disable the importing for the testers who have older .xml files than in project, I would like to cache the resulting database so that it will be read from the disk only once.

Do you have an idea if this can be done without an external program while running the build? So I import the xml, get the db and then save the .asset to some player specific directory for future use?
irve
Posts: 53
Joined: Fri Jan 15, 2016 9:35 am

Re: Saving database externally

Post by irve »

My googling around suggests that building a .asset file from within the player is probably not possible.

My reasonable alternative is to build a mini project which runs on a new .xml file and provides an asset bundle which could be then loaded at runtime.
User avatar
Tony Li
Posts: 20993
Joined: Thu Jul 18, 2013 1:27 pm

Re: Saving database externally

Post by Tony Li »

[Edit: Looks like we were thinking along the same lines! :) ]

Hi,

There's no easy way to save an .asset file at runtime.

My first thought was to export to Chat Mapper XML format. But, while the import method is available at runtime, the export method is currently in the editor assembly, so it's only available in the editor.

What if you run Unity in batch mode? You could set up a command line that runs Unity in the background, converts an articy:draft XML file into a dialogue database .asset, and then saves that as an asset bundle? The asset bundle would then be your cached version that you could load whenever you want at runtime.
Post Reply