collapse

Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Any way to access the VDialog vgui?  (Read 8556 times)

Offline ColonelAlias

  • Methuselah
  • ****
  • Posts: 327
  • Reputation: +368/-1
Re: Any way to access the VDialog vgui?
« Reply #30 on: February 22, 2011, 01:37:18 am »
Huh... dead is a metaphor here. It just means that it looks as if the NPC line (#) is unreachable if you start the dialogs in the engine (if my specification is correct). As in, no other line jumps to it. Probably should have written "unreachable NPC dialog" instead.
EDIT: In fact, here is a version with that wording changed:
http://www.mediafire.com/?66evk5t4yr2dcnx

It's the same, only changed wording there and on the read me.


Also you should notice that those semantic warnings only are shown AFTER you fix all syntactic warnings.

The source code is inside the jar if you open it with winrar or another extractor.
Don't look at the java files. Look at the grammar file (.g) (there are 2 but only one is important for that program - VampireDialog.g - the other is the incomplete as of yet dialog replacer.
It's a little strange to compile because it uses antlr to generate the parser, and of course, the generated code is somewhat unreadable (why you should read the g files).
The instructions to compile the grammar are on the readme.


Wesp, what do you think of the tool?
« Last Edit: February 22, 2011, 02:16:53 am by ColonelAlias »

Offline burgermeister01

  • Administratrix
  • Antediluvian
  • *****
  • Posts: 544
  • Reputation: +349/-1
Re: Any way to access the VDialog vgui?
« Reply #31 on: February 22, 2011, 03:52:57 am »
Okay, I was looking for .java files for the source code, but I looked at the g files now.

Man, you use some crazy syntax! I have never seen some of this syntax used in Java before. Do you program professionally?

Anyways, one thing I wanted to add was about the '#' symbol. I don't think it will make a line unreachable, it just stops the engine from processing the file any further. So, like, if you put it after a NPC line, it won't jump to the next line. If it's a PC line, then it will stop adding responses to the player's list of dialog options. A line is never unreachable though; you can always make a start condition point to any line.

Offline ColonelAlias

  • Methuselah
  • ****
  • Posts: 327
  • Reputation: +368/-1
Re: Any way to access the VDialog vgui?
« Reply #32 on: February 22, 2011, 04:19:53 am »
The crazy syntax is because parts of that file is not java at all. Remember, antlr is a parser generator that to boot, targets different languages. So it has it's own language to define grammars in, and optionally, you can embbed code directly from your target language in parts of the grammar parser. Very neat, but i mostly put code the "traditional" way.

About "#" : mmmm? I am writing about this kind of lines:
{1}{Hey there!}{Hey there!}{#}{npc.SetDisposition("Joy",1){}{}{}{}{}{}{}{}

And i call them "NPC lines" because all examples of them i've seen were for NPCs. The # character is supposed to mean "don't prompt the user for input, just go to the next line, correct?

So a "unreachable NPC line" is a line that has a # on the 4th {} but it's ID (1 in this case) is never the target of another previously processed dialog, OR a previous NPC line directly above this one (i also checked for autolink and starting condition because those also don't prompt the user for input).

As i discuss on the readme, i'm sure there are may be some false positives on the list even if this algorithm is completely correct.
But i don't think they will be many: The condition field on NPC dialogs never hides NPC dialogs right?
« Last Edit: February 22, 2011, 04:22:02 am by ColonelAlias »

Offline ColonelAlias

  • Methuselah
  • ****
  • Posts: 327
  • Reputation: +368/-1
Re: Any way to access the VDialog vgui?
« Reply #33 on: February 22, 2011, 04:45:44 am »
To be more specific: I wrote that validator thinking that:
1) the engine reads the conditions at the bottom for every START CONDITION. (i'm not depending on this for the validation)

2) The first that succeeds it jumps to the line indicated in the target (i'm not depending on this for the validation)

3) if there is no valid start condition it goes to line 1 (i missed this condition, need to make a new version)

4) If the target line doesn't have a # the engine collects it for a response depending on the condition (since i'm only checking for not reachable NPC lines because the conditionals on the PC lines would make it meaningless, i don't care about this). This spots when the engine finds a # line (but it doesn't display it or do anything at all with it, just waits for input from the player for the collected lines that display).

5) if the target is a NPC line the pc talks. And here i am assuming that the conditionals on a NPC line have no effect.

Is this correct?

6) Anyway, the NPC will say all of the lines  that follow in descending order visually and ascending order numerically (their number increases).
Since these lines never jump out to another part of the dialog.

7) What my algorithm is doing is to find all not-a-NPC-lines and iterating over them. It follows it's target. If the target is a NPC line, it removes them, and any NPC line that directly follows it (since NPC lines never jump out) from the "unreachable" set.

At the end, i have a (flawed, because it's missing a jump to 1 that happens if there is no valid Starting condition) set of unreachable NPC statements.
« Last Edit: February 22, 2011, 05:18:46 am by ColonelAlias »

Offline ColonelAlias

  • Methuselah
  • ****
  • Posts: 327
  • Reputation: +368/-1
Re: Any way to access the VDialog vgui?
« Reply #34 on: February 22, 2011, 05:15:24 am »
Ok fixed that go to 1 issue, and in doing so exposed a issue

A null pointer exception if you care  :suicide:
fixed too

 Here it is:
http://www.mediafire.com/?j1r2q2ou3b24xdx
« Last Edit: February 22, 2011, 05:17:06 am by ColonelAlias »

Offline burgermeister01

  • Administratrix
  • Antediluvian
  • *****
  • Posts: 544
  • Reputation: +349/-1
Re: Any way to access the VDialog vgui?
« Reply #35 on: February 22, 2011, 06:02:13 am »
Ah, okay. Your 'crazy' Java code was making me doubt MY abilities as a Java programmer, lol, so I'm glad it's definitely not what I thought it was.

So couple things....


1) If I am reading your analysis correctly (seems I misread what you write a lot), then I would say that you analysis is correct up to point 4. If a starting condition pointed to a line which was not a NPC dialog line, I think it would actually continue to parse the file until it found the next NPC line. Other than that, I think you got it right.

2) Honestly, if I were you, I would consider making a blank dialog file and experimenting with these edge case scenarios so you know exactly what the 'expected results' are.

3) Also, it seems you're  uploading this ZIP over and over again to mediafire. I haven't used it myself before, but have you considered trying git for a source repository. That way, you can just update the code once, keep track of your versions, and if you want allow other people to help with your code.

4) This is just a thought, but if I were trying this, I probably would have just written my own parser and taken a different approach. If you want to find all the PC lines, couldn't you just parse each line, and find all the lines which are not:

- Blank (none of the brackets besides the first column have any text)
- Start Conditions ( contains Starting Conditon)
- Auto Links (contains AUTO-LINK)
- Auto Ends (contains Auto-END)
- and finally the tricky one, is not a NPC line (doesn't contain a numeric link to a next line in the 4th brackets).

If you needed to group them somehow, you could even do that. As you parse each line, if it evaluates as a PC line its added to a collection, until the parser finds a line which is either:

- a start condition
- an auto link/end
- a npc line (contains no link to another line of dialog) or..
- contains a '#'

I think this conversation got too technical for Wesp so he tapped out, hence the lack of feedback about the parser. Or he's been sleeping. It's been the twilight hours in Deutschland since you made these huge leaps.

Offline Wesp5

  • Administratrix
  • Antediluvian
  • *****
  • Posts: 6823
  • Reputation: +892/-28
  • Unofficial Patcher
Re: Any way to access the VDialog vgui?
« Reply #36 on: February 22, 2011, 09:13:15 am »
I think this conversation got too technical for Wesp so he tapped out, hence the lack of feedback

Exactly ;)! Also the guy who makes the German translation has already programmed a similar tool and always informs me e.g. when a bracket is missing in the dialogue files that are actually used. I've decided against fixing the unused dlg files for now and there are a lot of unreachable lines in some others that your tool will trigger, but which were only added as failsaves to several characters and are never used, unless I liked a particular more creative one and restored it :). You know all these "Yes.", "No.", "I'll send you an email." lines...
« Last Edit: February 22, 2011, 09:16:54 am by Wesp5 »

Offline ColonelAlias

  • Methuselah
  • ****
  • Posts: 327
  • Reputation: +368/-1
Re: Any way to access the VDialog vgui?
« Reply #37 on: February 22, 2011, 09:27:07 am »
IMO, it's best to have a tool at your fingertips to check things out, so you are not waiting for anyone. You can point the tool to a specific file instead of a group of files if you want to exclude some (probably should have implemented blacklisting too), or disable the unreachable NPC detector.

just run it with
java -jar BloodlinesValidator.jar "path_to_dialog_dir" true true true false

Offline ColonelAlias

  • Methuselah
  • ****
  • Posts: 327
  • Reputation: +368/-1
