Quantcast
VGInterface.com
Search Downloads


Go Back   LoTROInterface > LotRO Stand-Alone Plugins > Other


Post A Reply
Author Comments Comment Options
Unread 12-25-2017, 02:40 AM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 243
File comments: 724
Uploads: 19
Quote:
Originally Posted by Interitus
2) Dashes have to be replaced with %p
3) Parenthesis have to be replaced with %p
Generally, you want to be as specific with patterns as possible to avoid false matches. Wildcards are generally best reserved for portions of a string that are either subject to change or unknown ahead of time. To that end, the percent character, %, is often used to escape any known special characters in patterns (the '-', '(' and ')' all have special purposes in Lua patterns). While you could specify \n for the line feed, one space character is not likely to cause a false positive so the generic 'space' pattern can be used there. So, a precise pattern would be:
Completed:\nWolf%-slayer %(Advanced%)
or for a close approximation:
Completed:%sWolf%-slayer %(Advanced%)
In the case of something as non-critical as a story for Anthology pretty much any pattern that matches is good enough since any false matches won't break anything critical (a story will just advance prematurely). But it's still good to know how to make a more precise pattern for those cases where distinctions matter.

An example of when you might want to use a wild card would be an objective that simply requires the user to defeat any opponent. Since we don't care about the exact opponent, we would substitute '.*' for the portion of the pattern that matches the opponent. Punctuation wildcards like %p are a little harder to justify, but I'm sure there is some example out there where we wouldn't know the specific punctuation in use but would still want to match the message.

Glad to see you are still experimenting. I hope you continue to enjoy Anthology and I look forward to seeing what you come up with for stories.

Last edited by Garan : 12-25-2017 at 02:50 AM.
Garan is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 12-24-2017, 11:15 PM  
Interitus
The Indomitable

Forum posts: 11
File comments: 13
Uploads: 0
So far these are the things I've picked up on regarding receive chat.
1) There's a space character (%s) after "Completed:"
2) Dashes have to be replaced with %p
3) Parenthesis have to be replaced with %p

For example for this in quest chat:
Completed:
Wolf-slayer (Advanced)

A messages that would work could be any of the following:
Completed:%sWolf%pslayer %pAdvanced%p
Completed:.Wolf.slayer .Advanced.
Completed:.*Wolf.*slayer.*Advanced.*
Interitus is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 12-24-2017, 02:21 PM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 243
File comments: 724
Uploads: 19
Note, for those that have already installed the Tutorial story from a prior Beta, you can use the Story Selection dialog to delete the existing tutorial and then use the Import/Export dialog to re-import the new tutorial with the DE and FR translations.

Alternately, if you have no saved stories of your own, you can simply delete all .plugindata files that start with "Anthology" from the "Documents\The Lord of the Rings Online\PluginData\username\AllServers" folder and you will have a clean start that will offer to install the tutorial for you when you run it. Just be sure that Anthology is not running when you delete the files.

The new "Preferred Language" setting will default to the language that your client is running when you first load version 0.4. You can always change that in the Settings window.

Last edited by Garan : 12-24-2017 at 02:28 PM.
Garan is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 12-20-2017, 11:49 AM  
Interitus
The Indomitable

Forum posts: 11
File comments: 13
Uploads: 0
Now that I can easily test multiple versions of an objective at once, I figured out that it's some sort of "space character" that is part of the message for completed quests (and causes "Completed:" to be on a different line than the quest name).

e.g.
Works:
Completed:%sQuest Name

Doesn't work: (an extra space after %s or one/multiple spaces)
Completed:%s Quest Name
Completed: Quest Name
Completed: Quest Name
Completed: Quest Name

Last edited by Interitus : 12-20-2017 at 11:50 AM.
Interitus is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 12-19-2017, 10:42 PM  
Interitus
The Indomitable

Forum posts: 11
File comments: 13
Uploads: 0
Quote:
Both of the objectives should then complete on the first occurrence of the message even if the match strings are not identical, as long as they match the message. Let me know if that makes the results consistent.

