User:TheFrz/Item filter

Item filter is an optional feature for players to customize item apperance of the ground by filtering items into groups and setting new styles to them. Item filter script language provides a wide and deep item searching (conditions) and styling (colors, sizes, sounds, etc.).

There is no in-game system for item filters, they have to be written by end user in a text file and then enabled in the game.

Setup

 * Step 1
 * Go to  like at the screenshot:
 * [[File:browserlocation.jpg]]


 * Step 2
 * Put a text file with  extension there:
 * [[File:Files.jpg]]
 * If you cannot see your file extension, Show/Hide File extensions in Windows


 * Step 3
 * Go to the in-game Options menu and click on the UI tab. You should see this new option, located at the very bottom of the list:
 * [[File:Highlight.jpg]]
 * If your filter file has not a  extension, or it is not located in the same folder as your   file, you won't see this option.


 * Step 4
 * Clicking 'Reload' will display this message if the filter is working correctly:
 * [[File:Confirmation.png]]
 * Unless there will be an error messege with line number and error text itself.

Syntax
The syntax of item filters is a simple set of rules that define a correctly structured and valid script. The item filter don't load if it has invalid syntax.

Structure
The basic structure of a script is a collection of  and   blocks that each specify certain options. Anything matched by a  block will be shown and anything matched by a   block will be hidden. If there are multiple conditions in a block then all of them must be matched for the block to match an item.



In the example above you can see a basic example of a script that displays Empower gem with a green border, all gems with 15% quality or higher have bigger text size and all other gems become hidden.

The blocks are matched in the order they come in the file which means items can be matched only once. In this example an Empower gem with 15% quality has a border but hasn't increased text size. This happens because Empower matches conditions in the first block and search for another matching stops. This behaviour makes block ordering very important.

An empty block matches all items, which means that the  at the end of the file effectively hides everything that wasn't specifically shown.

Comments
Only inline comments are supported. They begin with  symbol and use newline character to indicate the end of the comment. Comments can be placed everywhere except the end of conditions. The example below shows valid and invalid positions for comments:

Show # valid Class "Gem" # invalid, unable to pass parameter BaseType "Empower" # invalid, unable to pass parameter # valid SetBorderColor 27 162 155 # valid
 * 1) valid

Case sensivity
Item filter is case sensitive. For example using  instead of   leads to invalid code.

Whitespace
Spaces, tabs and newlines used outside of string constants are called whitespace. Item filter is whitespace insensitive.

Show Class "Gem" BaseType "Empower" SetBorderColor 27 162 155 Hide Class "Gem" # this works

Although it is possible to write down the whole script in 1 line this makes your code unreadable for users.

Conditions
Conditions are options that describe what items will be matched with a block they are inside of. Some conditions allow to use comparision operators such as,  ,   or.

Styling
Certain items have their own look (i.e. gems have green text color, maps have borders etc.). Item filter system allow users to override default values with another.

Development tools

 * Item filter preview tool

Version history

 * Introduced to the game.
 * }