Re: Any way to access the VDialog vgui?
« Reply #38 on: February 22, 2011, 09:39:55 am »
1) If I am reading your analysis correctly (seems I misread what you write a lot), then I would say that you analysis is correct up to point 4. If a starting condition pointed to a line which was not a NPC dialog line, I think it would actually continue to parse the file until it found the next NPC line. Other than that, I think you got it right.

You mean those completely empty lines? I think that that requires a test.

Anyway, how would one try to disable the dialog engine in-game anyway, any ideas for that?

Offline Wesp5

  • Administratrix
  • Antediluvian
  • *****
  • Posts: 6823
  • Reputation: +892/-28
  • Unofficial Patcher
Re: Any way to access the VDialog vgui?
« Reply #39 on: February 22, 2011, 10:18:55 am »
java -jar BloodlinesValidator.jar "path_to_dialog_dir" true true true false

I don't have java on my machines. I hate that it need about four programs to keep it up to date and then clutters the installed software list with hundreds of old versions too...

Offline ColonelAlias

  • Methuselah
  • ****
  • Posts: 327
  • Reputation: +368/-1
Re: Any way to access the VDialog vgui?
« Reply #40 on: February 22, 2011, 10:41:01 am »
If someone wants to port it to python or c, it should be pretty easy. The grammar is the same, "just" the code will change. (but that is  hard to do directly for someone that doesn't know of appropriate libraries. Alternatives to treemap for instance. Myself, i hate c++ and never bothered to learn boost etc, so i wouldn't be able to).

But wesp, if i'm going to give you the code to allow mouse selection for the UP you'll need to invoke it in the installation process. Are you willing to allow that java dependency? You could just disable the option if it didnt exist of course.
« Last Edit: February 22, 2011, 11:02:45 am by ColonelAlias »

Offline Wesp5

  • Administratrix
  • Antediluvian
  • *****
  • Posts: 6823
  • Reputation: +892/-28
  • Unofficial Patcher
Re: Any way to access the VDialog vgui?
« Reply #41 on: February 22, 2011, 11:35:04 am »
But wesp, if i'm going to give you the code to allow mouse selection for the UP you'll need to invoke it in the installation process. Are you willing to allow that java dependency?

How is this supposed to work? Would I need to convert all the dialogue files before creating the installer? Please either write it in Inno Setup script or provide me with an executable!
« Last Edit: February 22, 2011, 11:39:21 am by Wesp5 »

Offline ColonelAlias

  • Methuselah
  • ****
  • Posts: 327
  • Reputation: +368/-1
Re: Any way to access the VDialog vgui?
« Reply #42 on: February 22, 2011, 12:53:35 pm »
That will inflate the executable, like a lot (16 or a little less to be exact).

I can also make a special no java dependency version of the validator for you. Attempt to anyway. BRB.

Edit: Now that i checked it out, it's more like 80 mb (no compression), so fuck it.
There is the option to make a simple exe (small) that just uses the default java version and warn if it is not installed, but that is nothing more that a wrapper to the program, so what it saves you is writing "java -jar" in a console. Are you willing to use that? If no, it can always be a standalone tool that users have to run, like the first person mode.
« Last Edit: February 22, 2011, 02:01:24 pm by ColonelAlias »

Offline ColonelAlias

  • Methuselah
  • ****
  • Posts: 327
  • Reputation: +368/-1
Re: Any way to access the VDialog vgui?
« Reply #43 on: February 22, 2011, 02:09:15 pm »

How is this supposed to work? Would I need to convert all the dialogue files before creating the installer?

No this would be bad for modders. They should have the option to run it or not, otherwise, they'll end up not editing the original/UPatch dialogs (and to tell the truth, the tool will likely clutter dialogs a lot, so reading them will be worse).

Maybe it is better to require that the tool runs apart from the UP but be included like the first person mode so that a modder doesn't accidentally edit files that were already modified by the tool.

Repeated calls of the tool will be detected and ignored ofcourse, but the readability would definitely suffer.
« Last Edit: February 22, 2011, 02:11:21 pm by ColonelAlias »

Offline Malkav

  • Antediluvian
  • *****
  • Posts: 1796
  • Reputation: +392/-13
Re: Any way to access the VDialog vgui?
« Reply #44 on: February 22, 2011, 02:28:04 pm »
Well, if this tool makes dialog editing even worse than it is, i'd certainly not want to use it. And if necessary stop upgrading Camarilla Edition to newer versions of the UP.
Co Author of Camarilla Edition Mod

 

SimplePortal 2.3.7 © 2008-2020, SimplePortal