PDA

View Full Version : Updating filter system?



xerxes
07-08-2022, 09:15 AM
Hello,

Using this example zone filter file:


<seqfilters>
<section name="Hunt">
<oldfilter><regex>Name:.*ape.*:Race:Gorilla.*:Type:Animal.*</regex></oldfilter>
<oldfilter><regex>Name:.*gorilla.*:Race:Gorilla.*:Type:Animal.*</regex></oldfilter>
<oldfilter><regex>Name:.*tottering.*:Race:Gorilla.*:Type:Undead.*</regex></oldfilter>
</section>
<seqfilters>

It would be more intuitive if instead being an entire line match, you could just specify the filters you cared about. So I could include Name, Race, and Type, without the extra trailing ".*" to catch all of the other useless nonsense in the middle. It took me forever to realize I needed to do this to get the filters working.

Also, that begs the question. All of the filters I've seen use "oldfilter"... is there a "newfilter" or better way of formatting these files?

cn187
07-09-2022, 08:34 AM
The filter system could definitely use some improvement. It's on my TODO list, but I'm not sure when I'll get to it. I'm hoping it will be part of the 7.x release.

With the caveat that I'm not super familiar with the history of the filtering (if anyone who was active back then wants to correct me, please do) -

I think the move from the non-XML format to XML was the shift from the old format to the *start* of the new format. But looking at the code, I don't think the new format ever progressed past just getting things into XML. It looks like you can specify a level range (but I haven't tested it), and that's it. The regex is used for everything else.

My impression is that the intent was to be able to specify just the elements you want to match on, rather than regexing the whole string. I think that's still a good goal, but we're just not there yet.

BlueAdept
07-10-2022, 07:37 PM
I never built the filter system, but I did create most of the filters in the day. I honestly didn't even know they moved to xml format. I don't even know who would have converted it to xml. Maybe it was purple or ieatacid.

I will see if I can find time to research the filters.

BlueAdept
07-10-2022, 07:45 PM
Actually it was Zaphod that did the upgrade from 4 to 5.

This thread has a little about it.

http://www.showeq.net/forums/showthread.php?4419-ShowEQ-5-filters

xerxes
07-17-2022, 03:25 PM
My impression is that the intent was to be able to specify just the elements you want to match on, rather than regexing the whole string. I think that's still a good goal, but we're just not there yet.
And it works, but if the elements you want to match on are not right next to each other, you need to match on anything in between (.*) so that it finds it.

Here's hoping this system can get an overhaul and perhaps maybe a gui to build the filters, vs manually editing the xml files.