I want to import CSV file containing the DB with C# commands in script.
(the location and name of the CSV file, the name of the generated DB are fixed in the script)
How to have the same effect as using the import tool but using C# commands?
The idea is to import automatically the DB contained in the CSV file and after that watch the conversation flow using the Dialogue System Editor
Could you please help me with the commands to use to have the same effect as using the import tool?
How to import CSV file without using import tool and anyway use Dialogue editor
Re: How to import CSV file without using import tool and anyway use Dialogue editor
Hi,
It sounds like you want to create the dialogue database from a CSV file at runtime. For general information about creating a database at runtime, please see: How To: Create Dialogue Database At Runtime.
In your own script, you can borrow the code that's in CSVConverter.cs to turn the CSV data into a database. That's one of the reasons why the Dialogue System comes with full source code, so you can see what it's doing and adopt the code for your own scripts, too.
The Dialogue Editor window only supports viewing dialogue database asset files. Generally speaking, you can't create asset files in your project at runtime. I'm working on a new version of the Dialogue Editor. It's a big task that won't be ready for a while, but I'll try to make sure it can also view runtime-created databases.
It sounds like you want to create the dialogue database from a CSV file at runtime. For general information about creating a database at runtime, please see: How To: Create Dialogue Database At Runtime.
In your own script, you can borrow the code that's in CSVConverter.cs to turn the CSV data into a database. That's one of the reasons why the Dialogue System comes with full source code, so you can see what it's doing and adopt the code for your own scripts, too.
The Dialogue Editor window only supports viewing dialogue database asset files. Generally speaking, you can't create asset files in your project at runtime. I'm working on a new version of the Dialogue Editor. It's a big task that won't be ready for a while, but I'll try to make sure it can also view runtime-created databases.
Re: How to import CSV file without using import tool and anyway use Dialogue editor
Thank you Tony for your quick answer! I will use the code from the CSVConverter.cs file