As to having two results that you intentionally want to be sequential, you would have to break the chapter into two chapters with the second objective in the second chapter. I am considering adding a "depends on" entry to each objective where the author can select another existing objective from the same chapter but that would be a potential feature for a future release. That would help handle situations like "find person X and then perform action Y" or in your case, "drink the first draught and then drink the second draught".
I made the change, and they both completed at the same time, so yeah, that was the issue. I'm working on putting a LP grind guide into Anthology (it's easy, and I suspect people will like it). When ver 0.4 comes out I'll run through it again and see if there's another way I can separate those two things, but it's not really something I NEED to do at all.

Last edited by Interitus : 12-19-2017 at 10:59 PM.
Interitus is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 12-19-2017, 10:52 AM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 243
File comments: 724
Uploads: 19
Quote:
Originally Posted by Interitus
I discovered something neat. If the chat "message" is exactly the same for two objectives in the same chapter they'll complete at the same time. However, if they're even one letter off, then it will complete the first in the list first, and the second in the list second (if they are both triggered by the same chat message).

For example in "Cleansing the Ruins", the quest chat says "Draught used" for each of 2 draughts you need to use for the quest. If one objective has a "message" of "Draught used" and the other is "Draught" it will complete them one at a time.
I think you stumbled on the effect of a logic flaw that is already addressed in ver 0.4. The sequential completion is actually an undesired result caused by removing completed objectives from the event handler look-up table (ver. 0.4 removes the look-up entries but does it correctly).
To verify that this is what you found, just comment out line 1830 in Reader.lua. Add two dashes to the start of the line to comment it.
Code:
				table.remove(readerWindow.ObjectiveMessages,k)
becomes
Code:
--				table.remove(readerWindow.ObjectiveMessages,k)
I removed some tabs at the start of the lines to make them more easily readable on the forum but it should suffice to show which line to comment out. Leaving the entries just makes the look-up a tiny bit less efficient (generally unnoticeable). Both of the objectives should then complete on the first occurrence of the message even if the match strings are not identical, as long as they match the message. Let me know if that makes the results consistent.

As to having two results that you intentionally want to be sequential, you would have to break the chapter into two chapters with the second objective in the second chapter. I am considering adding a "depends on" entry to each objective where the author can select another existing objective from the same chapter but that would be a potential feature for a future release. That would help handle situations like "find person X and then perform action Y" or in your case, "drink the first draught and then drink the second draught".

Last edited by Garan : 12-19-2017 at 10:54 AM.
Garan is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 12-19-2017, 02:06 AM  
Interitus
The Indomitable

Forum posts: 11
File comments: 13
Uploads: 0
I discovered something neat. If the chat "message" is exactly the same for two objectives in the same chapter they'll complete at the same time. However, if they're even one letter off, then it will complete the first in the list first, and the second in the list second (if they are both triggered by the same chat message).

For example in "Cleansing the Ruins", the quest chat says "Draught used" for each of 2 draughts you need to use for the quest. If one objective has a "message" of "Draught used" and the other is "Draught" it will complete them one at a time.
Interitus is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 12-17-2017, 02:25 PM  
Interitus
The Indomitable

Forum posts: 11
File comments: 13
Uploads: 0
I experimented a little more, and omitting the last letter in any message works, so you're right it's not the "s".

Putting in this doesn't work:
New Quest: Mathom Society Task: Squishy Goo

Putting in this does:
New Quest: Mathom Society Task: Squishy Go
Interitus is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 12-17-2017, 02:08 PM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 243
File comments: 724
Uploads: 19
Quote:
Originally Posted by Thutallor
Quote:
Originally Posted by Garan
I suspect the problem isn't the "s" but rather that the message doesn't have the trailing new line character so stripping the last character is causing it to fail. I can double check before changing it, but I should be checking the last character before trimming it which will likely fix that one odd problem.
I remember one of the cool things about Perl was that it had numerous built-in features optimized for text processing. One of them was a function, chop(), whose only purpose was to truncate the last letter from a string. Of course people quickly realized that you often only want to truncate that character if it's a newline. So in the true spirit of Perl -- the more features the better -- they added another function, chomp() to do just that. In Lua, the functional (but less efficient) equivalent is gsub(str, "\n$", "").
Neat bit of trivia. After looking at it for a minute I realized that when I changed the comparison to a string.match I should have simply eliminated the truncation. The extra character was no longer relevant as long as the pattern is found within the string so the simplest solution (in this case) is to leave the string alone. But I do love trivia, especially when it has a story or purpose attached.
Garan is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 12-17-2017, 01:01 PM  
Thurallor
The Undying
 
