Query Database for Line Count / Character
-
- Posts: 222
- Joined: Wed Jan 22, 2020 10:48 pm
Query Database for Line Count / Character
Is there a way to run queries against a dialogue database to get statistics like lines per character?
Re: Query Database for Line Count / Character
Hi,
It's just a C# structure. You can read through it to pull together numbers of statistics. Example:
LINQ queries would be probably be more succint than the code above.
It's just a C# structure. You can read through it to pull together numbers of statistics. Example:
Code: Select all
int actorID = database.GetActor("Player").id;
int numLines = 0;
foreach (var conversation in database.conversations)
{
foreach (var entry in conversation.dialogueEntries)
{
if (entry.actorID = actorID) numLines++;
}
}
Debug.Log("Lines spoken by player: " + numLines);
-
- Posts: 222
- Joined: Wed Jan 22, 2020 10:48 pm
Re: Query Database for Line Count / Character
Oh perfect! Thank you!
Re: Query Database for Line Count / Character
Happy to help!