Jump to content

Need .tp2 Help


erebusant

Recommended Posts

I can do the setup for the language selection on the Revised Battles mod just fine. The problem lies with one of the subcomponents where I need to select once again a specific language translation of a .d file I need to install. I'm sure I have the syntax wrong, but I could use some help with this. Following is the code I'm trying to use that isn't working. I keep getting a "no such directory or file" error for the hideid.d file.

COMPILE 	~RevisedBattles/firkraag/dlg~
COMPILE	~RevisedBattles/firkraag/baf/compile~
COMPILE	~RevisedBattles/%s/hideid.d~

Link to comment

COPY ~BG1NPC/TRA/%LANGUAGE%/BG1NPC_tmp.tra~ ~etc.

 

COMPILE EVALUATE_BUFFER ~BG1NPC/Phase2/baf/X#DAV01.BAF~

USING ~BG1NPC/TRA/%LANGUAGE%/X#DAV01.TRA~

 

but I don't have a source off the top of my head for using

 

COMPILE ~mymod/%s/myfile.d~... does it work when you swap %s for %LANGUAGE% ?

Link to comment
COPY ~BG1NPC/TRA/%LANGUAGE%/BG1NPC_tmp.tra~ ~etc.

 

COMPILE EVALUATE_BUFFER ~BG1NPC/Phase2/baf/X#DAV01.BAF~

USING ~BG1NPC/TRA/%LANGUAGE%/X#DAV01.TRA~

 

but I don't have a source off the top of my head for using

 

COMPILE ~mymod/%s/myfile.d~... does it work when you swap %s for %LANGUAGE% ?

No such luck with any combination I've used so far.

Link to comment

Well, I can't get this fricking thing to work no matter what I try. Here's the latest code attempt, but I'm not too hopeful at this point.

//ACTION_IF !(lang_fre = 1) AND !(lang_ger = 1) AND !(lang_ita = 1) BEGIN
 COPY - ~trans.2DA~ ~trans.2DA~
	SET lang_eng = 0
	SET lang_fre = 0
	SET lang_ger = 0
	SET lang_ita = 0
COUNT_2DA_ROWS 2 trans_num
READ_2DA_ENTRIES_NOW ~#_trans_num~ 2
FOR (cnt=0;cnt<trans_num;cnt=cnt+1) BEGIN
  READ_2DA_ENTRY_FORMER ~#_trans_num~ cnt 2 "language"
  SPRINT "lang_eng" ~"Improved"~
  PATCH_IF ("%language%" STRING_COMPARE_CASE "%lang_eng%" =0) THEN BEGIN
	SET_2DA_ENTRY 3 1 1 ~EA_Revised_Battles_Translation~
	REPLACE ~EA_Revised_Battles_Translation~ @7123
	SET lang_eng = 1
  END
END
ACTION_IF (lang_eng = 1) BEGIN
  COMPILE	~RevisedBattles/Language/English/hideid.d~
END
//END

//ACTION_IF !(lang_eng = 1) AND !(lang_ger = 1) AND !(lang_ita = 1) BEGIN
 COPY - ~trans.2DA~ ~trans.2DA~
COUNT_2DA_ROWS 2 trans_num
READ_2DA_ENTRIES_NOW ~#_trans_num~ 2
FOR (cnt=0;cnt<trans_num;cnt=cnt+1) BEGIN
  READ_2DA_ENTRY_FORMER ~#_trans_num~ cnt 2 "language"
  SPRINT "lang_fre" ~"Ameliore"~
  PATCH_IF ("%language%" STRING_COMPARE_CASE "%lang_fre%" =0) THEN BEGIN
	SET_2DA_ENTRY 3 1 1 ~EA_Revised_Battles_Translation~
	REPLACE ~EA_Revised_Battles_Translation~ @7123
	SET lang_fre = 1
  END
END
ACTION_IF (lang_fre = 1) BEGIN
  COMPILE	~RevisedBattles/Language/French/hideid.d~
END
//END

//ACTION_IF !(lang_eng = 1) AND !(lang_fre = 1) AND !(lang_ita = 1) BEGIN
 COPY - ~trans.2DA~ ~trans.2DA~
COUNT_2DA_ROWS 2 trans_num
READ_2DA_ENTRIES_NOW ~#_trans_num~ 2
FOR (cnt=0;cnt<trans_num;cnt=cnt+1) BEGIN
  READ_2DA_ENTRY_FORMER ~#_trans_num~ cnt 2 "language"
  SPRINT "lang_ger" ~"Verbesserter"~
  PATCH_IF ("%language%" STRING_COMPARE_CASE "%lang_ger%" =0) THEN BEGIN
	SET_2DA_ENTRY 3 1 1 ~EA_Revised_Battles_Translation~
	REPLACE ~EA_Revised_Battles_Translation~ @7123
	SET lang_ger = 1
  END
