Jump to content

Journal.tra


jastey

Recommended Posts

Is there a possibility to put journal entries into a separate tra, so they get references from all .d files upon install? If yes, how would I do that, and what are the restrictions?

 

I just realised this would be handy, with journal entries removed in other .d than it was written.. A spelling error in a translation and my mod has a bug!

Link to comment

erm... well, the only two ways I can think of approaching this would to be

a. CHAIN/EXTERN every single state into a separate .d, and .tra it...

b. set up two .tras to run on 1 .d, like setup.tra and myMod.tra do for .tp2. I will go read some more. Perhaps I am missing something.

 

I know you can use sepate sets of numbers, but as far as I can tell you can't apply multiple .tra files to one .d *other* than the default setup.tra and then a secondary myMod.tra. This one you might check with the bigg - WeiDU picks a tra in a specific order. Perhaps you can use the same idea that the lanhguage specifications use, and grab a way of making more than one .tra be applied to one .d that way.

 

USING allows specification of a .tra with a different filename, but

 

COMPILE ~myMod.d~

USING ~myMod.tra~ //entries 1 - 4000

USING ~myModJournalEntries.tra~ // entries 5000 - 10000

 

I don't think works. At least, from the docs and from my accidentally putting two USING lines on a .tra. But you could test it...

Link to comment

It's just that I saw a mod (and I can't recall which or where) that had a separate journal.tra, so I wondered. It would be a nice feature, though: no repitition of the journal entry lines in different tras with the risk of spelling errors.

Link to comment

Well, it really might be possible by just renumbering. From the command line (taken from the WeiDU docs)

You may specify multiple translation files. The last one to define a string wins. This is useful if one language is more up to date than the others. In this example:

 

C:\Program Files\Black Isle\BGII - SoA\> WeiDU SCSARLES.D english.tra italian.tra

from within tp2,

LOAD_TRA traName list Loads all traName files (variable substitution is done, the file cannot be inlined) to be used in the following tp2 actions, as if you had declared them in LANGUAGE.

 

With the fall through being last to first, it looks like; there might be big problems with untraification and retraification if you left them all in the same .d, though.

 

So it looks like

 

LOAD_TRA might mean it is possible.

Link to comment

OK. I am attaching a successful quick install (without WeiDU) with results, and it looks good.

 

Using "USING" with "AUTO_TRA" looks like you can get a second .tra associated with no problems, and the missing numbered references will "fall through" to the expected .tra. From the log:

Install Component [JasteyJournal: Install Test of Multiple tras for one d]?
[I]nstall, or [N]ot Install or [Q]uit? 
Installing [JasteyJournal: Install Test of Multiple tras for one d]
Compiling 1 dialogue file ...
[JasteyJournal/TRA/english/JOURNAL.tra] has 3 translation strings
[JasteyJournal/TRA/english/STANDARD.TRA] has 7 translation strings
[./override/TRIGGER.IDS] loaded, 7725 bytes
[./override/ACTION.IDS] loaded, 13074 bytes
Processing 1 dialogues/scripts ...
Adding JASTEY to internal list of available DLGs
[JASTEY.DLG] saved	4 states, 6 trans, 1 strig, 0 ttrig, 3 actions

 

Using WeiDU 201, without adding the USING, of course, WeiDU stops installation. Adding the USING, like this,

 

file: setup-jasteyjournal.tp2

BACKUP ~JasteyJournal\backup~
AUTHOR ~No One~

MODDER

/* Language Settings */
AUTO_TRA ~JasteyJournal/TRA/%s~
LANGUAGE ~English~ ~english~ ~JasteyJournal/TRA/english/setup.tra~

BEGIN @0

COMPILE ~JasteyJournal/STANDARD.D~
 USING ~JasteyJournal/TRA/english/JOURNAL.tra~

 

 

file: STANDARD.D

BEGIN ~JASTEY~

CHAIN IF ~NumTimesTalkedTo(0)~ THEN ~JASTEY~ JasteyBeginTest
@0
END
++ @1 EXTERN ~JASTEY~ JasteyCodeOne
++ @2 EXTERN ~JASTEY~ JasteyCodeTwo
++ @3 EXTERN ~JASTEY~ JasteyCodeThree


APPEND ~JASTEY~

IF ~~ JasteyCodeOne
SAY @4
IF ~~ THEN DO ~SetGlobal("C-Path","GLOBAL",1)~ JOURNAL @801 EXIT
END

IF ~~ JasteyCodeTwo
SAY @5
IF ~~ THEN DO ~SetGlobal("C-Path","GLOBAL",2)~ JOURNAL @802 EXIT
END

IF ~~ JasteyCodeThree
SAY @6
IF ~~ THEN DO ~SetGlobal("C-Path","GLOBAL",3)~ JOURNAL @803 EXIT
END

END

 

file: setup.tra

@0 =  ~JasteyJournal: Install Test of Multiple tras for one d~

 

file: standard.tra

@0  = ~Test out the multiple .tra on 1 d idea.~
@1  = ~And then perhaps an extern to another .d~
@2  = ~Assassin! You have been sent to kill me through code!~
@3  = ~Perhaps I may delay awhile... in the meantime, perhaps I can entertain you. My singing leaves much to be desired, but my code is truly pathetic...~
@4  = ~OK. But I already know how to do that. ~
@5  = ~Yep.Death By Code.~
@6  = ~Leave off the singing, bring on the code.~

 

file: journal.tra

@801  = ~Test out the multiple .tra on 1 d idea.

This journal entry is one of three.~
@802  = ~Test out the multiple .tra on 1 d idea.

This journal entry is two of three.~
@803  = ~Test out the multiple .tra on 1 d idea.

This journal entry is three of three.~

 

 

A test of the resulting file in NI shows everything set up perfectly.

 

I am not sure about precedence of files if you are using both EVALUATE_BUFFER and USING, but it looks like you could do the whole set of Journal entries you wanted as a separate tra and separate number set, and successfully combine them. It may be that LOAD_TRA is even more powerful, but I am out of time, and I bet that other folks will come up with additional ideas.

 

Caveats - if you want to traify/untraify, this would be a mess... each journal entry would need to be manually clipped, I believe. (By the way, thinking back, I am not sure I understood what the original problem is. If you are adding the same journal entry multiple times, just assign them the same number, and clip out the spurious ones, and you will be ok, right? plus preserve the ability to traify/untraify back and forth between hardcoded and traified ds?)

 

JasteyJournal.rar

Link to comment

Thank you for your effort, cmorgan!

 

I am not sure I understood what the original problem is. If you are adding the same journal entry multiple times, just assign them the same number, and clip out the spurious ones, and you will be ok, right? plus preserve the ability to traify/untraify back and forth between hardcoded and traified ds?)

 

The reason I am asking is, if I have three .d files, with three separate tras, and all refer to the same journal entry (say in one it gets set as unsolved journal entry, and in the other two, the entry should be removed via EraseJournalEntry().) I would need the journal entry in every tra, with exact the same spelling. Meaning if a translator isn't aware of this, the EraseJournalEntry() will not work because the journal entry in tra 1 is slightly different than in tra 2.

 

The obvious solution is merging the .ds, of course, but sometimes for order reason and for length I prefer having several.

Link to comment

Oh - well, then, yes - this is a good way around that :(

 

You could also add everything into a "universal.tra" though, anyways, and running all of the .ds from one .tra, like the big mods do. The reverse side of the coin, so to speak.

 

myModDialogue1.d

USING universal.tra

myModDialogue2.d

USING universal.tra

 

and that would mean that you only have one .tra file to work with. But I understand the problem all too well. I originally wanted to put BG1NPC into one huge .d and one huge related .tra, combining as much as possible into as few files as possible. Luckily, everyone said "you are crazy - leave well enough alone, and let us be able to troubleshoot small files individually!!!"

Link to comment

Archived

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

×
×
  • Create New...