Difference between revisions of "Talk:Loot Filtration"

From Path of Diablo Wiki
Jump to: navigation, search
(Text Decoration and sounds)
(Notifications and Sounds)
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. Using the above examples, we could add notification options to the style definition:
+
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]: MapIcon = 4, MapIconColor = 5, BorderColor = 33, BorderSize = 1, BackgroundColor = 4, NotificationColor = RED, NotificationPriority = MEDIUM, NotificationSound = "folderwithsounds\soundfile", NotificationSoundPriority = HIGH</code>
+
<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, and play the sound named “soundfile” that’s located in the “folderwithsounds” folder.  
+
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.  
 
 
<<< show images of the drop notification and of “soundfile” in 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]: MapIcon = 4, MapIconColor = 5, BorderColor = 33, BorderSize = 1, BackgroundColor = 4, NotificationColor = RED, NotificationPriority = MEDIUM, NotificationSound =  "@global\sfx\item\rune”, NotificationSoundPriority = HIGH</code>
+
<code>ItemStyle[Fancy]: NotificationColor = RED, NotificationPriority = MEDIUM, NotificationSound =  "@global\sfx\item\rune”, NotificationSoundPriority = HIGH</code>
 
 
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
 
 
 
<<< show H menu selections >>>
 
  
Setting the values to low in game will cue all notifications, settting medium in game will allow medium and high notifications, and setting high in game will allow only notifications that are set to 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===

Revision as of 11:58, 20 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.


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% Fontgreen.png
 %DGREEN% Fontdgreen.png
 %GOLD% Fontgold.png
 %TAN% Fonttan.png

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:

Wiki-loot-filter-text-decorating1.png

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

Wiki-loot-filter-level1.png

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%@

Wiki-loot-filter-macro1.png

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:

Wiki-loot-filter-style1.png

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.

Wiki-loot-filter-style2.png

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>>

Wiki-loot-filter-style-and-macro1.png


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[]

Wiki-loot-filter-if1.png

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.

Credits

Loot filtration implemented in PoD by Dav92 based on code from McGoD, underbent and Deadlock39. Later rebuilt from the ground up by Necrolis.