END
ACTION_IF (lang_ger = 1) BEGIN
  COMPILE	~RevisedBattles/Language/German/hideid.d~
END
//END

//ACTION_IF !(lang_eng = 1) AND !(lang_fre = 1) AND !(lang_ger = 1) BEGIN
 COPY - ~trans.2DA~ ~trans.2DA~
COUNT_2DA_ROWS 2 trans_num
READ_2DA_ENTRIES_NOW ~#_trans_num~ 2
FOR (cnt=0;cnt<trans_num;cnt=cnt+1) BEGIN
  READ_2DA_ENTRY_FORMER ~#_trans_num~ cnt 2 "language"
  SPRINT "lang_ita" ~"Migliorato"~
  PATCH_IF ("%language%" STRING_COMPARE_CASE "%lang_ita%" =0) THEN BEGIN
	SET_2DA_ENTRY 3 1 1 ~EA_Revised_Battles_Translation~
	REPLACE ~EA_Revised_Battles_Translation~ @7123
	SET lang_ita = 1
  END
END
ACTION_IF (lang_ita = 1) BEGIN
  COMPILE	~RevisedBattles/Language/Italian/hideid.d~
END
//END

Currently, it will sit and error out by telling me that the trans.2da file doesn't exist, although I've previously copied that particular file into the game, plus copy and patched it earlier in the .tp2 instructions.

Link to comment

I guess the COPY will look for trans.2da in the game directory. Or is this supposed to be inlined or something?

 

What are you trying to do?

I thought you only wanted to compile a specific dialogue file according to the language selection.

(And what does your LANGUAGE command look like?)

Link to comment
I keep getting a "no such directory or file" error for the hideid.d file.
COMPILE 	~RevisedBattles/firkraag/dlg~
COMPILE	~RevisedBattles/firkraag/baf/compile~
COMPILE	~RevisedBattles/%s/hideid.d~

Do you have a hideid.tra file in the folder of whichever language you're trying to install? Unless you're doing something funky (like cmorgan, heh) it should work as-is - you shouldn't have to do anything special with USING, etc.

 

Looking at it again though, you probably shouldn't have the %s in COMPILE ~RevisedBattles/%s/hideid.d~. Rather, you'd have COMPILE ~RevisedBattles/dialog/hideid.d~ and it should take the ~RevisedBattles/swahili(or whatever)/tra/hideid.tra~ file automatically when Swahili is selected.

Link to comment

Like Miloch said :p. If you are looking for a quick way of just swapping languages, I would skip this completely and take advantage of .tra instead of hardcoded .d files. I like Miloch's, but the way I think I want to organize with as many hints to myself about what is where as possible - you could do it with

 

COMPILE ~RevisedBattles/dialog/hideid.d~

USING ~RevisedBattles/tra/%LANGUAGE%/hideid.tra~

 

or get all hardcoded and use ACTION_IF nesting to create a series of

 

COMPILE ~RevisedBattles/dialog/hideid.d~

USING ~RevisedBattles/tra/french/hideid.tra~

 

COMPILE ~RevisedBattles/dialog/hideid.d~

USING ~RevisedBattles/tra/spanish/hideid.tra~

 

 

Unless you are building that translation .2da for Megamods, so that a bunch of stuff can reference it... are you building a way of checking for language for miscellaneous patches that uses a .2da rather than flag files or the egular %language% check?

Link to comment
I keep getting a "no such directory or file" error for the hideid.d file.
COMPILE 	~RevisedBattles/firkraag/dlg~
COMPILE	~RevisedBattles/firkraag/baf/compile~
COMPILE	~RevisedBattles/%s/hideid.d~

Do you have a hideid.tra file in the folder of whichever language you're trying to install? Unless you're doing something funky (like cmorgan, heh) it should work as-is - you shouldn't have to do anything special with USING, etc.

 

Looking at it again though, you probably shouldn't have the %s in COMPILE ~RevisedBattles/%s/hideid.d~. Rather, you'd have COMPILE ~RevisedBattles/dialog/hideid.d~ and it should take the ~RevisedBattles/swahili(or whatever)/tra/hideid.tra~ file automatically when Swahili is selected.

The problem I'm running into with these damned .d files is I have a combination of traified REPLACE_SAY SUCHANDSO 7 @102 lines, along with a bunch of specifically translated ALTER_TRANS SUCHANDSO BEGIN 10 END BEGIN 0 1 END BEGIN ~REPLY~ (or ~UNSOLVED_JOURNAL~) ~Fighting with WeiDU-

 

This is the new text that I want to have in either my reply or my journal entry, but when I try to traify it it shows up in my game as @107 instead of text.~

 

because, as I've discovered, when I try to use the syntax documented in the WeiDU documentation I can get my .d file not to choke from incorrect syntax, but as my journal entry above shows, in game it will appear as @107 in either a reply or a journal entry.

Link to comment
my journal entry above shows, in game it will appear as @107 in either a reply or a journal entry.
It shouldn't if you have a .tra file and an entry for it in that file. I tested this pretty heavily while working on the BG1 NPC journals. It sounds though, like WeiDU just isn't seeing your .tra file for whatever reason - maybe check your LANGUAGE header and make sure the paths are correct. Also make sure the .tra file has the same name of the .baf you're compiling.* Otherwise it'll try to look in setup.tra, which is why you might be getting the error.

 

Edit: * Or the .d file you're compiling.

Link to comment
my journal entry above shows, in game it will appear as @107 in either a reply or a journal entry.
It shouldn't if you have a .tra file and an entry for it in that file. I tested this pretty heavily while working on the BG1 NPC journals. It sounds though, like WeiDU just isn't seeing your .tra file for whatever reason - maybe check your LANGUAGE header and make sure the paths are correct. Also make sure the .tra file has the same name of the .baf you're compiling.* Otherwise it'll try to look in setup.tra, which is why you might be getting the error.

 

Edit: * Or the .d file you're compiling.

Can you post an example of the syntax you used for the BG1 NPC Journals? I know it's calling the .tra file because if I compile it by calling directly in the .tp2 instead of trying to make it language selectable it compiles just fine and both the REPLACE_SAY and the ~strref~ entries update properly, so the only thing I can think of is I'm doing something stupid with the syntax in the ALTER_TRANS that won't let it take properly (but also doesn't cause WeiDU to choke). If I could get that to work, then I could update my .tra files and not have to worry about it because the auto-tra would find it.

Link to comment

In x#jaqu.d:

IF ~Global("X#JaheiraQuestKillAldeth","GLOBAL",1)~ THEN DO ~SetGlobal("X#JaheiraQuest","GLOBAL",2) AddExperienceParty(500) EraseJournalEntry(@184) AddJournalEntry(@185,QUEST_DONE)~ UNSOLVED_JOURNAL @163 EXIT

In x#jaqu.tra, there are entries for all the @ references under journal headings "Aldeth Sashenstar" and "Shadows in Cloakwood".

 

In bg1npc.tp2:

AUTO_TRA ~BG1NPC/TRA/%s~

You have that of course, don't you? Sometimes we miss the bleedin' obvious, heh. Though the fact some of your strings are getting TRAed and not others makes me wonder whether something weird is going on.

Link to comment
In x#jaqu.d:
IF ~Global("X#JaheiraQuestKillAldeth","GLOBAL",1)~ THEN DO ~SetGlobal("X#JaheiraQuest","GLOBAL",2) AddExperienceParty(500) EraseJournalEntry(@184) AddJournalEntry(@185,QUEST_DONE)~ UNSOLVED_JOURNAL @163 EXIT

In x#jaqu.tra, there are entries for all the @ references under journal headings "Aldeth Sashenstar" and "Shadows in Cloakwood".

 

In bg1npc.tp2:

AUTO_TRA ~BG1NPC/TRA/%s~

You have that of course, don't you? Sometimes we miss the bleedin' obvious, heh. Though the fact some of your strings are getting TRAed and not others makes me wonder whether something weird is going on.

Here's the syntax I was using:

ALTER_TRANS FIRKRA02 BEGIN 21 END BEGIN 0 END BEGIN ~UNSOLVED_JOURNAL~  ~@108~ END

which merely replaces the strref

Journal entry:
Firkraag Himself.

I have encountered the true Firkraag, a gigantic Red Dragon.  He has tormented me due to a past grudge with Gorion as well as some faint interest in my status as a child of Bhaal.  Either way, his interest in me is now finished.

He would have preferred to send me on my way, but I shall not leave it at that!
(StrRef:22917)

with the strref

Journal entry:
I am quite good at cowing even the strongest creatures with words and guile. What good am I?  What good are you?
(StrRef:108)

Let me try it without the ~~'s and see what happens.

Link to comment

In x#jaqu.d:

IF ~Global("X#JaheiraQuestKillAldeth","GLOBAL",1)~ THEN DO ~SetGlobal("X#JaheiraQuest","GLOBAL",2) AddExperienceParty(500) EraseJournalEntry(@184) AddJournalEntry(@185,QUEST_DONE)~ UNSOLVED_JOURNAL @163 EXIT

