Author Topic: WeiDU Compiler Error  (Read 6058 times)

Offline Quitch

  • Perfection
  • Planewalker
  • *****
  • Posts: 270
  • Making the world a better place for evil
WeiDU Compiler Error
« on: September 25, 2002, 01:21:56 PM »
WeiDU compiled the following without trouble:

@602 = ~"I do hope you enjoy a challenge, [CHARNAME]."  You get the feeling her words are more important than they seem.~
  @603 = ~"C-challenge?  Oh... oh, I hope not."~
  @604 = ~"C-challenge?  Oh... oh, me hope not."~
  @605 = ~"Just so long as this isn't too rough, I should be okay."
  @606 = ~"Me handle... some stuff.  Me not handle lots, though."
  @607 = ~"I have dealt with challenges before and can handle anything similar again."~
  @608 = ~"Me no worry about challenge.  Me done that before."~
  @609 = ~"Nothing has challenged me thus far.  I am ready for this."~
  @610 = ~"Me no bat eyelid at other stuff.  Me do this easy."~
  @611 = ~"I doubt anything on the mortal plane could challenge me now."~
  @612 = ~"My blood is Bhaal blood.  Me no challenged by anything."~

Notice that both 605 and 606 are missing the tilde.  I have had it reported that @605 displays:

"Just so long as this isn't too rough, I should be okay." @606 =                    
Past: Ascension
Present: Return to Windspear
Future: Imoen Relationship
"Perfection has no deadline"

Offline weimer

  • Moderator
  • Planewalker
  • *****
  • Posts: 2222
  • Gender: Male
    • WeiDU and Weimer Mods
WeiDU Compiler Error
« Reply #1 on: September 25, 2002, 04:58:54 PM »
Thank you for reporting this behavior.

This is like complaining that a C compiler compiles this program:

Code: [Select]
int main() {
 char * a[] = { "hello", "goodbye," "this" };
}

Even though the "clear" mistake is that that comma is in the wrong place with respect to the closing quote, it compiles fine (becoming a two-element array thanks to string pasting).

In WeiDU it is valid to say:

@55 = ~Hello, lovely lady.~ ~Hello, handsome man.~

Where the first string is used for male players and the second string is used for female players. This is important for international translations. Your particular example looks like this:

@605 = ~tilde string~ "quote string"

And thus fits that form. :-(

I cannot mechanically distinguish this typo from something you might have wanted to do. At least, I cannot think of any way. If you have any suggestions, I am open to them.                    

Dyara

  • Guest
WeiDU Compiler Error
« Reply #2 on: September 26, 2002, 01:44:51 AM »
But string @606 is missing then because it´s inside string @605. Should´t WeiDU realize this somehow?                    

Offline weimer

  • Moderator
  • Planewalker
  • *****
  • Posts: 2222
  • Gender: Male
    • WeiDU and Weimer Mods
WeiDU Compiler Error
« Reply #3 on: September 26, 2002, 02:02:47 AM »
Possibly. Quitch didn't mention his D file referencing @606. In addition, I cannot reproduce that error locally.

q.tra contains:

Code: [Select]
@602 = ~"I do hope you enjoy a challenge, ." You get the feeling her words are more important than they seem.~
@603 = ~"C-challenge? Oh... oh, I hope not."~
@604 = ~"C-challenge? Oh... oh, me hope not."~
@605 = ~"Just so long as this isn't too rough, I should be okay."
@606 = ~"Me handle... some stuff. Me not handle lots, though."
@607 = ~"I have dealt with challenges before and can handle anything similar again."~
@608 = ~"Me no worry about challenge. Me done that before."~
@609 = ~"Nothing has challenged me thus far. I am ready for this."~
@610 = ~"Me no bat eyelid at other stuff. Me do this easy."~
@611 = ~"I doubt anything on the mortal plane could challenge me now."~
@612 = ~"My blood is Bhaal blood. Me no challenged by anything."~

while test.d contains:

Code: [Select]
BEGIN FOO

IF ~~ THEN BEGIN s0
  SAY @606
END

Which is a use of @606 that is never defined. When we run WeiDU we get:

Code: [Select]
tani-no-yuri:/cygdrive/c/src/weidu$ ./weidu.asm.exe q.tra test.d
[c:\src\weidu\weidu.asm.exe] WeiDU version 75
[C:\Program Files\Black Isle\BGII - SoA/chitin.key] loaded, 590551 bytes
[C:\Program Files\Black Isle\BGII - SoA/chitin.key] 182 BIFFs, 41793 resources
[C:\Program Files\Black Isle\BGII - SoA/dialog.tlk] loaded, 9649307 bytes
[C:\Program Files\Black Isle\BGII - SoA/dialog.tlk] 79991 string entries
[q.tra] parsed (10 translation strings)
[test.d] parsed
Adding FOO to internal list of available DLGs
ERROR: No translation provided for @606
ERROR: cannot resolve strings in FOO
ERROR: Cannot postprocess FOO
ERROR: problem processing D files: Not_found

ERROR: Not_found

Which looks like the correct behavior to me (given the dubious TRA parsing).                    

Dyara

  • Guest
WeiDU Compiler Error
« Reply #4 on: September 26, 2002, 04:00:53 AM »
@606 is referenced in the *.d file.

Maybe there´s a difference if the dialogue is compiled inside a big tp2 file?                    

Offline weimer

  • Moderator
  • Planewalker
  • *****
  • Posts: 2222
  • Gender: Male
    • WeiDU and Weimer Mods
WeiDU Compiler Error
« Reply #5 on: September 26, 2002, 10:21:20 AM »
I'm not sure where you two are going with this. Can you show me an actual example of some WeiDU input for which WeiDU fails to notice the missing TRA string?

Here's test.tp2:

Code: [Select]
BACKUP ~mymod/backup~
AUTHOR ~weimer@cs.berkeley.edu~
BEGIN @606

and here's q.tra:

Code: [Select]
@602 = ~"I do hope you enjoy a challenge, ." You get the feeling her words are more important than they seem.~
@603 = ~"C-challenge? Oh... oh, I hope not."~
@604 = ~"C-challenge? Oh... oh, me hope not."~
@605 = ~"Just so long as this isn't too rough, I should be okay."
@606 = ~"Me handle... some stuff. Me not handle lots, though."
@607 = ~"I have dealt with challenges before and can handle anything similar again."~
@608 = ~"Me no worry about challenge. Me done that before."~
@609 = ~"Nothing has challenged me thus far. I am ready for this."~
@610 = ~"Me no bat eyelid at other stuff. Me do this easy."~
@611 = ~"I doubt anything on the mortal plane could challenge me now."~
@612 = ~"My blood is Bhaal blood. Me no challenged by anything."~

and here's WeiDU's output:

Code: [Select]
[c:\src\weidu\weidu.asm.exe] WeiDU version 75
[C:\Program Files\Black Isle\BGII - SoA/chitin.key] loaded, 590551 bytes
[C:\Program Files\Black Isle\BGII - SoA/chitin.key] 182 BIFFs, 41793 resources
[C:\Program Files\Black Isle\BGII - SoA/dialog.tlk] loaded, 9649307 bytes
[C:\Program Files\Black Isle\BGII - SoA/dialog.tlk] 79991 string entries
[q.tra] parsed (10 translation strings)
[WeiDU.log] Sys_error("WeiDU.log: No such file or directory")
[test.tp2] parsed (for uninstall)
ERROR: No translation provided for @606
ERROR: problem parsing TP file [test.tp2]: Not_found

ERROR: Not_found

This shows that WeiDU notices the problem in a "small" TP2 file. I then repeated a variant of the experiment using Setup-Solaufein.tp2 (the biggest TP2 file I have available) by removing one of the TRA string definitions from wsetup.tra and got the same results.

I admit that the @606 = ~this~"that" parsing is unintuitive, and I'll take suggestions from the floor on that one. However, I have every reason to believe that WeiDU will notice every used-but-not-defined TRA string. In Quitch's example, @606 probably did not appear in an executed section of his D or TP2 file.                    

Offline Quitch

  • Perfection
  • Planewalker
  • *****
  • Posts: 270
  • Making the world a better place for evil
WeiDU Compiler Error
« Reply #6 on: September 26, 2002, 12:44:31 PM »
IF ~~ THEN BEGIN eAI
  SAY @354 = @602
  IF ~CheckStatGT(Player1,7,INT)~  THEN REPLY @603 DO ~SetGlobal("RtWMyDifficulty","GLOBAL",0)~ GOTO eAIDifficultySet
  IF ~!CheckStatGT(Player1,7,INT)~ THEN REPLY @604 DO ~SetGlobal("RtWMyDifficulty","GLOBAL",0)~ GOTO eAIDifficultySet
  IF ~CheckStatGT(Player1,7,INT)~  THEN REPLY @605 DO ~SetGlobal("RtWMyDifficulty","GLOBAL",1)~ GOTO eAIDifficultySet
  IF ~!CheckStatGT(Player1,7,INT)~ THEN REPLY @606 DO ~SetGlobal("RtWMyDifficulty","GLOBAL",1)~ GOTO eAIDifficultySet
  IF ~CheckStatGT(Player1,7,INT)~  THEN REPLY @607 DO ~SetGlobal("RtWMyDifficulty","GLOBAL",2)~ GOTO eAIDifficultySet
  IF ~!CheckStatGT(Player1,7,INT)~ THEN REPLY @608 DO ~SetGlobal("RtWMyDifficulty","GLOBAL",2)~ GOTO eAIDifficultySet
  IF ~CheckStatGT(Player1,7,INT)~  THEN REPLY @609 DO ~SetGlobal("RtWMyDifficulty","GLOBAL",3)~ GOTO eAIDifficultySet
  IF ~!CheckStatGT(Player1,7,INT)~ THEN REPLY @610 DO ~SetGlobal("RtWMyDifficulty","GLOBAL",3)~ GOTO eAIDifficultySet
  IF ~CheckStatGT(Player1,7,INT)~  THEN REPLY @611 DO ~SetGlobal("RtWMyDifficulty","GLOBAL",4)~ GOTO eAIDifficultySet
  IF ~!CheckStatGT(Player1,7,INT)~ THEN REPLY @612 DO ~SetGlobal("RtWMyDifficulty","GLOBAL",4)~ GOTO eAIDifficultySet
END                    
Past: Ascension
Present: Return to Windspear
Future: Imoen Relationship
"Perfection has no deadline"

Offline weimer

  • Moderator
  • Planewalker
  • *****
  • Posts: 2222
  • Gender: Male
    • WeiDU and Weimer Mods
WeiDU Compiler Error
« Reply #7 on: September 26, 2002, 01:23:45 PM »
Thank you for posting a more complicated example.

Here is q.tra:

Code: [Select]
@354 = ~string 354~
@602 = ~"I do hope you enjoy a challenge, ." You get the feeling her words are more important than they seem.~
@603 = ~"C-challenge? Oh... oh, I hope not."~
@604 = ~"C-challenge? Oh... oh, me hope not."~
@605 = ~"Just so long as this isn't too rough, I should be okay."
@606 = ~"Me handle... some stuff. Me not handle lots, though."
@607 = ~"I have dealt with challenges before and can handle anything similar again."~
@608 = ~"Me no worry about challenge. Me done that before."~
@609 = ~"Nothing has challenged me thus far. I am ready for this."~
@610 = ~"Me no bat eyelid at other stuff. Me do this easy."~
@611 = ~"I doubt anything on the mortal plane could challenge me now."~
@612 = ~"My blood is Bhaal blood. Me no challenged by anything."~

Here is test.d:

Code: [Select]
BEGIN FOO

   IF ~~ THEN BEGIN eAI
   SAY @354 = @602
   IF ~CheckStatGT(Player1,7,INT)~ THEN REPLY @603 DO
   ~SetGlobal("RtWMyDifficulty","GLOBAL",0)~ GOTO eAIDifficultySet
   IF ~!CheckStatGT(Player1,7,INT)~ THEN REPLY @604 DO
   ~SetGlobal("RtWMyDifficulty","GLOBAL",0)~ GOTO eAIDifficultySet
   IF ~CheckStatGT(Player1,7,INT)~ THEN REPLY @605 DO
   ~SetGlobal("RtWMyDifficulty","GLOBAL",1)~ GOTO eAIDifficultySet
   IF ~!CheckStatGT(Player1,7,INT)~ THEN REPLY @606 DO
   ~SetGlobal("RtWMyDifficulty","GLOBAL",1)~ GOTO eAIDifficultySet
   IF ~CheckStatGT(Player1,7,INT)~ THEN REPLY @607 DO
   ~SetGlobal("RtWMyDifficulty","GLOBAL",2)~ GOTO eAIDifficultySet
   IF ~!CheckStatGT(Player1,7,INT)~ THEN REPLY @608 DO
   ~SetGlobal("RtWMyDifficulty","GLOBAL",2)~ GOTO eAIDifficultySet
   IF ~CheckStatGT(Player1,7,INT)~ THEN REPLY @609 DO
   ~SetGlobal("RtWMyDifficulty","GLOBAL",3)~ GOTO eAIDifficultySet
   IF ~!CheckStatGT(Player1,7,INT)~ THEN REPLY @610 DO
   ~SetGlobal("RtWMyDifficulty","GLOBAL",3)~ GOTO eAIDifficultySet
   IF ~CheckStatGT(Player1,7,INT)~ THEN REPLY @611 DO
   ~SetGlobal("RtWMyDifficulty","GLOBAL",4)~ GOTO eAIDifficultySet
   IF ~!CheckStatGT(Player1,7,INT)~ THEN REPLY @612 DO
   ~SetGlobal("RtWMyDifficulty","GLOBAL",4)~ GOTO eAIDifficultySet
   END

Here is WeiDU's output:

Code: [Select]
[c:\src\weidu\weidu.asm.exe] WeiDU version 75
[C:\Program Files\Black Isle\BGII - SoA/chitin.key] loaded, 590551 bytes
[C:\Program Files\Black Isle\BGII - SoA/chitin.key] 182 BIFFs, 41793 resources
[C:\Program Files\Black Isle\BGII - SoA/dialog.tlk] loaded, 9649307 bytes
[C:\Program Files\Black Isle\BGII - SoA/dialog.tlk] 79991 string entries
[q.tra] parsed (11 translation strings)
[test.d] parsed
Adding FOO to internal list of available DLGs
ERROR: No translation provided for @606
ERROR: cannot resolve strings in FOO
ERROR: Cannot postprocess FOO
ERROR: problem processing D files: Not_found

ERROR: Not_found

This still looks right to me -- WeiDU notices that @606 is missing. Quitch, perhaps you could post (as attachments, or send to me via email) the complete D and TRA files *and* a clipboard cut-and-paste of the output that you get where WeiDU magically skips over this problem?

Oh, here's one possibility: maybe you are running this from inside a TP2 file *and* there is some other TRA file lying around that was loaded at the same time that defines a @606? The bug may be that TP2 processing is keeping some old TRA file around (which defines @606) when it should be dropping it, which masks the "missing @606" error. If so, I'd need to see your TP2 file and all of the TRA files to debug it properly.

I'm sorry that this is taking so long to nail down, but until I can reproduce it locally I can't really see the problem so I can't see how to fix it.

                   

Dyara

  • Guest
WeiDU Compiler Error
« Reply #8 on: September 26, 2002, 04:06:20 PM »
Yes, WeiDU uses an old string @606 from another *.tra file instead.                    



[!--EDIT|Dyara|Sep 27 2002, 01:09 AM--]

Offline weimer

  • Moderator
  • Planewalker
  • *****
  • Posts: 2222
  • Gender: Male
    • WeiDU and Weimer Mods
WeiDU Compiler Error
« Reply #9 on: September 26, 2002, 04:16:57 PM »
OK.

If you think this is an error, I can try to fix it.

Note that if you have something like:

Code: [Select]
LANGUAGE ~american~ ~yada~ ~american.tra~
AUTO_TRA ~mymod/%s~

COMPILE ~this.d~
 USING ~a.tra~
            ~b.tra~

Then american.tra, mymod/american/this.tra, a.tra and b.tra are all valid, so if any of them supply @606 WeiDU is doing what I expected.

However, you might make a case that american.tra should not be included in that list.

Let me know what the problem is, I'd love to help you guys out.                    

Offline Ghreyfain

  • PPG
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
WeiDU Compiler Error
« Reply #10 on: September 26, 2002, 08:43:54 PM »
Why not just close @605 and @606 with another tilde?  Or do you want an actual error message to be displayed by WeiDU when you forget to close it?                    
Earn Money Sleeping.

Dyara

  • Guest
WeiDU Compiler Error
« Reply #11 on: September 27, 2002, 02:23:51 AM »
@weimer:

No, it´s like

Code: [Select]
AUTO_TRA ~RtW/TRA/%s~

LANGUAGE ~English (International)~
         ~english (international)~
         ~RtW/TRA/english (international)/setup.tra~

/* a lot of other stuff */

COMPILE

/* some dialogues  */

// Dasypus (big dialogue with @606 defined)

~RtW/D/RTWDasyp.d~

/* some more dialogues */

// Jarata (another big dialogue without @606 in the tra file but it´s in the d file)

~RtW/D/RTWJar01.d~

/* some more dialogues */

...


Since the error is in the tra file I would´t call it an error in WeiDU but perhaps a 'nice-to-have' feature :).

