agb1 Posted November 20, 2016 Share Posted November 20, 2016 Try this: ACTION_IF NOT VARIABLE_IS_SET ~%EE_LANGUAGE%~ BEGIN COPY_EXISTING ~leat01.itm~ ~override~ READ_STRREF 0x08 ac_string BUT_ONLY ACTION_FOR_EACH lang IN ~en_US~ ~pl_PL~ ~de_DE~ ~es_ES~ ~fr_FR~ ~cs_CZ~ ~ru_RU~ ~ko_KR~ BEGIN WITH_TRA ~scales_of_balance/language/%lang%/armor.tra~ BEGIN OUTER_SPRINT ac_lang @10001 END ACTION_IF NOT (~%ac_string%~ STRING_CONTAINS_REGEXP ~%ac_lang%~) BEGIN OUTER_SPRINT yaras_lang ~%lang%~ END END END I changed the first line (added ~~ around EE_LANGUAGE) and the first WITH_TRA line. Link to comment
subtledoctor Posted November 20, 2016 Author Share Posted November 20, 2016 Yeah I tried that, it didn't make a difference. I know usually parse errors indicate a problem *before* the indicated line number, but it seems like in this case it really is a problem with the WITH_TRA line... Link to comment
agb1 Posted November 20, 2016 Share Posted November 20, 2016 WITH_TRA was added in WeiDU v240. Can you make sure you are using WeiDU v240? (weidu --version) Edit: I added the block of code I offered above to a random tp2 file and tried running it with WeiDU v240 and it did not give me any parse errors. Link to comment
subtledoctor Posted November 21, 2016 Author Share Posted November 21, 2016 Jeez, looks like my purge of Weidu 239 from my system was not complete. All fixed now. Sorry folks, and thank you agb1. Link to comment
agb1 Posted November 21, 2016 Share Posted November 21, 2016 On second thought, that first ~%EE_LANGUAGE%~ might need to be changed to ~EE_LANGUAGE~ without the %%, since you're checking if it exists, not trying to retrieve its value. Link to comment
subtledoctor Posted November 21, 2016 Author Share Posted November 21, 2016 Yeah - the final code is like this: ACTION_IF VARIABLE_IS_SET %EE_LANGUAGE% BEGIN OUTER_SPRINT yaras_lang ~%EE_LANGUAGE%~ ENDThe first instance only checks whether the variable is defined, so you only need the bare variable (enclosed by %%). The second instance sets a different variable to the *string* represented by the variable, so you need another set of ~~ or "". (Pro tip: %%, ~~, and "" are all interchangeable, and each can represent either 'this is a variable' or 'this is a string.' I know most people around here already know that, I'm just mentioning it in case any amateurs stumble upon this thread in the future.) Link to comment
agb1 Posted November 21, 2016 Share Posted November 21, 2016 While it is technically correct that %/"/~ are interchangeable, I find it confusing to use %% to surround a string, because %% is commonly used to retrieve a variable's value, so my initial thought whenever I see %var% is that it is retrieving the value. I have to look again, notice it doesn't also have ~~ or "" around it and realize it's actually just a string. For clarity, I try to be consistent about using ~ ~ or " " (if the string itself contains a ~) to surround strings, and only using % % when retrieving a variable's value. Link to comment
subtledoctor Posted November 21, 2016 Author Share Posted November 21, 2016 That's my practice as well. %variable% for variables, ~string~ or "string" for strings. It was a long time before i realized they are arbitrarily interchangeable. The fourth delimiter is ~~~~~string~~~~~ (five tildes on each side of the text). I've actually used all four together in a single line of Weidu... thankfully i have not encountered a situation where it was necessary to use more than four delimiters. Link to comment
Mike1072 Posted November 21, 2016 Share Posted November 21, 2016 I prefer to always quote strings (using ~ or ") and never quote variable names. VARIABLE_IS_SET %EE_LANGUAGE% The reason this is confusing is because % is not retrieving a value here. The name of the variable is being passed to VARIABLE_IS_SET. Link to comment
subtledoctor Posted June 22, 2017 Author Share Posted June 22, 2017 Thread-o Necro! I need another little bit of help. Can anyone tell me how the word "Duration" is translated into various languages in spell descriptions? (You know, that one line up near the top of the description where it says stuff like, Resist Fear Level: 2 Range: 30 ft. Duration: 1 hour I need to do a REPLACE_TEXTUALLY on all spell descriptions, using this string: ~^Duration:.+$~ I'm thinking to do it the same way as with the YARAS mod: make a tiny .tra file for each language the game supports, find the installed game language, and use WITH_TRA to run the REPLACE_TEXTUALLY and have it catch the right line of text and replace it with the new duration. Link to comment
subtledoctor Posted June 22, 2017 Author Share Posted June 22, 2017 Is there a space between "Durée" and the colon? In French : ~^Durée :.+$~ Link to comment
Gwendolyne Posted June 22, 2017 Share Posted June 22, 2017 Yes, in French, there is always a space before ; : ? and !. That's the reason why I wrote it, otherwise, your replacement wont change anything. Link to comment
subtledoctor Posted June 22, 2017 Author Share Posted June 22, 2017 Cool, thanks. I wish there was a way I could just look at different versions of dialog.tlk, without reinstalling the game. Am I missing something obvious? I can find an example strref from the English version of dialog.tlk in Near Infinity... but all of the other installed versions of dialog.tlk are sitting there in the /lang folders. Rather than asking people on the internet, it would be nice if I could find the same strref in those .tlk files and get the answer myself... Link to comment
Cahir Posted June 22, 2017 Share Posted June 22, 2017 In Polish this would be: ~^Czas działania: .+$~ Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.