In x#jaqu.tra, there are entries for all the @ references under journal headings "Aldeth Sashenstar" and "Shadows in Cloakwood".

 

In bg1npc.tp2:

AUTO_TRA ~BG1NPC/TRA/%s~

You have that of course, don't you? Sometimes we miss the bleedin' obvious, heh. Though the fact some of your strings are getting TRAed and not others makes me wonder whether something weird is going on.

Here's the syntax I was using:

ALTER_TRANS FIRKRA02 BEGIN 21 END BEGIN 0 END BEGIN ~UNSOLVED_JOURNAL~  ~@108~ END

which merely replaces the strref

Journal entry:
Firkraag Himself.

I have encountered the true Firkraag, a gigantic Red Dragon.  He has tormented me due to a past grudge with Gorion as well as some faint interest in my status as a child of Bhaal.  Either way, his interest in me is now finished.

He would have preferred to send me on my way, but I shall not leave it at that!
(StrRef:22917)

with the strref

Journal entry:
I am quite good at cowing even the strongest creatures with words and guile. What good am I?  What good are you?
(StrRef:108)

Let me try it without the ~~'s and see what happens.

Without the ~~'s it chokes. It needs either ~~ or "" bracketing the UNSOLVED_JOURNAL for it to go. Unfortunately it appears that this syntax for the REPLY and JOURNAL altering is looking for an existing strref and won't accept a new string. The only way it seems to be able to introduce a new string is to ~put the string in like thus~ - Therein lies the rub,,, :p

Unless there is a different syntax to use that works that is different than the tutorial in the WeiDU documentation.

Link to comment

In x#jaqu.d:

IF ~Global("X#JaheiraQuestKillAldeth","GLOBAL",1)~ THEN DO ~SetGlobal("X#JaheiraQuest","GLOBAL",2) AddExperienceParty(500) EraseJournalEntry(@184) AddJournalEntry(@185,QUEST_DONE)~ UNSOLVED_JOURNAL @163 EXIT

In x#jaqu.tra, there are entries for all the @ references under journal headings "Aldeth Sashenstar" and "Shadows in Cloakwood".

 

In bg1npc.tp2:

AUTO_TRA ~BG1NPC/TRA/%s~

You have that of course, don't you? Sometimes we miss the bleedin' obvious, heh. Though the fact some of your strings are getting TRAed and not others makes me wonder whether something weird is going on.

Here's the syntax I was using:

ALTER_TRANS FIRKRA02 BEGIN 21 END BEGIN 0 END BEGIN ~UNSOLVED_JOURNAL~  ~@108~ END

which merely replaces the strref

Journal entry:
Firkraag Himself.

I have encountered the true Firkraag, a gigantic Red Dragon.  He has tormented me due to a past grudge with Gorion as well as some faint interest in my status as a child of Bhaal.  Either way, his interest in me is now finished.

He would have preferred to send me on my way, but I shall not leave it at that!
(StrRef:22917)

with the strref

Journal entry:
I am quite good at cowing even the strongest creatures with words and guile. What good am I?  What good are you?
(StrRef:108)

Let me try it without the ~~'s and see what happens.

Without the ~~'s it chokes. It needs either ~~ or "" bracketing the UNSOLVED_JOURNAL for it to go. Unfortunately it appears that this syntax for the REPLY and JOURNAL altering is looking for an existing strref and won't accept a new string. The only way it seems to be able to introduce a new string is to ~put the string in like thus~ - Therein lies the rub,,, :p

Unless there is a different syntax to use that works that is different than the tutorial in the WeiDU documentation.

OK - Qwinn over at Pocket plane got me pointed in the right direction. After dinking around with this some more using WeiDU v206 it turns out that proper ALTER_TRANS syntax uses both @ and # to call strings from the same translation file. My .d code that properly patches my dialogs is as follows:

REPLACE_SAY JAHEIRAJ 358 @101

REPLACE_SAY KELDORJ 100 @102
REPLACE_SAY KELDORJ 101 @104

REPLACE_SAY EDWINJ 43 @103
REPLACE_SAY EDWINJ 44 @105

REPLACE_SAY MINSCJ 98 @106


REPLACE_SAY FIRKRA02 6 @107
ALTER_TRANS FIRKRA02 BEGIN 21 END BEGIN 0 END BEGIN ~UNSOLVED_JOURNAL~ ~#108~ END

ALTER_TRANS FIRKRA02 BEGIN 36 END BEGIN 2 END BEGIN ~REPLY~ ~#109~ END

This will resolve the multiple translation of .d file issue I have.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...