@Ghreyfain: Of course there´s no problem to close @605 and @606 with another tilde. The problem is that maybe there are many more missing tildes.  After putting text in a tra-file I realized that I had forgotten nearly 30% of the closing tildes :D. It wasn´t a problem because I compiled that dialogue separately, but if you only make small changes to an existing tra file you probably won´t do this. So yes, it´s the error message.                    

Offline weimer

  • Moderator
  • Planewalker
  • *****
  • Posts: 2222
  • Gender: Male
    • WeiDU and Weimer Mods
WeiDU Compiler Error
« Reply #12 on: September 27, 2002, 02:30:43 AM »
The best thing I can think of is to have TRA files warn you if any tra-string has @[0-9] inside it. Would that work?                    

Dyara

  • Guest
WeiDU Compiler Error
« Reply #13 on: September 27, 2002, 02:35:56 AM »
Yes, it would help to find the error with @605/@606 and missing tildes.
But no, it wouldn´t find missing strings in a tra file, I guess.

Are there any reasons that WeiDU keeps old tra files in memory when it compiles another dialogue?                    

Offline weimer

  • Moderator
  • Planewalker
  • *****
  • Posts: 2222
  • Gender: Male
    • WeiDU and Weimer Mods
WeiDU Compiler Error
« Reply #14 on: September 27, 2002, 04:05:09 PM »
Yes, that's a specific feature to ease foreign language translations. In general, the non-English translations lag a few strings behind the English default. So you just apply the English TRA and then the Foreign one on top of it. All of the translated strings go through correctly, and all of the ones that were not translated default back to the English. There are other benefits, but that's the main one.                    

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
WeiDU Compiler Error
« Reply #15 on: September 27, 2002, 07:10:42 PM »
I'll just pipe up here and say that it's a syntax error and the fewer things we are prevented from doing inside a SAY string (because WeiDU filters it out or thinks it's an error), the better.
                   
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Dyara

  • Guest
WeiDU Compiler Error
« Reply #16 on: September 28, 2002, 12:52:43 AM »
@weimer: Okay, but why does WeiDU take strings from RtWDasyp.tra when it compiles RtWJar01.tra. It seems to me that we are talking from different things ;). It´s not a problem with an English tra file and a non-English tra file :).                    

