UnearthedArcana / B_Spells

6 stars 2 forks source link

Tra files #1

Open Grammarsalad opened 7 years ago

Grammarsalad commented 7 years ago

Incorporate languages other than English from iwdee

Grammarsalad commented 7 years ago

I think the idea is for you(the maker, not the user) to install it on IWDEE once with each native language IWDEE supports, reading the name and desc during that installation and writing it to a textfile which can then be used as a TRA for each language.

It's pretty simple. Put an empty ~%trafile%.TRA~ file in the override. Delete/Move weidu.cong so you can change languages.

OUTER_SET   index = 1
COPY_EXISTING   ~%spell%.spl~   override    // for each spell you need
    READ_STRREF NAME1   ref1
    READ_STRREF UNIDENTIFIED_DESC   ref2
    INNER_ACTION    BEGIN
        APPEND  ~%trafile%.tra~ ~@%index%="%ref1%"~
        OUTER_SET   idx += 1
        APPEND  ~%trafile%.tra~ ~@%index%="%ref2%"~
    END
BUT_ONLY

You would need to adjust so the index so the traref#'s match your english TRA. After installation, save/rename a copy of that TRA file for your mod, then uninstall, change languages, repeat. I tried posting an example of the output, but I don't think the forums liked some of the foreign characters it contained.

Grammarsalad commented 7 years ago

yeah, generate TRA file for each language beforehand with code installed on IWD:EE to get these strings. Something like this:

<<<<<<<< .../spell.tra

COPY ~.../spell.tra~ ~spell.tra~

COPY_EXISTING - ~spell.ids~ ~override~ COUNT_2DA_ROWS 2 cntrow FOR (cnt = 0; cnt <= "%cntrow%"; cnt = cnt + 1) BEGIN READ_2DA_ENTRY cnt 1 2 spell_name INNER_ACTION BEGIN LAF RES_NUM_OF_SPELL_NAME STR_VAR spell_name = EVAL ~%spell_name%~ RET spell_res spell_num END COPY_EXISTING - ~%spell_res%.spl~ ~override~ READ_STRREF 0x50 string APPEND_OUTER ~spell.tra~ "//%spell_name%%LNL%@%cnt% = ~%string%~" END END

If you're going to use above code prepare spell.ids file first to only have those spells references that you want to extract strings from. Do it for each language and you have all the TRA files ready to be implemented.

edit: added missing RES_NUM_OF_SPELL_NAME and removed not needed code (leftover from my implementation)

Grammarsalad commented 7 years ago

https://forums.beamdog.com/discussion/59668/iwd-divine-spells-in-bgee-sod-and-bg2ee/p5