Difference between revisions of "Talk:Loot Filtration"
(→Text Decoration and sounds) |
|||
(One intermediate revision by the same user not shown) | |||
Line 250: | Line 250: | ||
===Notifications and Sounds=== | ===Notifications and Sounds=== | ||
− | Notifications can come in the form of chat messages or audio cues letting you know an item dropped. You can enable notifications by defining NotificationColor or NotificationSound. | + | Notifications can come in the form of chat messages or audio cues letting you know an item dropped. You can enable notifications by defining NotificationColor or NotificationSound. Adding notification options to a style definition: |
− | <code>ItemStyle[Fancy]: | + | <code>ItemStyle[Fancy]: NotificationColor = RED, NotificationPriority = MEDIUM, NotificationSound = "folderwithsounds\soundfile", NotificationSoundPriority = HIGH</code> |
− | This would give us a red notification in chat when the item drops | + | This would give us a red notification in chat when the item drops and play the sound named “soundfile” that’s located in the “folderwithsounds” folder. |
− | |||
− | |||
Alternatively you can use game sounds by referencing the sound location in game files: | Alternatively you can use game sounds by referencing the sound location in game files: | ||
− | <code>ItemStyle[Fancy]: | + | <code>ItemStyle[Fancy]: NotificationColor = RED, NotificationPriority = MEDIUM, NotificationSound = "@global\sfx\item\rune”, NotificationSoundPriority = HIGH</code> |
− | |||
− | |||
− | |||
− | |||
− | + | This would give us a red notification in chat when the item drops and play the rune drop sound from the game files. | |
+ | Items can be given notification and sound notification priority values of high, medium, or low. In game you can choose high medium and low values. Setting the values to low in game will cue all notifications, setting medium in game will allow medium and high notifications, and setting high in game will allow only notifications that are set to high. | ||
===If Statements=== | ===If Statements=== | ||
Line 300: | Line 295: | ||
These are small examples but this concept can be scaled up to apply to all + skill granting items, runeword bases, and even potions, potentially allowing many items to skip filter lines which wouldn’t apply to them. | These are small examples but this concept can be scaled up to apply to all + skill granting items, runeword bases, and even potions, potentially allowing many items to skip filter lines which wouldn’t apply to them. | ||
+ | |||
+ | ===ALT Text=== | ||
+ | Holding the ALT key when hovering over an item shows additional information not seen by default referred to as advanced item descriptions. You can add to these advanced item descriptions by enclosing "ALT text" in brackets {}. | ||
+ | |||
+ | Using: | ||
+ | <pre>ItemDisplay[tsc]: %NAME% {This is a TP scroll}</pre> | ||
+ | Adds the text "This is a TP scroll" to TP scrolls that's only visible when holding the ALT key on the keyboard. | ||
+ | |||
+ | [[File:Wiki-loot-filter-alt-text.png]] | ||
+ | |||
+ | A more useful implementation for this could be to add cube recipes or possible corruption mods to an item. Presenting this larger amount of text as an advanced item description allows the convenience of having the information there but with the convenience of not having it visible all the time. | ||
+ | |||
+ | |||
+ | ===Attribution=== | ||
+ | Attribute codes notify users of general filter info when it's loaded. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Code | ||
+ | ! Purpose | ||
+ | |- | ||
+ | | Attribute[Author]: | ||
+ | | Filter authors name | ||
+ | |- | ||
+ | | Attribute[Name]: | ||
+ | | Name of the filter | ||
+ | |- | ||
+ | | Attribute[Version]: | ||
+ | | Version number | ||
+ | |- | ||
+ | | Attribute[Date]: | ||
+ | | Last edit date | ||
+ | |} | ||
+ | |||
+ | How filter attributes are displayed in game: | ||
+ | |||
+ | |||
+ | [[File:Wiki-loot-filter-attribution.png]] | ||
+ | |||
== Credits == | == Credits == | ||
Loot filtration implemented in PoD by Dav92 based on code from McGoD, underbent and Deadlock39. Later rebuilt from the ground up by Necrolis. | Loot filtration implemented in PoD by Dav92 based on code from McGoD, underbent and Deadlock39. Later rebuilt from the ground up by Necrolis. |
Latest revision as of 10:16, 30 August 2024
"By editing the "item filter" file, which can be found in your "filter" folder within your Path of Diablo installation folder. You may create a set of rules which will change the way loot is displayed.
You can find loot filters made by other players and download instructions at List of Loot Filters.
Contents
Basics
Item Codes
All items in the game have an id code. Below are a few examples:
Code | Item |
---|---|
tsc | Scroll of Town Portal |
rvs | Rejuvenation Potion |
pk1 | Key of Terror |
cx5 | Orb of Corruption |
See more codes at Loot Filtration Codes
If you would like to rename "Scroll of Town Portal" to a much shorter "TP" then you would type: ItemDisplay[tsc]: TP
You can also add more text to an item. If you want to remember which boss drops which uber key then you would type: ItemDisplay[pk1]: Key of Terror (Countess)
Color Codes
You can also change the color of the item name using color codes. Below are a few example colors:
Code | Color |
---|---|
%GREEN% | ![]() |
%DGREEN% | ![]() |
%GOLD% | ![]() |
%TAN% | ![]() |
See more codes at Loot Filtration Codes
If you would like to change the color of the Horadric Cube to purple then you would type: ItemDisplay[box]: %PURPLE%Horadric Cube
You can also use multiple colors within a single item. For example if you want the word "Horadric" to be yellow and "Cube" to be purple you would type: ItemDisplay[box]: %YELLOW%Horadric %PURPLE%Cube
Value References
Sometimes you want to call upon a value in the game to show the player. Below are a few examples:
Code | Output |
---|---|
%PRICE% | Selling price of the item |
%ILVL% | Item level |
%SOCKETS% | Show the item's socket count |
See more codes at Loot Filtration Codes
If you want to show the selling price of an item using a dollar sign ($100) as a prefix you would type: ItemDisplay[gpm]: ($%PRICE%) Choking Gas Potion
The same thing can be done to show the item level {L99} as a suffix: ItemDisplay[cm3]: %NAME% {L%ILVL%}
Hiding Items
When you want to hide an item, you simply leave the space behind the colon (:) empty.
So for example if you want to hide Antidote potions (yps) you would type: ItemDisplay[yps]:
This tells the game to display Antidote potions as nothing, which hides the item.
Rule Priority
The higher the rule in your filter file, the higher priority it will have.
This means if on the first line of your item filter you choose to hide all Spears but then on Line 2 you choose to show Spears with 6 sockets then the result is no spear will ever show.
In this example, you would change their location within the file. So show 6 socket spears on Line 1 and hide all spears on Line 2. This will hide all Spears except those with 6 sockets.
Conditions
- >
- <
- =
- <=
- >=
- !=
Using Greater than >, Less than <, Equal to =, Less than or equal to <=, Greater than or equal to >=, and Not equal to != will help add conditions to rules.
You may want to hide gold stacks that are not worth your time (stacks below 1000g) by typing: ItemDisplay[GOLD<1000]:
Logical Operators
You can use logical operators whenever you want to show an item only if a certain condition is met. Below are all the options:
- AND
- OR
- ! (logic negation)
If you want to show all polearms (WP8) with 4 or 5 sockets then you would type: ItemDisplay[WP8 (SOCK>3 AND SOCK<6)]: %NAME%
This same rule can be written in a different way: ItemDisplay[WP8 !SOCK=0 !SOCK=1 !SOCK=2 !SOCK=3 !SOCK=6]: %NAME%
The first one says "Show me all polearms with more than 3 but less than 6 sockets" whereas the second says "Show me all polearms but not ones with 0, 1, 2, 3 or 6 sockets".
It is important to keep AND & OR within their own bracket set. For example: (SOCK>3 OR SOCK=1). This is not required for logic negation (!)
Text Decoration and sounds
You can alter the appearance of item drops by adding filter code to the items display line. To make a super healing potion look like this:
You would format the potions display line as follows:
ItemDisplay["Super Healing Potion"]: %RED%%NAME% %MAPICON(4,5)% %BORDER(1,33)% %BGCOLOR(4)%
Drop decoration and sound modifiers:
Code | Input | Description |
|
---|---|---|---|
%MAPICON(x or x,x)% | One (1-96) or two (1-8) numbers. The first number sets the icon, 2nd shifts the color | Sets an icon that's visible on the minimap | |
%BORDER(x or x,x)% | One (1-253) or two (1-4) numbers. The first number sets a border color, 2nd number sets border thickness | Creates a border around the item name display | |
%BGCOLOR(x)% | One number (1-253) | Adds a background color to the item name display | |
%NOTIFY(x)% | A Color, choosing "ITEM" uses the default item color (blue for magic, yellow for rare, etc.) |
Creates a chat notification when the item drops | |
%NOTIFYSOUND(x)% | Number corresponding with an in game sound index | Forces a special sound when an item drops |
Filter levels
Filters can be set to varying degrees of strictness using filterlevels. To only show minor hp pots in the lowest filter level you could use:
ItemDisplay[hp1 FILTERLVL=1]: %RED%!%WHITE%minor hp
You can give filter levels names that can be seen in game using the H menu:
FilterLevel[1]: Ladder start FilterLevel[2]: Maps FilterLevel[3]: No low runes FilterLevel[4]: No hp/mp pots
Modern Filtering Techniques
Patch #21 Shungite brought us new filtering options, including macros, styles, support for if statements, and better ways to manage custom sounds.
Text Macros
Text macros are lines of text that can be preset and used repeatedly without the need to retype the entirety of the text. This is useful if the same test will be reused in a filter, as well as making some filtering lines easier to read to and change. If, for example you wanted to have red, green, and blue @ signs to be displayed when a super healing potion drops you would display it as:
ItemDisplay["Super Healing Potion"]: %RED%@%GREEN%@%BLUE%@ %RED%%NAME% %BLUE%@%RED%@%GREEN%@
Assuming this text would be used multiple times in a filter, instead of having to reuse that you could assign it to a text macro. At the top of the filter:
TextMacro[RGB]: %RED%@%GREEN%@%BLUE%@ TextMacro[BGR]: %BLUE%@%RED%@%GREEN%@
Then to use a text macro you call it by wrapping the name of it %! !%, like this:
ItemDisplay["Super Healing Potion"]: %!RGB!% %RED%%NAME% %!BGR!%
Styling
Styles can be used to set display options like border and background color of an item drop. Styles are defined at the top of the filter just like text macros and can be used by wrapping the name in << and >> like <<Style>>. To achieve this display:
Define the style at the top of the filter:
ItemStyle[Fancy]: MapIcon = 4, MapIconColor = 5, BorderColor = 33, BorderSize = 1, BackgroundColor = 4
Then apply it using:
ItemDisplay["Super Healing Potion"]: %RED%%NAME% <<Fancy>>
Inline styles
Styles can also be used and edited in-line. Using the above example, if you wanted a different background color you would use:
ItemDisplay["Super Healing Potion"]: %RED%%NAME% <:Fancy: BackgroundColor = 155>
This would apply all parts of the Fancy style except for the background color, background color will use the newly defined color instead.
Style elements border color and background color can also utilize RGB values, for example BackgroundColor = RGB(245/2/19)
.
Applying Styles and Macros together
Text macros and styles can be used together
ItemDisplay["Super Healing Potion"]: %!RGB!% %RED%%NAME% %!BGR!% <:Fancy: BorderColor = 99, BorderSize = 4> ItemDisplay[POTION]: %!RGB!% %PURPLE%%NAME% %!BGR!% <<Fancy>>
Notifications and Sounds
Notifications can come in the form of chat messages or audio cues letting you know an item dropped. You can enable notifications by defining NotificationColor or NotificationSound. Adding notification options to a style definition:
ItemStyle[Fancy]: NotificationColor = RED, NotificationPriority = MEDIUM, NotificationSound = "folderwithsounds\soundfile", NotificationSoundPriority = HIGH
This would give us a red notification in chat when the item drops and play the sound named “soundfile” that’s located in the “folderwithsounds” folder.
Alternatively you can use game sounds by referencing the sound location in game files:
ItemStyle[Fancy]: NotificationColor = RED, NotificationPriority = MEDIUM, NotificationSound = "@global\sfx\item\rune”, NotificationSoundPriority = HIGH
This would give us a red notification in chat when the item drops and play the rune drop sound from the game files.
Items can be given notification and sound notification priority values of high, medium, or low. In game you can choose high medium and low values. Setting the values to low in game will cue all notifications, setting medium in game will allow medium and high notifications, and setting high in game will allow only notifications that are set to high.
If Statements
If statements can be useful when you want to evaluate only certain items on some criteria. Since every drop is evaluated line-by-line in a filter until a match is found, if blocks can provide efficiency by forcing item checks to ignore multiple lines. As an example, if you wanted look for pre-buff assassin claws, and add the skill name to the display, you could use the lines:
ItemDisplay[CL5 NMAG SKILL("Blade Shield")>2]: %NAME% %LIGHT_GRAY%+3 Blade Shield ItemDisplay[CL5 NMAG SKILL("Venom")>2]: %NAME% %LIGHT_GRAY%+3 Venom
This would add “+3 skill name” to these claws, but every item dropped would be evaluated to see if they match. An if statement addressing this could be:
EnableIf[CL5 NMAG] ItemDisplay[SKILL("Venom")>2]: %NAME% %LIGHT_GRAY%+3 Venom %CONTINUE% ItemDisplay[SKILL("Blade Shield")>2]: %NAME% %LIGHT_GRAY%+3 Blade Shield %CONTINUE% ItemDisplay[CL5 NMAG]: %NAME% EndIf[]
This would cause any item that’s not a white or grey assassin claw to ignore those lines.
Another example could be to add Hemorrhage or life tap charges to the items display
EnableIf[(MAG OR NMAG) (WP12)] ItemDisplay[(MAG OR NMAG) SKILL("Hemorrhage")=3]:%NAME% %RED% +3 Hemo ItemDisplay[(MAG OR NMAG) SKILL("Hemorrhage")=2]:%NAME% %RED% +2 Hemo ItemDisplay[(MAG) CHARGES("Life Tap")>0]:%NAME% %LIGHT_GRAY%+Life Tap Charges %CONTINUE% ItemDisplay: %NAME% EndIf[]
These are small examples but this concept can be scaled up to apply to all + skill granting items, runeword bases, and even potions, potentially allowing many items to skip filter lines which wouldn’t apply to them.
ALT Text
Holding the ALT key when hovering over an item shows additional information not seen by default referred to as advanced item descriptions. You can add to these advanced item descriptions by enclosing "ALT text" in brackets {}.
Using:
ItemDisplay[tsc]: %NAME% {This is a TP scroll}
Adds the text "This is a TP scroll" to TP scrolls that's only visible when holding the ALT key on the keyboard.
A more useful implementation for this could be to add cube recipes or possible corruption mods to an item. Presenting this larger amount of text as an advanced item description allows the convenience of having the information there but with the convenience of not having it visible all the time.
Attribution
Attribute codes notify users of general filter info when it's loaded.
Code | Purpose |
---|---|
Attribute[Author]: | Filter authors name |
Attribute[Name]: | Name of the filter |
Attribute[Version]: | Version number |
Attribute[Date]: | Last edit date |
How filter attributes are displayed in game:
Credits
Loot filtration implemented in PoD by Dav92 based on code from McGoD, underbent and Deadlock39. Later rebuilt from the ground up by Necrolis.