Author Topic: About CT (and CC/RD) scripts  (Read 1865 times)

froodo

  • Porrean (+50)
  • *
  • Posts: 75
    • View Profile
    • About Me
About CT (and CC/RD) scripts
« on: February 11, 2023, 08:49:07 pm »
I'm planning to play a bit with chatbots, and thought if there was any scripts of the game to extract the lines of each character to feed an AI to chat like one of them on Discord.

Although i know there is scripts for the games posted here, i noticed those txt files are formatted in a way that i don't know how to get the lines of a specific character programatically, needing to resort to manually copying and pasting each line to a organized text file to feed the ai (i don't wanna do it).

So, my question is: Is there any script to one (or both) the games that have the lines organized (each in a single line, no whitespace or line breaks) and relatively easy to parse programatically?

Mr Bekkler

  • Bounty Hunter
  • Zurvan Surfer (+2500)
  • *
  • Posts: 2736
  • So it goes.
    • View Profile
Re: About CT (and CC/RD) scripts
« Reply #1 on: February 12, 2023, 03:16:13 am »
Correct me if I'm wrong. The closest you may find for CC is my somewhat cleaned up version of the Cross Radical Dreamers Script here http://chronofan.com/Black/Publications/en_revised.csv

It's a CSV file which you can open in any spreadsheet application or upload to Google Drive and open in Sheets. You can parse through it like any Excel spreadsheet and in Sheets all Excel formulas work so you could write one that splits the names and the dialogue text into separate columns or whatever you need to do.

In it, I did things like consolidate any dialogue that is not specific to a named character down to the most generic readable form, intended for analysis of the original lines. If you're not aware the character-specific dialogue was all written normally with accents "baked in" but in instances where any party member could say a given line, the line would have certain "accent" marker characters injected in that would be chosen to differentiate them per character, without needing to either keep them generic or add a ton of branching conditionals in the code in each of these instances just for text variation. So for those generic "party member" lines, where no character is named, it is not exactly what you would see in-game. I changed some variable names that would be replaced in-game with real in-game item or element or character names with generic text that describes the thing, like "Sample Element".

Also some things I did not do. I didn't remove some markup that I found interesting or useful to someone reading. For example, a tilde character ~ was used to represent line breaks during dialogue, which can be important for figuring out where the emphasis was, if it's in the middle of a line it's almost like an ellipsis. I did not reorganize any lines to be more in order of appearance, nor did I remove the menu text, so you will still need to manually delete some things in there for your purposes. I did not add NPC labels that were not already there for unnamed characters, so some text is "floating" without context, in fact there are some random NPC names in some rows near the bottom, I may have orphaned them.
« Last Edit: February 12, 2023, 03:21:23 am by Mr Bekkler »