Thurallor's Avatar
Interface Author - Click to view interfaces

Forum posts: 136
File comments: 181
Uploads: 12
Quote:
Originally Posted by Garan
I suspect the problem isn't the "s" but rather that the message doesn't have the trailing new line character so stripping the last character is causing it to fail. I can double check before changing it, but I should be checking the last character before trimming it which will likely fix that one odd problem.
I remember one of the cool things about Perl was that it had numerous built-in features optimized for text processing. One of them was a function, chop(), whose only purpose was to truncate the last letter from a string. Of course people quickly realized that you often only want to truncate that character if it's a newline. So in the true spirit of Perl -- the more features the better -- they added another function, chomp() to do just that. In Lua, the functional (but less efficient) equivalent is gsub(str, "\n$", "").
Thurallor is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 12-17-2017, 12:28 PM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 243
File comments: 724
Uploads: 19
Quote:
Originally Posted by Interitus
You are not going to believe this.

This worked:
Completed:.*Thorin's Hall Task: Broken Daggers

This did not:
Completed: Thorin's Hall Task: Broken Daggers

So I think you nailed that part, and it was a carriage return or something (quest completion is harder to test over and over, so I didn't try to figure it out once I had your solution).

The part that might surprise you is the other part. It appears to be the "s" at the end for the new quests that is causing the problem.

This worked:
New Quest: Thorin's Hall Task: Broken Dagger

This did not:
New Quest: Thorin's Hall Task: Broken Daggers

The one that does not work is copied and pasted from the chat box, and is the same thing Alerter shows. The one that worked is exactly the same, except I deleted the "s".

I have no idea why, and I only stumbled on the solution by accident, but it appears to be the "s" at the end for New Quests. An "s" at the end of a Completed Quest seems to be fine though.

I can only imagine this is one of many LOTRO oddities you've seen.
I suspect the problem isn't the "s" but rather that the message doesn't have the trailing new line character so stripping the last character is causing it to fail. I can double check before changing it, but I should be checking the last character before trimming it which will likely fix that one odd problem.
Garan is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 12-17-2017, 10:03 AM  
Interitus
The Indomitable

Forum posts: 11
File comments: 13
Uploads: 0
You are not going to believe this.

This worked:
Completed:.*Thorin's Hall Task: Broken Daggers

This did not:
Completed: Thorin's Hall Task: Broken Daggers

So I think you nailed that part, and it was a carriage return or something (quest completion is harder to test over and over, so I didn't try to figure it out once I had your solution).

The part that might surprise you is the other part. It appears to be the "s" at the end for the new quests that is causing the problem.

This worked:
New Quest: Thorin's Hall Task: Broken Dagger

This did not:
New Quest: Thorin's Hall Task: Broken Daggers

The one that does not work is copied and pasted from the chat box, and is the same thing Alerter shows. The one that worked is exactly the same, except I deleted the "s".

I have no idea why, and I only stumbled on the solution by accident, but it appears to be the "s" at the end for New Quests. An "s" at the end of a Completed Quest seems to be fine though.

I can only imagine this is one of many LOTRO oddities you've seen.
Interitus is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 12-17-2017, 06:43 AM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 243
File comments: 724
Uploads: 19
Quote:
Originally Posted by Interitus
I noticed something odd about RECEIVE CHAT, when you use the QUEST chat channel.

New quests and completed quests seem to show up in the quest chat channel differently.

For example:

New Quest: Thorin's Hall Task: Broken Daggers

Completed:
Thorin's Hall Task: Broken Daggers

"New Quest:" is always on the same line, and "Completed:" is always on a different line from the quest name.

What seems to happen is if I'm trying to pick up the new quest above, I need to put "Thorin's Hall Task", or "New Quest: Thorin's Hall Task" as the message

"Broken Dagger" doesn't work, nor does "Thorin's Hall Task: Broken Dagger", or "New Quest: Thorin's Hall Task: Broken Dagger").

However, it I'm trying to pick up the quest being turned in, then I believe "Thorin's Hall Task", "Thorin's Hall Task: Broken Daggers", or "Broken Daggers" will work.

It seems like if it hits a second colon in a single line, then it has a problem.
Welcome to Parsing 101 or "Not everything is as it appears".

Unfortunately, this is a matter of different text formatting being used by SSG when forming the two messages. If the message is on separate lines then SSG is inserting a "new line" character (ASCII character 10, represented in Lua as "\n" which may or may not be accompanied by a Carriage Return character ASCII character 13, represented in Lua as "\r" - I believe SSG follows common C practice which is to omit the carriage return) into the string. When trying to match a string, you need to be aware of any formatting or non-display characters like color codes or embedded item examination tags as well as "white space". White space is anything that shows up as space between words or characters (tabs, etc.). In the case where you are having trouble matching the lines with two colons, there is probably an extra space after one of the colons which is causing the comparison to fail. It helps to see the raw string - Lotro Alerts has a chat log feature that records and displays the incoming chat message with embedded tags displayed. I will probably add such a feature to Anthology to make identifying oddities easier but for now you can use Lotro Alerts to identify embedded characters if you are having trouble matching a string ("new lines" you have to spot yourself).

Anthology allows Lua "Patterns" to be used in the match string to make accounting for these situations a little easier but you need to learn how to use Lua patterns - they are very similar to RegEx or "Regular Expressions" used in other languages but not quite identical. To learn more, you can Google "Lua Patterns" or check out this link:
http://www.lua.org/manual/5.1/manual.html#5.4.1

For instance for the case above you can use the strings:
New Quest.*Thorin's Hall Task.*Broken Daggers
and
Completed.*Thorin's Hall Task.*Broken Daggers
The "." represents "any character" and the "*" means 0 or more repetitions, so the ".*" means 0 or more of any character (including the colon, "new line" characters and spaces). That way the new line and any extraneous spaces are accounted for. With a little work, you can get a pattern that matches all of the odd formatting but is also unique enough to match only the desired messages - the same issues encountered in Lotro Alerts when specifying a trigger message pattern.
Note, raw messages actually have a new line character at the end which is stripped by Anthology so you don't have to worry about matching that.

Last edited by Garan : 12-17-2017 at 06:47 AM.
Garan is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 12-17-2017, 01:17 AM  
Interitus
The Indomitable

Forum posts: 11
File comments: 13
Uploads: 0
I noticed something odd about RECEIVE CHAT, when you use the QUEST chat channel.

New quests and completed quests seem to show up in the quest chat channel differently.

For example:

New Quest: Thorin's Hall Task: Broken Daggers

Completed:
Thorin's Hall Task: Broken Daggers

"New Quest:" is always on the same line, and "Completed:" is always on a different line from the quest name.

What seems to happen is if I'm trying to pick up the new quest above, I need to put "Thorin's Hall Task", or "New Quest: Thorin's Hall Task" as the message

"Broken Dagger" doesn't work, nor does "Thorin's Hall Task: Broken Dagger", or "New Quest: Thorin's Hall Task: Broken Dagger").

However, it I'm trying to pick up the quest being turned in, then I believe "Thorin's Hall Task", "Thorin's Hall Task: Broken Daggers", or "Broken Daggers" will work.

It seems like if it hits a second colon in a single line, then it has a problem.
Interitus is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 12-15-2017, 10:14 PM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 243
File comments: 724
Uploads: 19
Quote:
Originally Posted by Interitus
Weird, I updated that line of code, and it appears it did save my choices, just wouldn't show them. It appears to be fixed now though.
Correct. The typo was in the code that refreshed the display when selecting an objective. Beta 0.4 should be available soon and is just a couple bug fixes (including this one) and the UI translations for FR and DE clients. While working on the FR version of the tutorial I realized that images need distinct versions for each language the same as text since some images will also contain text (such as screen shots of a UI for a tutorial ) so that will be updated as well in 0.4.
Garan is offline Report comment to moderator   Reply With Quote Reply With Quote
Post A Reply

 
Category Jump:
Search this Category:
 

All times are GMT -5. The time now is 04:00 AM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | VGInterface | LoTROInterface | MMOInterface | Swtorui