Author Topic: traify-ing question  (Read 15922 times)

Offline jastey

  • Planewalker
  • *****
  • Posts: 1324
  • Gender: Female
Re: traify-ing question
« Reply #75 on: May 25, 2014, 12:38:34 PM »
Thank you!

Offline jastey

  • Planewalker
  • *****
  • Posts: 1324
  • Gender: Female
Re: traify-ing question
« Reply #76 on: May 03, 2015, 09:35:21 AM »
Current status: v238 traify-ing chokes on %tutu_var% (used in combination with dlg or item names, for example) and also %(UN)SOLVED_JOURNAL% (used instead of (UN)SOLVED_JOURNAL, obciously).

It produces d/tra pairs for any kind of OUTER_SPRINTs used for triggers or transactions (with error messages, but they have no influence), like %ERASEJOURNALENTRY_xx%, Class(Player1,MAGE%_ALL%), ActionOverride("Ragefast",%STARTDIALOGNOSET%([PC])), %ISGABBERPLAYER1%, CreateCreature("c#lcba02",[3452.3736]%FACE_9%)

I guess there is nothing you can do to make traify not stopping for %tutu_var%? I can live with replacing the journal commands before and after traify-ing, but removing and adding the %tutu_var% has a high risk of introducing errors into the d by forgetting some instances (mass replace would be even worse. Maybe it's my way of naming my dialogue states and variables.)

Offline The Imp

  • Planewalker
  • *****
  • Posts: 280
  • Gender: Male
Re: traify-ing question
« Reply #77 on: May 06, 2015, 03:45:01 AM »
CreateCreature("c#lcba02",[3452.3736]%FACE_9%)
Errhm, is that a typo ? Of one "," ...
As there  needs to be a , before the %FACE_9% .... assuming you make it with some sort of logic that doesn't assign the comma and a value to the integer. :P So...
CreateCreature("c#lcba02",[3452.3736],%FACE_9%)

In this:
Class(Player1,MAGE%_ALL%) ... erhm, shouldn't it be either: Class(Player1,%MAGE_ALL%) or just Class(Player1,202) ... and the others might have similar things as well.
« Last Edit: May 06, 2015, 03:59:09 AM by The Imp »

Offline jastey

  • Planewalker
  • *****
  • Posts: 1324
  • Gender: Female
Re: traify-ing question
« Reply #78 on: May 06, 2015, 02:27:43 PM »
Those are OUTER_SPRINTs I defined for my BG1 mods: %FACE_9% is, indeed ",Face(9)" because the whole thing needs to be gone for vanilla BG1, and %_ALL% is "_ALL" for BGII engine but nothing for BG1, where no "MAGE_ALL" exists. Sorry for the confusion.

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1060
Re: traify-ing question
« Reply #79 on: May 06, 2015, 04:34:18 PM »
This sounds familiar, but I can't remember what it was about. I'll try to have a look sometime soon-ish.
Please provide an example of D code which can't be traified.
« Last Edit: May 06, 2015, 04:45:22 PM by Wisp »

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1060
Re: traify-ing question
« Reply #80 on: August 16, 2015, 06:23:18 AM »
Current status: v238 traify-ing chokes on %tutu_var% (used in combination with dlg or item names, for example) and also %(UN)SOLVED_JOURNAL% (used instead of (UN)SOLVED_JOURNAL, obciously).
Variables can be used in dlg references like so
Code: [Select]
EXTERN ~%tutu_var%aldeth~
Not enclosing the string in delimiters is a syntax error because it is lexed as two strings.

I'm uncertain what you mean by item names. Using variables in item names in action and trigger lists falls under the case below. If you have an example of something I've overlooked, please provide it.

I don't think there's anything I can do about %SOLVED_JOURNAL% and the like. It would require a different parser and using variables in the syntactical backbone of the D structure introduces dicey problems.

Quote
It produces d/tra pairs for any kind of OUTER_SPRINTs used for triggers or transactions (with error messages, but they have no influence), like %ERASEJOURNALENTRY_xx%, Class(Player1,MAGE%_ALL%), ActionOverride("Ragefast",%STARTDIALOGNOSET%([PC])), %ISGABBERPLAYER1%, CreateCreature("c#lcba02",[3452.3736]%FACE_9%)
As you say, using variables in trigger and action lists produces warnings, but no fatal errors. The warnings can possibly be inhibited during traification. I'll have a look.

Offline tuldor88

  • Planewalker
  • *****
  • Posts: 3
  • Gender: Male
Re: traify-ing question
« Reply #81 on: August 17, 2015, 07:02:04 AM »
Hi, I have a small suggestion.
Now if we will use automatic traification then weidu assigns to every utterance sequential number @ whether there are more same utterance or not. For example - if we have such a file:
Code: [Select]
IF ~NumTimesTalkedTo(0)~ THEN BEGIN 1
SAY ~Hi!~
++~Hi~ + 2
++~Go Away!~ EXIT
END

IF ~~ THEN BEGIN 2
SAY ~It's late, I have to go, bye bye!~
IF ~~ THEN EXIT
END
file.tra will look that:
Quote
@0 = ~Hi~
@1 = ~Hi~

@2 = ~Go Away!~
@3 = ~It's late, I have to go, bye bye!~
As you can see weidu added to the dialog.tlk two new string while one will by enough.
Of course if we have a small file as in the example we can improve it by hand ... but if the file contains ~1k@ (my biggest file have 3k@) it will be a very 'annoying'.
Will it be feasible to fix it?
(weidu 238)
« Last Edit: August 17, 2015, 07:21:23 AM by tuldor88 »

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1060
Re: traify-ing question
« Reply #82 on: August 17, 2015, 08:37:04 AM »
WeiDU already performs this optimisation. The reason you aren't seeing it in your example is that one hi has an exclamation mark and the other does not.
This untraified D
Code: [Select]
IF ~NumTimesTalkedTo(0)~ THEN BEGIN 1
SAY ~Hi!~
++~Hi~ + 2
++ ~Hi!~ + 2
++~Go Away!~ EXIT
END

IF ~~ THEN BEGIN 2
SAY ~It's late, I have to go, bye bye!~
IF ~~ THEN EXIT
END
produces this traified D
Code: [Select]
IF ~NumTimesTalkedTo(0)~ THEN BEGIN 1
SAY @0
++@1 + 2
++ @0 + 2
++@2 EXIT
END

IF ~~ THEN BEGIN 2
SAY @3
IF ~~ THEN EXIT
END
and this TRA content
Code: [Select]
@0    = ~Hi!~
@1    = ~Hi~
@2    = ~Go Away!~
@3    = ~It's late, I have to go, bye bye!~

Offline jastey

  • Planewalker
  • *****
  • Posts: 1324
  • Gender: Female
Re: traify-ing question
« Reply #83 on: August 19, 2015, 11:12:08 AM »
tuldor88: What Wisp said: If the text is 100% the same, there will be only one tra-line be produced and re-used. If you find "similar" lines after traification, have a very close look, especially concerning punctuation, because there will be differences.

Variables can be used in dlg references like so
Code: [Select]
EXTERN ~%tutu_var%aldeth~
Not enclosing the string in delimiters is a syntax error because it is lexed as two strings.
Very cool, thank you. If I traify next time, I'll look out for what I meant with "in item names". (I don't mind error messages, as long as the d/tra pair is created.)

 

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)?: