OpenMW generates non-existing hyperlinks in the dialogue

Everything about development and the OpenMW source code.
User avatar
akortunov
Posts: 899
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation

OpenMW generates non-existing hyperlinks in the dialogue

Post by akortunov »

OpenMW generates non-existing hyperlinks, at least with Russian game files:

Image

I checked this topic entry in the TES CS, no hyperlinks:
Image

Steps to reproduce:

Code: Select all

player->placeatme "galasa uvayn" 1 128 0
journal MT_WritGalasa 10
"galasa uvayn"->forcegreeting
So a question: is this a bug, or OpenMW has a some kind of hyperlinks autogeneration?
User avatar
DestinedToDie
Posts: 1181
Joined: 29 Jun 2015, 09:08

Re: OpenMW generates non-existing hyperlinks in the dialogue

Post by DestinedToDie »

Is there a topic by that name? Because if there is, then simply the mention of the word will automatically bring about the hyperlink. Normally topics have to be restricted by all kinds of conditions so that they don't show up.
User avatar
akortunov
Posts: 899
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation

Re: OpenMW generates non-existing hyperlinks in the dialogue

Post by akortunov »

DestinedToDie wrote: 09 Oct 2017, 10:29 Is there a topic by that name?
Yes, there is.
DestinedToDie wrote: 09 Oct 2017, 10:29 Because if there is, then simply the mention of the word will automatically bring about the hyperlink.
Can we limit it by the whole-word match?
User avatar
DestinedToDie
Posts: 1181
Joined: 29 Jun 2015, 09:08

Re: OpenMW generates non-existing hyperlinks in the dialogue

Post by DestinedToDie »

You limit it with functions/variables. In the spcreenshot that you just showed, you can see that the limiter for this specific dialogue to show up is that your journal entry for quest MT_writGalasa to be equal or greater than 10. Check the other functions/variables. For example, you can limit a topic to show up on only 1 NPC and then all the other NPCs won't hyperlink it.

I think the reason you may be having problems is that whoever did the Russian translation only translated and did not handle the dialogue functions/variables correctly? This is a problem with the .esm file itself.
User avatar
akortunov
Posts: 899
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation

Re: OpenMW generates non-existing hyperlinks in the dialogue

Post by akortunov »

DestinedToDie wrote: 09 Oct 2017, 10:40 You limit it with functions/variables.
This is not what I exactly mean.
For example, if I have the "foo" topic, an engine can generate a link, if it find the whole Foo word. "Food", "Foot", "Fool", etc. should not be highlighted - these words are different from topic name.

Does the English vanilla Morrowind have topic links autogeneration?
User avatar
DestinedToDie
Posts: 1181
Joined: 29 Jun 2015, 09:08

Re: OpenMW generates non-existing hyperlinks in the dialogue

Post by DestinedToDie »

I think English version of Morrowind works the same way. It may just be that the English language has less words made of a combination of smaller words. Topics are always autogenerated, there is no manual generation where you can hyperlink a certain word inside the text field in CS.

Foo topic is not used in Morrowind, so you do not have the problem with foot/food. And even if it were, foo could easily be restricted to 1 NPC or something specific so it doesn't show up where it isn't supposed to.
User avatar
akortunov
Posts: 899
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation

Re: OpenMW generates non-existing hyperlinks in the dialogue

Post by akortunov »

DestinedToDie wrote: 09 Oct 2017, 11:17 Topics are always autogenerated, there is no manual generation where you can hyperlink a certain word inside the text field in CS.
It means that @TopicName# way to hyperlink a certain word is actually a hack for some non-English versions of Morrowind. I did not know that.
User avatar
DestinedToDie
Posts: 1181
Joined: 29 Jun 2015, 09:08

Re: OpenMW generates non-existing hyperlinks in the dialogue

Post by DestinedToDie »

Wait, that exists? Can you show me an example? I have never seen this used in English. Granted, I have not looked at all of the topics of Morrowind in CS. When I google nothing comes up either. Also, I found an in-depth explanation for how topics work, if there is still any confusion.

"In conversation, topics are available when both the player and the NPC know it. The NPC "knows" a topic when there is at least one line of dialog for this topic of which he can fulfill the conditions associated with it. The player knows a topic when it has been added to him with the "AddTopic" command, or when the topic has been mentioned to him by an NPC who knows it. The last bit is the important part.

When writing dialog, we can do it this way:

- Give an NPC a greeting "I need some meteor slime."
- Make a topic "meteor slime", filter it for this NPC, and add the response "Meteor slime tastes great when mixed with scrib jelly. I'll give you a recipe.", and add a meteor slime jelly recipe to the player's inventory.

Now when the player encounters the NPC, the NPC will say his greeting. The game *parses* this greeting and checks whether it contains any topics. It finds the topic "meteor slime" in the text. Since the NPC knows the topic "meteor slime", and the text "meteor slime" is being uttered by this NPC, the topic will automatically be added to the player's list of known topics, and the the topic will be printed in blue, be clickable, and will also appear in the list of available topics for this conversation.

This works well as long as the game can correctly determine that the text uttered by the NPC actually does contain the topic "meteor slime". It can fail when other topics exist which overlap this one - like "slime", or "some meteor slime". The exact parsing algorithm of the game is unknown, but overlaps can cause it to fail, like this:

- Let's say that a topic "some meteor slime" exists, added by some other mod.
- The game now parses our NPC's greeting and sees the topic "some meteor slime" there.
- It checks whether the NPC knows this topic, which he doesn't, so it doesn't get activated.
- The game *does not* check whether the text "some meteor slime" might also contain other topics as well.
- Therefore, the game fails to see that the dialog contains the topic "meteor slime"
- Therefore, the topic "meteor slime" never gets added to the player's list of known topics, doesn't get activated, and the player cannot click on it and cannot receive the recipe."
User avatar
akortunov
Posts: 899
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation

Re: OpenMW generates non-existing hyperlinks in the dialogue

Post by akortunov »

DestinedToDie wrote: 09 Oct 2017, 11:46 Wait, that exists? Can you show me an example?
Sure.
For, example, I have a Foo topic and this topic entry:

Code: Select all

Football is a great sport!
1. I can add a link to Foo topic:

Code: Select all

@Foo#tball is a great sport!
In this case an engine will gernerate link to Foo topic.

2. The more common case: I want to highlight the whole "football" word as link to Foo topic:

Code: Select all

@Football# is a great sport!
In this case I should add a record to the MyPlugin.top file:

Code: Select all

Football	foo
3. Now I want to highlight the whole sentense as a link to Foo topic:

Code: Select all

@Football is a great sport!#
An entry in the MyPlugin.top file:

Code: Select all

Football is a great sport!	foo
IIRC, this trick is supposed to work with disabled autogeneration. I do not know if it is supported by the OpenMW-CS.

Also a note: I am not sure about English TES CS, but a one from russian CD copy did not save hyperlinks. Some modders have to use 3d-party tools to save plugins with dialogue entries.
Post Reply