Offline weimer

  • Moderator
  • Planewalker
  • *****
  • Posts: 2222
  • Gender: Male
    • WeiDU and Weimer Mods
WeiDU Compiler Error
« Reply #17 on: September 28, 2002, 05:22:43 PM »
Because you put them in the same COMPILE block. If there is a great hue and cry I could try to change it so that AUTO_TRA tra files are only associated with exactly the DLG file they match names with, but currently that is not the semantics. I fear that if I change it at this point, someone's mod will suddenly stop installing correctly when the upgrade to a new WeiDU.                    

Dyara

  • Guest
WeiDU Compiler Error
« Reply #18 on: September 29, 2002, 03:14:46 AM »
Ah, I see. So the reason is that there´s only one compile statement for all the dialogues?

Are there any disadvantages using a separate 'compile' for each *.d file?                    

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
WeiDU Compiler Error
« Reply #19 on: September 29, 2002, 01:05:06 PM »
When you compile multiple .ds in a single COMPILE statement, you can reference labels between them. WeiDU Ascension makes a lot of use of this because it was the easiest and fastest way to break that mod out of the old hard-coded format. I don't know how Quitch has decided to write the .d's for RtW but it's somewhat less necessary to do so starting with a fresh WeiDU development, since a single .d file can define any number of new DLGs and execute APPEND/EXTEND/etc actions.

                   
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Dyara

  • Guest
