Skip to content

Weidu Help: Traify Not Working

DatBenzDatBenz Member Posts: 6
edited April 2023 in General Modding
New to Weidu and I'm a bit stuck. I cannot for the life of me get --traify to work properly. I have my .d file and use the command

weidu --traify imoen.d --out imoen-new

It does create the imoen-new.d and imoen-new.tra but it just basically copies the original .d file and the .tra is blank. What am I doing wrong?
Post edited by DatBenz on

Comments

  • jasteyjastey Member Posts: 2,671
    This is the correct syntax, it works for me.
    I don't think it is a syntax error, or weidu would give an parse error message. Maybe missing writing permissions in the folder you are in?
  • DatBenzDatBenz Member Posts: 6
    edited April 2023
    Hmmm reinstalled my entire OS and its still doing the same thing. I don't understand. I must be doing something wrong.

    I use weidu imoen.dlg to get an imoen.d file in my game directory.

    Then I use weidu --traify imoen.d --out imoen-new and it gives me a imoen-new.d still with string numbers and an imoen-new.tra that's completely blank.

    Am I using an incorrect source file? You get a .tra file with string references @1 @2 ect when you do it?
  • DatBenzDatBenz Member Posts: 6
    Ok also tried it on a completely different computer and got the same result
  • jmerryjmerry Member Posts: 3,829
    edited April 2023
    Ah, that's what's going on.
    The traify command turns literal strings into @ references.
    When you decompile imoen.dlg into a .D file, there are no literal strings there. Instead, there are # references, to existing strings in dialog.tlk.

    For example, here's an excerpt from a .D file in my own mod (part of "Noober's Game"):
    IF ~~ THEN BEGIN 309 // from: 306.0
      SAY #101573 /* ~You carefully avoid the filaments hanging from the chandelier and make your way to the safe room door. It appears to be a normal door with a simple lock below the doorknob.~ */
      IF ~~ THEN REPLY #101574 /* ~Try to pick the lock.~ */ GOTO 310
      IF ~  Global("OHBN_KEY","LOCALS",2)
    ~ THEN REPLY #101575 /* ~Place the stolen key in the lock and turn it.~ */ GOTO 313
      IF ~~ THEN REPLY @29030 /* ~Try to force the door open.~ */ GOTO 311
    END
    
    Those # references are strings that already exist in the game; I built this .D file by exporting OHBNOOB.DLG with Near Infinity and slightly modifying it. Almost all of the changes I made were simple tweaks to variables, conditions, and actions. The @ reference here is in fact the only @ reference in the entire ~170KB file.

    While I built this traified from the start, I could have used WeiDU to automate that. It would have gone from
    IF ~~ THEN REPLY ~Try to force the door open.~ GOTO 311
    
    to
    IF ~~ THEN REPLY @0 */ GOTO 311
    
    and a new (English) .tra file consisting of
    @0	= ~Try to force the door open.~
    

    The other >800 # references in the dialogue file would be untouched. They're already translated, after all - every language the game comes in has versions of those strings. You're not getting anything meaningful out of traify because the file you're testing it on has nothing that needs translation.
  • DatBenzDatBenz Member Posts: 6
    Thank you for the explanation!

    Maybe I need to go about this a different way. How can I create .tra files with sequential @ references for various characters? I will potentially need this for every character in the game so I would really rather not do this all manually lol
Sign In or Register to comment.