Lauriel Posted January 18, 2020 Share Posted January 18, 2020 If you want to start a sentence in a dialogue with <PRO_HESHE>, it doesn't auto-capitalize. Is there a way for me to force it to have the proper case? Quote Link to comment
Grammarsalad Posted January 22, 2020 Share Posted January 22, 2020 (edited) On 1/18/2020 at 3:20 AM, Lauriel said: If you want to start a sentence in a dialogue with <PRO_HESHE>, it doesn't auto-capitalize. Is there a way for me to force it to have the proper case? Are you using EE? If so, you can create your own capitalized tokens that you would use in the appropriate places. *looking* You need to append tokentxt.2da with (e.g.) the following (edit: er, just replace "Woman" with "She" and "Man" with "He"): 2DA V1.0 * TOKEN_TEXT PROTAGONIST STAT VALUE EQUALITY STRINGT STRINGF 0 RESERVE * * * * * * 1 NP_MANWOMAN 1 35 2 0 Woman Man The entries are fairly straightforward, but here is the infos Also worth checking out: Edited January 22, 2020 by Grammarsalad Quote Link to comment
Lauriel Posted January 22, 2020 Author Share Posted January 22, 2020 (edited) Thank you, @Grammarsalad! This is perfect! Edited January 22, 2020 by Lauriel Quote Link to comment
Lauriel Posted January 23, 2020 Author Share Posted January 23, 2020 After thinking about this, I think I'd rather make a macro for Weidu that will allow the case change of any word passed to it. More generic. And can be used by any mod. Maybe a series of macros - TO_UPPER, TO_LOWER, PROPER_CASE. That's actually a function call, but I'll see what I can do. I'm not a Weidu expert (laughably NOT an expert), having just started at this, but I'll give it a shot. Quote Link to comment
Lauriel Posted January 23, 2020 Author Share Posted January 23, 2020 Gah - that's me having another brain fart. If those macros are even possible, it wouldn't help for PRO_HESHE type in-game macros. I wonder if I can make a game function that would do that one the fly. I'm not experienced enough yet. That's way beyond me at the moment ... (sorry, just typing out my thought processes). Some day, hopefully, I'll be able to do that. For now, I will just make a little mod that updates tokentxt.2da. Once again, thank you @Grammarsalad! Quote Link to comment
Grammarsalad Posted January 24, 2020 Share Posted January 24, 2020 (edited) I can think of one way to do it. You could probably do something with REPLACE_TEXTUALLY that modifies your files before you compile them. Like, you would still need to create a new token, let's call it THE_HESHE. You would put <PRO_HESHE> in all the normal places, including at the beginning of sentences, etc. But, you would then copy your own files and do a REPLACE_TEXTUALLY replacing all instances of ". <PRO_HESHE>" or ". <PRO_HESHE>" with ". THE_HESHE". So, wherever your <PRO_HESHE> follows a period, it'll be replaced by the capitalized THE_HESHE. Otherwise, it'll stay lower case. Then you compile the file(s). Edit: er, making it useful for any mod would involve more. Sorry, missed that. Hmm, you could create a "workspace" in the override or the main folder, modify the text, copy it there, and then compile. I don't know all the details re compiling so I'm not sure how best to make this something like a replacement for the weidu command Edited January 24, 2020 by Grammarsalad Quote Link to comment
Lauriel Posted January 25, 2020 Author Share Posted January 25, 2020 (edited) I put the token in, and used it in a dialogue, but the proper case pronoun was just skipped. Here's what my tokentxt.2da file looks like after I added the proper case prounoun (except everything lines up): Spoiler 2DA V1.0 * TOKEN_TEXT PROTAGONIST STAT VALUE EQUALITY STRINGT STRINGF 1 PROPER_HESHE 35 1 0 He She My dialogue line: @2011 = ~<PROPER_HESHE> is too strong for us! Run for your lives!~ [1AMERC05] I suspect it's my dialogue line? Is there another way to say 'use something from the token table'? Edited January 25, 2020 by Lauriel Quote Link to comment
Mike1072 Posted January 25, 2020 Share Posted January 25, 2020 Those last 2 columns should be strrefs according to IESDP. Quote Link to comment
Lauriel Posted January 25, 2020 Author Share Posted January 25, 2020 2 minutes ago, Mike1072 said: Those last 2 columns should be strrefs according to IESDP. Ahh, ok. I'll see if I can figure out how to do that. Hmm... It'll take some digging. Thanks! Quote Link to comment
Lauriel Posted January 25, 2020 Author Share Posted January 25, 2020 I also forgot the value for the Protagonist column. Well, that was sloppy. Quote Link to comment
Lauriel Posted January 25, 2020 Author Share Posted January 25, 2020 It was the missing column that messed it up. Thank you @Grammarsalad and @Mike1072 for the clues and suggestions! It works! Quote Link to comment
Grammarsalad Posted January 25, 2020 Share Posted January 25, 2020 @Lauriel Do you mind posting your working sample? lol, it doesn't work like I remember Quote Link to comment
Lauriel Posted January 25, 2020 Author Share Posted January 25, 2020 (edited) 2 hours ago, Grammarsalad said: @Lauriel Do you mind posting your working sample? lol, it doesn't work like I remember Sure, here you go. I'm in the process of tra-ifying it. Then I'll post it to Github so it's available to everyone. Spoiler // Add proper and upper case character pronouns to the token table // Set up array of pronouns to be entered into the token table ACTION_DEFINE_ASSOCIATIVE_ARRAY pronouns BEGIN HESHE => 0 HIMHER => 0 BOYGIRL => 0 MANWOMAN => 0 LORDLADY => 0 SIRMAAM => 0 END COPY_EXISTING ~TOKENTXT.2DA~ ~override~ READ_2DA_ENTRIES_NOW curList 3 // Check what's there against list of pronouns we'll be adding // so we don't duplicate tokens FOR (iRow = 1; iRow < curList; ++iRow) BEGIN READ_2DA_ENTRY_FORMER curList iRow 1 strToken PATCH_MATCH ~%strToken%~ WITH ~PROPER_HESHE~ BEGIN SET $pronouns("HESHE") = 1 END ~UPPER_HESHE~ BEGIN SET $pronouns("HESHE") += 2 END ~PROPER_HIMHER~ BEGIN SET $pronouns("HIMHER") = 1 END ~UPPER_HIMHER~ BEGIN SET $pronouns("HIMHER") += 2 END ~PROPER_BOYGIRL~ BEGIN SET $pronouns("BOYGIRL") = 1 END ~UPPER_BOYGIRL~ BEGIN SET $pronouns("BOYGIRL") += 2 END ~PROPER_MANWOMAN~ BEGIN SET $pronouns("MANWOMAN") = 1 END ~UPPER_MANWOMAN~ BEGIN SET $pronouns("MANWOMAN") += 2 END ~PROPER_LORDLADY~ BEGIN SET $pronouns("LORDLADY") = 1 END ~UPPER_LORDLADY~ BEGIN SET $pronouns("LORDLADY") += 2 END ~PROPER_SIRMAAM~ BEGIN SET $pronouns("SIRMAAM") = 1 END ~UPPER_SIRMAAM~ BEGIN SET $pronouns("SIRMAAM") += 2 END DEFAULT // do nothing END END SET curRow = %curList% PATCH_IF ($pronouns("HESHE") = 0 OR $pronouns("HESHE") = 2) THEN BEGIN // Add the missing pronoun to the token table PATCH_IF (%curRow% > 99) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% PROPER_HESHE 1 35 1 0 He She~ END ELSE PATCH_IF (%curRow% > 9) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% PROPER_HESHE 1 35 1 0 He She~ END ELSE BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% PROPER_HESHE 1 35 1 0 He She~ END SET curRow += 1 END PATCH_IF ($pronouns("HESHE") = 0 OR $pronouns("HESHE") = 1) THEN BEGIN // Add the missing pronoun to the token table PATCH_IF (%curRow% > 99) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% UPPER_HESHE 1 35 1 0 HE SHE~ END ELSE PATCH_IF (%curRow% > 9) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% UPPER_HESHE 1 35 1 0 HE SHE~ END ELSE BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% UPPER_HESHE 1 35 1 0 HE SHE~ END SET curRow += 1 END PATCH_IF ($pronouns("HIMHER") = 0 OR $pronouns("HIMHER") = 2) THEN BEGIN // Add the missing pronoun to the token table PATCH_IF (%curRow% > 99) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% PROPER_HIMHER 1 35 1 0 Him Her~ END ELSE PATCH_IF (%curRow% > 9) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% PROPER_HIMHER 1 35 1 0 Him Her~ END ELSE BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% PROPER_HIMHER 1 35 1 0 Him Her~ END SET curRow += 1 END PATCH_IF ($pronouns("HIMHER") = 0 OR $pronouns("HIMHER") = 1) THEN BEGIN // Add the missing pronoun to the token table PATCH_IF (%curRow% > 99) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% UPPER_HIMHER 1 35 1 0 HIM HER~ END ELSE PATCH_IF (%curRow% > 9) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% UPPER_HIMHER 1 35 1 0 HIM HER~ END ELSE BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% UPPER_HIMHER 1 35 1 0 HIM HER~ END SET curRow += 1 END PATCH_IF ($pronouns("BOYGIRL") = 0 OR $pronouns("BOYGIRL") = 2) THEN BEGIN // Add the missing pronoun to the token table PATCH_IF (%curRow% > 99) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% PROPER_BOYGIRL 1 35 1 0 Boy Girl~ END ELSE PATCH_IF (%curRow% > 9) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% PROPER_BOYGIRL 1 35 1 0 Boy Girl~ END ELSE BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% PROPER_BOYGIRL 1 35 1 0 Boy Girl~ END SET curRow += 1 END PATCH_IF ($pronouns("BOYGIRL") = 0 OR $pronouns("BOYGIRL") = 1) THEN BEGIN // Add the missing pronoun to the token table PATCH_IF (%curRow% > 99) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% UPPER_BOYGIRL 1 35 1 0 BOY GIRL~ END ELSE PATCH_IF (%curRow% > 9) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% UPPER_BOYGIRL 1 35 1 0 BOY GIRL~ END ELSE BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% UPPER_BOYGIRL 1 35 1 0 BOY GIRL~ END SET curRow += 1 END PATCH_IF ($pronouns("MANWOMAN") = 0 OR $pronouns("MANWOMAN") = 2) THEN BEGIN // Add the missing pronoun to the token table PATCH_IF (%curRow% > 99) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% PROPER_MANWOMAN 1 35 1 0 Man Woman~ END ELSE PATCH_IF (%curRow% > 9) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% PROPER_MANWOMAN 1 35 1 0 Man Woman~ END ELSE BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% PROPER_MANWOMAN 1 35 1 0 Man Woman~ END SET curRow += 1 END PATCH_IF ($pronouns("MANWOMAN") = 0 OR $pronouns("MANWOMAN") = 1) THEN BEGIN // Add the missing pronoun to the token table PATCH_IF (%curRow% > 99) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% UPPER_MANWOMAN 1 35 1 0 MAN WOMAN~ END ELSE PATCH_IF (%curRow% > 9) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% UPPER_MANWOMAN 1 35 1 0 MAN WOMAN~ END ELSE BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% UPPER_MANWOMAN 1 35 1 0 MAN WOMAN~ END SET curRow += 1 END PATCH_IF ($pronouns("LORDLADY") = 0 OR $pronouns("LORDLADY") = 2) THEN BEGIN // Add the missing pronoun to the token table PATCH_IF (%curRow% > 99) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% PROPER_LORDLADY 1 35 1 0 Lord Lady~ END ELSE PATCH_IF (%curRow% > 9) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% PROPER_LORDLADY 1 35 1 0 Lord Lady~ END ELSE BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% PROPER_LORDLADY 1 35 1 0 Lord Lady~ END SET curRow += 1 END PATCH_IF ($pronouns("LORDLADY") = 0 OR $pronouns("LORDLADY") = 1) THEN BEGIN // Add the missing pronoun to the token table PATCH_IF (%curRow% > 99) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% UPPER_LORDLADY 1 35 1 0 LORD LADY~ END ELSE PATCH_IF (%curRow% > 9) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% UPPER_LORDLADY 1 35 1 0 LORD LADY~ END ELSE BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% UPPER_LORDLADY 1 35 1 0 LORD LADY~ END SET curRow += 1 END PATCH_IF ($pronouns("SIRMAAM") = 0 OR $pronouns("SIRMAAM") = 2) THEN BEGIN // Add the missing pronoun to the token table PATCH_IF (%curRow% > 99) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% PROPER_SIRMAAM 1 35 1 0 Sir Ma'am~ END ELSE PATCH_IF (%curRow% > 9) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% PROPER_SIRMAAM 1 35 1 0 Sir Ma'am~ END ELSE BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% PROPER_SIRMAAM 1 35 1 0 Sir Ma'am~ END SET curRow += 1 END PATCH_IF ($pronouns("SIRMAAM") = 0 OR $pronouns("SIRMAAM") = 1) THEN BEGIN // Add the missing pronoun to the token table PATCH_IF (%curRow% > 99) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% UPPER_SIRMAAM 1 35 1 0 SIR MA'AM~ END ELSE PATCH_IF (%curRow% > 9) THEN BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% UPPER_SIRMAAM 1 35 1 0 SIR MA'AM~ END ELSE BEGIN INSERT_2DA_ROW %curRow% 3 ~%curRow% UPPER_SIRMAAM 1 35 1 0 SIR MA'AM~ END SET curRow += 1 END BUT_ONLY_IF_IT_CHANGES Edited January 25, 2020 by Lauriel Quote Link to comment
Grammarsalad Posted January 25, 2020 Share Posted January 25, 2020 Awesome! Thanks Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.