WeiDU Compiler Error
« Reply #20 on: September 29, 2002, 11:52:06 PM »
Thanks :)                    

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
WeiDU Compiler Error
« Reply #21 on: September 30, 2002, 09:30:54 AM »
For a from-scratch development, one of the more interesting uses of simultaneous compile is to allow mod NPCs to interject into new content. The Imoen Romance guy uses TP2 ACTION_IF to detect if Tashia is installed, and if she is, the COMPILE statement contains an extra .d with Tashia interjections that point out to labels in the core .d files.

This is an interesting idea but unfortunately I have yet to think of a good way to attack the problem of multiple NPCs without getting into geometric growth. (since with 2 NPCs, you need 4 different combinations of COMPILE lines, and it goes from there in a rather ugly fashion...)                    
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline weimer

  • Moderator
  • Planewalker
  • *****
  • Posts: 2222
  • Gender: Male
    • WeiDU and Weimer Mods
WeiDU Compiler Error
« Reply #22 on: September 30, 2002, 12:50:06 PM »
My traditional method is "ALLOW_MISSING". I'm assuming this tashia-banter.d file say something like this:

EXTEND_BOTTOM IMOEN possible_banter
 IF ~InParty("Tashia")~ THEN REPLY @100 EXTERN TASHIA banter
END

APPEND TASHIA
IF ~~ THEN BEGIN banter
 SAY @1000
 IF ~~ THEN EXIT
END

Then saying "ALLOW_MISSING TASHIA.DLG" will do what you want, and you can always compile that D file. A one-state TASHIA.DLG file will be created with that banter if tashia is not installed, but in that case she'll never be in the party, so it will all work out.

                   

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: