Reporting non functional filters

Involved development of the OpenMW construction set.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Reporting non functional filters

Post by sirherrbatka »

Greetings,

I'm doing quite extensive filters testing right now ;-)

I'm not sure if zini solved this already and since I can't merge master into my filter branch right now I decided to ask about it here. I wrote filter that would show heavy helmets, it shows nothing.

Code: Select all

and (value("Weight", (10, 30)),  string("Armor type", "Helmet"))
can somebody test it with master, please? it would take any hour to compile it here ;-)
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Reporting non functional filters

Post by Zini »

Doesn't work for me either. More debugging. *sigh*
it would take any hour to compile it here
Try building OpenMW on something else than a CPU salvaged from a coffee-maker. Also, make sure to build multi-threaded.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: Reporting non functional filters

Post by sirherrbatka »

Try building OpenMW on something else than a CPU salvaged from a coffee-maker. Also, make sure to build multi-threaded.
So, you are saying that you are willing to buy me a new PC? Great! :lol:

This is Athlon3200+. It is outdated, and sluggish but it is also the best CPU I own currently :(

Back on topic though: thanks.

Other quirsk:

Attempt to show all objects with scripts with
not string("Script", "")

gives me also statics.

attempt to get
not string("Icon", "")

also does not work as expected.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Reporting non functional filters

Post by Zini »

That is actually the correct behaviour. A string or value test for a row that is not available in a record will always yield false. For example the script cell in a static row isn't an empty string. It is literally nothing, because statics can't have scripts. Maybe not the most intuitive approach, but we would have to be very careful not to break other stuff, if we decide to change it.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Reporting non functional filters

Post by Zini »

Or not. In master testing an empty cell against an empty string yields true now.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Reporting non functional filters

Post by Zini »

And the other bug is fixed too.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: Reporting non functional filters

Post by sirherrbatka »

Works. Thanks a lot.

Other question:
What is the limit of filter length? I wanted to make a filter that will filter only heavy armor elements. I continued to build it and got something like this (note that this is not finished yet):

Code: Select all

or ( and (value("Weight", (4.5, 9999999)),  or (string("Armor type", "Helmet"), string("Armor Type", "Left Gauntlet"), string("Armor Type", "Right Gauntlet"), string("Armor Type", "Right Bracer"), string("Armor Type", "Left Bracer"))), and (value("Weight", (9.0, 99999999)), or (string("Armor Type", "Left Pauldron"), string("Armor Type", "Right Pauldron")))), and (value("Weight", (13, 99999999)), or ( string("Armor Type", "Greaves"), string("Armor Type", "Shield") ) ) ) )
Greaves and shields are not showed.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Reporting non functional filters

Post by Zini »

Lol? What is that supposed to be? Anyway, there is no length limit.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: Reporting non functional filters

Post by sirherrbatka »

as you can see it should:

list helmets/gauntlets/bracers that weights over 4.5
lists shields/graves that weights over 13
...

Basicly list all heavy armor pieces (not finished yet). ;-)

PS
As post 1.0 we could add qregexp for filters. this would:
a) give openCS more l33t feel
b) grant ability to filter all iron (or any other recurring word) equipment.
c) reduce the filters length.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Reporting non functional filters

Post by Zini »

These weight limits are actually GMSTs, right? Not a good idea to build filters from them, because they will break as soon as someone changes the GMSTs. Also, the GMST approach is probably one of the first things we will throw out after 1.0 (in favour of an actually armor skill field in the armor record; which will allow much easier filters). I suggest to just drop these filters for now. They will only add confusion.

btw. the string syntax is using regular expressions.
Post Reply