Jump to content

STRING_SET Alternative for Changing Weapon Style Descriptions?


Purudaya

Recommended Posts

So I've been using the following code to change weapon style names and descriptions to match the changes in my mod:

ACTION_IF GAME_IS ~bgee~ BEGIN                       
  STRING_SET ~25021~ @10020
  STRING_SET ~25044~ @10011
  STRING_SET ~25045~ @10021
  STRING_SET ~25046~ @10031
  STRING_SET ~24999~ @10041
END ELSE ACTION_IF GAME_IS ~bg2ee~ BEGIN
  ....

This works absolutely fine for BG2 and IWD but does absolutely nothing in BG1 even on a fresh install. I know that the WeiDU documentation recommends against using STRING_SET, but this format was taken straight from the Skills and Abilities mod. Could someone help me figure out what I'm doing wrong?

Alternatively, I'd love to be able to change the values in weapprof.2DA the same way that you change kit and class descriptions with 

ACTION_IF (FILE_EXISTS_IN_GAME ~clastext.2da~) BEGIN
    COPY_EXISTING ~clastext.2da~ ~override~
        COUNT_2DA_COLS cols
        READ_2DA_ENTRIES_NOW rows cols
        FOR (row = 1; row < rows; ++row) BEGIN
            READ_2DA_ENTRY_FORMER rows row 0 ~kit_name~
            PATCH_IF ~%kit_name%~ STRING_EQUAL_CASE ~THIEF~ BEGIN
                SET patch_row = %row%
            END
        END
        SET_2DA_ENTRY %patch_row% 4 cols RESOLVE_STR_REF (@110)
    BUT_ONLY
END

...but I'm still somewhat new at this and am unsure how to point this to, say, SWORDANDSHIELD in weapprof.2da. Again, any help would be appreciated!

Edited by Purudaya
typo
Link to comment

The strings are different in BGEE, so when you use your STRING_SET there you are actually changing some other strings!

See here for an example of how to find the fighting style strings in any particular game, and then 1) change them with STRING_SET (the part commented out) and 2) changing them via a better technique, simply adding different strings into WEAPPROF.2da. (IIRC the game uses that file when displaying the style name/description strings in the UI.)

Edited by subtledoctor
Link to comment
47 minutes ago, subtledoctor said:

The strings are different in BGEE, so when you use your STRING_SET there you are actually changing some other strings!

See here for an example of how to find the fighting style strings in any particular game, and then 1) change them with STRING_SET (the part commented out) and 2) changing them via a better technique, simply adding different strings into WEAPPROF.2da. (IIRC the game uses that file when displaying the style name/description strings in the UI.)

Thanks for your reply! I did know that the different games use different strings; my full code looks like this:

ACTION_IF GAME_IS ~bgee~ BEGIN                       
  STRING_SET ~25021~ @10020                                        // Shield-Fighting name
  STRING_SET ~25044~ @10011                                        // Two-Handed description
  STRING_SET ~25045~ @10021                                           // Shield-Fighting description
  STRING_SET ~25046~ @10031                                         // Single-Weapon description
  STRING_SET ~24999~ @10041                                         // Two-Weapon description  
END ELSE ACTION_IF GAME_IS ~bg2ee~ BEGIN                 
  STRING_SET ~31136~ @10020
  STRING_SET ~34171~ @10011
  STRING_SET ~34173~ @10021
  STRING_SET ~34174~ @10031
  STRING_SET ~34176~ @10041
END ELSE ACTION_IF GAME_IS ~iwdee~ BEGIN                     
  STRING_SET ~31136~ @10020
  STRING_SET ~37729~ @10020
  STRING_SET ~37728~ @10011
  STRING_SET ~37730~ @10021
  STRING_SET ~37732~ @10031
  STRING_SET ~37734~ @10041
END

I've double checked them manually and it's just really strange that it only fails for BGEE. That said, your link looks like a much more elegant solution - do I understand correctly that this method will work regardless of the game so I don't have to worry about ACTION_IF? They all use the same weapprof.2da line for line, right?

Edit: so I've inserted the lines you recommended as follows and the strings still aren't being overwritten for some reason:

COPY_EXISTING ~weapprof.2da~ ~override~
    READ_2DA_ENTRY 31 2 1 2h_string 
    READ_2DA_ENTRY 31 3 1 2h_desc   
    READ_2DA_ENTRY 32 2 1 sns_string 
    READ_2DA_ENTRY 32 3 1 sns_desc   
    READ_2DA_ENTRY 33 2 1 sws_string 
    READ_2DA_ENTRY 33 3 1 sws_desc   
    READ_2DA_ENTRY 34 2 1 dw_string 
    READ_2DA_ENTRY 34 3 1 dw_desc   

    STRING_SET %2h_string% @10010
    STRING_SET %sns_string% @10020
    STRING_SET %sws_string% @10030
    STRING_SET %dw_string% @10040
    STRING_SET %2h_desc% @10011
    STRING_SET %sns_desc% @10021
    STRING_SET %sws_desc% @10031
    STRING_SET %dw_desc% @10041

Could I be missing something more obvious?

Edited by Purudaya
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...