User:TheFrz/Item filter: Difference between revisions
>TheFrz (Created page with "{{stub}} '''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 fi...") |
>TheFrz |
||
Line 34: | Line 34: | ||
[[File:Item Filter Structure.png]] | [[File:Item Filter Structure.png]] | ||
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. | 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. | ||
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 | 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. | ||
===Comments=== | ===Comments=== |
Revision as of 22:01, 18 July 2015
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-game.
Setup
- Step 2
- Put a text file with
.filter
extension there: - 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:
- If your filter file has not a
.filter
extension, or it is not located in the same folder as yourproduction_Config.ini
file, you won't see this option.
- Step 4
- Clicking 'Reload' will display this message if the filter is working correctly:
- 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 Show
and Hide
blocks that each specify certain options. Anything matched by a Show
block will be shown and anything matched by a Hide
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.
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.
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 after conditions. The example below shows valid and invalid positions for comments:
# valid Show # valid Class "Gem" # invalid, unable to pass parameter BaseType "Empower" # invalid, unable to pass parameter # valid SetBorderColor 27 162 155 # valid
Case sensivity
Item filter is case sensitive. For example using show
instead of Show
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 absolutelly unreadable.
Conditions
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.
Option | Valid values | Description |
---|---|---|
SetBackgroundColor <red green blue> [alpha] | <0..255 0..255 0..255> [0..255] | Background color of item box |
SetBorderColor <red green blue> [alpha] | <0..255 0..255 0..255> [0..255] | Border color of item box |
SetTextColor <red green blue> [alpha] | <0..255 0..255 0..255> [0..255] | Text color |
SetFontSize <size> | <18..45> | Size of the text (default: 32) |
PlayAlertSound <sound> [volume] | <1..9> [0..100] | Sound on item drop |
Guidelines
Development tools
Troubleshooting
Version history
Version | Changes |
---|---|
2.0.0 |
|