amethystMushroom Posted November 13, 2016 Share Posted November 13, 2016 here it is! I wrote a program to scan through every character's speech files and sort out mentions of other characters. It was originally intended to show the relationships between characters. It looks for certain keywords related to characters (usually nicknames) as well as character-specific items. This is the python script used to generate it: Spoiler import re import html address = r"C:\Program Files (x86)\Steam\SteamApps\common\Don't Starve Together Beta\data\scripts" + "\\" speeches = [ "wathgrithr", "waxwell", "webber", "wendy", "wickerbottom", "willow", "wilson", "wolfgang", "woodie", "wx78" ] specifics = { "wathgrithr": [ "wathgrithr", "wathgrithrhat", "spear_wathgrithr" ], "waxwell": [ "waxwell", "waxwelljournal", "chesspiece_formal", "statuemaxwell", "maxwell", "maxwellhead", "shadowdigger" ], "webber": [ "webber", "webberskull" ], "wendy": [ "wendy", "abigail", "abigailheart", "abigail_flower" ], "wickerbottom": [ "wickerbottom", "book_birds", "book_tentacles", "book_gardening", "book_sleep", "book_brimstone" ], "willow": [ "willow", "lighter", "bernie_active", "bernie_inactive" ], "wilson": [ "wilson", "chesspiece_pawn" ], "wolfgang": [ "wolfgang", ], "woodie": [ "woodie", "lucy" ], "wx78": [ "wx78", "trinket_11" #lying robot ], "wes": [ "wes", "balloon", "balloons_empty" ], "charlie": [ "rose", "chesspiece_muse", "multiplayer_portal", "statue_marble", "stagehand", "announce_charlie", "announce_charlie_attack", "shadowheart" ], "misc": [ "trinket_10", "player", "maxwelllight", "maxwelllock", "maxwellthrone" ], "family": [ ] } aliases = { "wathgrithr": [ "wigfrid" ], "waxwell": [ "maxwell", "magician", "frail human" ], "webber": [ "webber", "spider child", "monster child" ], "wendy": [ "wendy", "abigail", "abby" ], "wickerbottom": [ "librarian", "wicker", "brainlady" ], "willow": [ "willow" ], "wilson": [ "wilson" ], "wolfgang": [ "wolfgang", "strongman" ], "woodie": [ "woodie", "lucy", "lumberjack", "beaver", "beard will not like such pictures" #for a special case w/ wolfgang ], "wx78": [ "wx" ], "wes": [ "\\bwes\\b" ], "charlie": [ "rose", "charlie" ], "misc": [ ], "family": [ "mother", "father", "\\bparent\\b", "grandparent", "grandpa", "grandma", "grandchild", "in-law", "wife", "husband", "spouse", "\\buncle\\b", "\\baunt\\b", "cousin", "nephew", "\\bniece", "granddad", "\\bdad\\b", "mom\\b", "ancestor", "sibling", "sister", "brother", "\\bson\\b", "grandson", "daughter\\b" ] } def mastermaker(): dump = open("master.txt", "a") master = {} for k in speeches: master[k] = {} for k in sorted(master): for s in sorted(specifics): master[k][s] = [] for char in sorted(master): print(char) speech = open(address + "speech_" + char + ".lua", "r").read() for described in master[char]: for alias in specifics[described]: match = re.search( r"\s+" + alias + r" =.*,.*", speech, re.I) if match == None: #for bracket stuff match = re.search( r"\s+" + alias + r" =[^}]*},", speech, re.I|re.M) if match: master[char][described].append(match.group()) for alias in aliases[described]: match = re.findall( r"^\s+.*\".*" + alias + r".*\",.*$", speech, re.I|re.M) for quote in match: if not quote in master[char][described]: master[char][described].append(quote) if char == described: #for inspectself match = re.search( r"\s+" + "inspectself" + r" =.*,.*", speech, re.I|re.M) if match: if not match.group() in master[char]["charlie"]: master[char][described].append(match.group()) if char == "waxwell": #charle comments match = re.findall( r"^\s+.*--.*\.\.\..*$", speech, re.I|re.M) #they end in ellipses for quote in match: if not quote in master[char]["charlie"]: master[char]["charlie"].append(quote) return master def masterhandler(first,second): for i in m[first][second]: print(i) mh = masterhandler def htmltablemaker(): dump = open("table.html", "a") dump.write("""<style> td .hideifintable {display:none;} table { overflow: hidden; } td, th { padding: 5px; position: relative; outline: 0; } body:not(.nohover) tbody tr:hover { background-color: #ffa; } td:hover::after, thead th:not(:empty):hover::after, td:focus::after, thead th:not(:empty):focus::after { content: ''; height: 10000px; left: 0; position: absolute; top: -5000px; width: 100%; z-index: -1; } td:hover::after, th:hover::after { background-color: #ffa; } td:focus::after, th:focus::after { background-color: lightblue; } </style>""") dump.write("<table border=\"1\">\n") dump.write("<tr>\n") dump.write("<td/>") for described in sorted(m["wilson"]): dump.write("<td>"+described+"</td>") dump.write("</tr>") for speaker in sorted(m): dump.write("<tr>") dump.write("<td>"+speaker+"</td>\n") for described in sorted(m[speaker]): dump.write("<td id=\""+speaker+described+"\" class=\""+speaker+" "+described+"\" onmouseover=\"document.getElementById('changer').innerHTML = document.getElementById('"+speaker+described+"').innerHTML;\"><div class=\"hideifintable\" ") #good luck dump.write("<ul>") for i in m[speaker][described]: dump.write("<li>"+html.escape(i)+"</li>") dump.write("</ul>") dump.write("</div></td>\n") dump.write("</tr>") dump.write("</table><div id=\"changer\">mouse over cells to display quotes. the speaker is on the left, the subject is on the top.</div>") dump.close() m = mastermaker() htmltablemaker() It's kind of messy, but you can see the keywords that it looks for. "aliases" is for detecting words in the quote, and "specifics" is for character-related prefabs. I think that the table works pretty well, but I am open to suggestions on how I could improve it. I probably forgot a few keywords or items, or maybe there is another category I can add. It uses javascript for readability, so just hover over the table and the corresponding data should appear in the space below it. Or, if you're on mobile, you should be able to tap. edit 11/14/16: added a few more familial terms Link to comment Share on other sites More sharing options...
Fork Posted November 13, 2016 Share Posted November 13, 2016 This is great man. This is much better than having to open the speech files and search through them myself. Good work! Link to comment Share on other sites More sharing options...
GentlemanFridge Posted November 13, 2016 Share Posted November 13, 2016 Very helpfull indeed! The family related ones are quite interesting. Especially one of WX's... Link to comment Share on other sites More sharing options...
Arlesienne Posted November 14, 2016 Share Posted November 14, 2016 I, mere mortal, seem unable to utilise it, but the sheer concept fills me with immense awe. Could somebody help me out so that I can read the results? Thanks in advance! EDIT: I am royally stupid - the link was there from the start. Oopsie! Link to comment Share on other sites More sharing options...
JohnWatson Posted November 14, 2016 Share Posted November 14, 2016 16 hours ago, Arlesienne said: I, mere mortal, seem unable to utilise it, but the sheer concept fills me with immense awe. Could somebody help me out so that I can read the results? Thanks in advance! You need to hover a cell in the table, then look below the table. Rows determine the character speaking, and the columns determine what is being spoken about. Link to comment Share on other sites More sharing options...
JohnWatson Posted November 14, 2016 Share Posted November 14, 2016 This is really interesting, some observations I got: Everyone recognizes Maxwell. Maybe Maxwell tricked all the characters like he tricked Wilson, I guess. Wendy and Webber consider each other friends. Probably because they're both the only two child characters. Wolfgang is scared of Wendy and Webber. Most of the characters make sarcastic remarks about Wes's inability to speak. "Maybe we can talk this out?", "...There something you're not telling us...", "Just tell me whatcha need and I'll get it for you. Heheheh!", "Wait, don't tell me. You lit a fire." Willow likes jokingly mocking the other characters. Wilson and Willow are the only ones with no dialogue about family. There's also this: "Hereeee's Woodie!" Link to comment Share on other sites More sharing options...
CakerKid555 Posted November 14, 2016 Share Posted November 14, 2016 Awesome. There's a lot you can find about the relationships with characters in this game using this tool. I honestly think this might help find some good chunks of backstory for these characters, including what JohnWatson said: 15 minutes ago, JohnWatson said: Everyone recognizes Maxwell. Maybe Maxwell tricked all the characters like he tricked Wilson, I guess. Wendy and Webber consider each other friends. Probably because they're both the only two child characters. Wolfgang is scared of Wendy and Webber. Most of the characters make sarcastic remarks about Wes's inability to speak. "Maybe we can talk this out?", "...There something you're not telling us...", "Just tell me whatcha need and I'll get it for you. Heheheh!", "Wait, don't tell me. You lit a fire." Willow likes jokingly mocking the other characters. Wilson and Willow are the only ones with no dialogue about family. There's also this: "Hereeee's Woodie!" So, i didn't have that much time to look through a lot of this, but i'm sure you can find lots of information about characters with characters for characters, by characters (okay, not for characters) in this game. I mean, who didn't think Don't Starve Together was going to reveal stuff when it was just a concept? Link to comment Share on other sites More sharing options...
Zhuzha Posted November 14, 2016 Share Posted November 14, 2016 Aww, of all the characters Webber talks about the family the most. Also you've missed one family mention with him: Quote WALRUSHAT = "Reminds me of grandpa." Link to comment Share on other sites More sharing options...
Lumina Posted November 14, 2016 Share Posted November 14, 2016 Great job, it's very nice. Link to comment Share on other sites More sharing options...
Mobbstar Posted November 14, 2016 Share Posted November 14, 2016 Am I the only one who thinks the "\\b" around "wes" are ironic? Link to comment Share on other sites More sharing options...
amethystMushroom Posted November 14, 2016 Author Share Posted November 14, 2016 7 hours ago, JohnWatson said: This is really interesting, some observations I got: Everyone recognizes Maxwell. Maybe Maxwell tricked all the characters like he tricked Wilson, I guess. Wendy and Webber consider each other friends. Probably because they're both the only two child characters. Wolfgang is scared of Wendy and Webber. Most of the characters make sarcastic remarks about Wes's inability to speak. "Maybe we can talk this out?", "...There something you're not telling us...", "Just tell me whatcha need and I'll get it for you. Heheheh!", "Wait, don't tell me. You lit a fire." Willow likes jokingly mocking the other characters. Wilson and Willow are the only ones with no dialogue about family. There's also this: "Hereeee's Woodie!" Nice observations! I also gathered that Webber looks up to Wickerbottom, like a teacher. 1 hour ago, Zhuzha said: Aww, of all the characters Webber talks about the family the most. Also you've missed one family mention with him: Oh, thanks! I'll add "grandpa" and "grandma" to the family list. 24 minutes ago, Mobbstar said: Am I the only one who thinks the "\\b" around "wes" are ironic? I'm not sure what you mean. "\\b" escapes to "\b", which is used to designate words in regex. Without them, it detects things like "northwest". Link to comment Share on other sites More sharing options...
VarsoZergy Posted November 15, 2016 Share Posted November 15, 2016 7 hours ago, amethystMushroom said: Everyone recognizes Maxwell. Maybe Maxwell tricked all the characters like he tricked Wilson, I guess. I think everyone is confident in the now, a little Link to comment Share on other sites More sharing options...
Mobbstar Posted November 15, 2016 Share Posted November 15, 2016 9 hours ago, amethystMushroom said: I'm not sure what you mean. "\\b" escapes to "\b", which is used to designate words in regex. Without them, it detects things like "northwest". Yeah. Wes being a mime, it's as if he's trapped in an invisible box! Link to comment Share on other sites More sharing options...
TheKingDedede Posted December 7, 2016 Share Posted December 7, 2016 Very nice! I wish I had known about this sooner, though... Oh no, did I commit some sort of crime here? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.