Jump to content

<PRO_HESHE> in proper case


Lauriel

Recommended Posts

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 by Grammarsalad
Link to comment

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.

Link to comment

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! :)

Link to comment

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 by Grammarsalad
Link to comment

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 by Lauriel
Link to comment

  

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 by Lauriel
Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...