lotrointerface.com
Search Downloads


Go Back   LoTROInterface > LotRO Stand-Alone Plugins > Other


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

Forum posts: 341
File comments: 980
Uploads: 20
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, 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-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-19-2017, 10:52 AM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 341
File comments: 980
Uploads: 20
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, 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-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-24-2017, 02:21 PM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 341
File comments: 980
Uploads: 20
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-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-25-2017, 02:40 AM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 341
File comments: 980
Uploads: 20
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-25-2017, 03:58 AM  
Interitus
The Indomitable

Forum posts: 11
File comments: 13
Uploads: 0
I got this error today.

...Rings Online\Plugins\GaranStuff\Anthology\Author.lua:194 8: attempt to index field '?' (a nil value)

I deselected "Auto Load Last Story", then opened the author section again and opened the story again by using "Edit Existing" and now everything appears to be fine. Even when I turned "Auto Load Last Story" on again.
Interitus is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 12-26-2017, 03:39 AM  
Interitus
The Indomitable

Forum posts: 11
File comments: 13
Uploads: 0
Quote:
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.
You were right about the parenthesis and dash. I substituted in %(, %), and %-, and they all work. I can't find anything else to work for the character after "Completed:" though. I tried \f, \n, and \r, so I'm not sure what's going on there.

I also found there's an issue with the word "benefit". It requires tags around it. Such as:
applied a <rgb=#FFFF00>benefit</rgb> with

Thanks, and hope you had a merry Christmas.
Interitus is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 12-26-2017, 09:00 AM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 341
File comments: 980
Uploads: 20
Quote:
Originally Posted by Interitus
You were right about the parenthesis and dash. I substituted in %(, %), and %-, and they all work. I can't find anything else to work for the character after "Completed:" though. I tried \f, \n, and \r, so I'm not sure what's going on there.

I also found there's an issue with the word "benefit". It requires tags around it. Such as:
applied a <rgb=#FFFF00>benefit</rgb> with

Thanks, and hope you had a merry Christmas.
Anything displayed with color (different from the user defined color for the channel it is in) or any of the links that you can hover over will indeed have hidden markup language tags surrounding them. I believe I mentioned earlier that you can use the chat log feature from LotRO Alerts to see the raw characters that are in a message and that I intend to add a similar feature to Anthology to make detecting message oddities easier.

Last edited by Garan : 12-26-2017 at 09:03 AM.
Garan is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 12-26-2017, 09:54 PM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 341
File comments: 980
Uploads: 20
Quote:
Originally Posted by Interitus
I got this error today.

...Rings Online\Plugins\GaranStuff\Anthology\Author.lua:194 8: attempt to index field '?' (a nil value)

I deselected "Auto Load Last Story", then opened the author section again and opened the story again by using "Edit Existing" and now everything appears to be fine. Even when I turned "Auto Load Last Story" on again.
Thanks for reporting this. I suspect this was due to using the Select Story window in Reader to delete the story you last edited in Author. A similar bug occurs if you use Author to delete the story you were currently reading in Reader and then reload Reader. Both bugs are now fixed (both modules verify that the prior loaded story actually still exists before trying to load it) and will be in the next release.
Garan is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 01-05-2018, 12:18 PM  
Interitus
The Indomitable

Forum posts: 11
File comments: 13
Uploads: 0
Quote:
Thanks for reporting this. I suspect this was due to using the Select Story window in Reader to delete the story you last edited in Author. A similar bug occurs if you use Author to delete the story you were currently reading in Reader and then reload Reader. Both bugs are now fixed (both modules verify that the prior loaded story actually still exists before trying to load it) and will be in the next release.
That must be it. I think I viewed an old version of a story before deleting it to verify that I was deleting the right one, and didn't realize it was still in the reader.

Quote:
I believe I mentioned earlier that you can use the chat log feature from LotRO Alerts to see the raw characters that are in a message
Yeah, otherwise I would have never figured out what was going on there. Thanks.
Interitus is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 01-05-2018, 06:06 PM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 341
File comments: 980
Uploads: 20
Quote:
Originally Posted by Interitus
Yeah, otherwise I would have never figured out what was going on there. Thanks.
Version 0.5 should be out this weekend. While it doesn't include the chat log, it does have a fun new feature...
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 07:35 AM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui