Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy/Pasting items from the game results in massively bloated stats. #2684

Open
ghost opened this issue Apr 25, 2021 · 7 comments
Open

Copy/Pasting items from the game results in massively bloated stats. #2684

ghost opened this issue Apr 25, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Apr 25, 2021

For instance a rare body armor with +93 to maximum life ends up with +9395 to maximum life when pasted into PoB. So obviously the various calculations (total life, dps etc) get messed up.

Using 2.3.0. The issue was there even before that version, however.

example

@ghost ghost added the bug Something isn't working label Apr 25, 2021
@QuickStick123
Copy link
Contributor

I can't seem to replicate this (2.3.0) could you try to provide more information and maybe a Pastebin link to a build it occurs on.

@zao
Copy link
Contributor

zao commented Apr 26, 2021

I could reproduce it when copying an item with Ctrl-Alt-C in PoE, as that leverages the new functionality in 3.14 to copy advanced mod descriptions. It seems to be picking up the value range for the stats, the appended digits is approximately the average of its range.

image

Ctrl-C:

Item Class: Boots
Rarity: Rare
Corpse Hoof
Wyrmscale Boots
--------
Armour: 92
Evasion Rating: 108 (augmented)
--------
Requirements:
Level: 51
Str: 48
Dex: 48
--------
Sockets: R-R-B-R 
--------
Item Level: 58
--------
6% increased Movement Speed if you haven't been Hit Recently (enchant)
--------
+12 to Dexterity
+16 to Evasion Rating
+99 to maximum Life
+28% to Lightning Resistance
30% increased Movement Speed
+26% to Fire Resistance (crafted)

Ctrl-Alt-C:

Item Class: Boots
Rarity: Rare
Corpse Hoof
Wyrmscale Boots
--------
Armour: 92
Evasion Rating: 108 (augmented)
--------
Requirements:
Level: 51
Str: 48
Dex: 48
--------
Sockets: R-R-B-R 
--------
Item Level: 58
--------
6% increased Movement Speed if you haven't been Hit Recently
(Recently refers to the past 4 seconds) (enchant)
--------
{ Prefix Modifier "Virile" (Tier: 2) — Life }
+79(70-79) to maximum Life
{ Prefix Modifier "Cheetah's" (Tier: 2) — Speed }
30% increased Movement Speed
{ Prefix Modifier "Flea's" (Tier: 2) — Life, Defences }
+16(14-20) to Evasion Rating
+20(18-23) to maximum Life
{ Suffix Modifier "of the Mongoose" (Tier: 9) — Attribute }
+12(8-12) to Dexterity
{ Suffix Modifier "of the Thunderhead" (Tier: 5) — Elemental, Lightning, Resistance }
+28(24-29)% to Lightning Resistance
{ Master Crafted Suffix Modifier "of Craft" (Rank: 2) — Elemental, Fire, Resistance }
+26(21-28)% to Fire Resistance (crafted)

@ghost
Copy link
Author

ghost commented Apr 26, 2021

I could reproduce it when copying an item with Ctrl-Alt-C in PoE, as that leverages the new functionality in 3.14 to copy advanced mod descriptions. It seems to be picking up the value range for the stats, the appended digits is approximately the average of its range.

Ah. I figured it out.
The reason this was happening for me even when using Ctrl-C was that I rebound 'Highlight items and objects' to Ctrl at some point. Basically when I was doing Ctrl-C, I was tapping into the new 3.14 Ctrl-Alt-C functionality inadvertently.

Can probably safely close this issue. Sorry for the confusion!

@zao
Copy link
Contributor

zao commented Apr 26, 2021

Good that you've found the root cause, until advanced mod descriptions are implemented in PoB it's probably best to ensure that your copy shortcut doesn't include advanced mod descriptions.

For anyone curious, the reason it's sneakily evaluating as a range is that the parenthesis are detected as a range at:

if line:match("%(%d+%-%d+ to %d+%-%d+%)") or line:match("%(%-?[%d%.]+ to %-?[%d%.]+%)") or line:match("%(%-?[%d%.]+%-[%d%.]+%)") then
rangedLine = itemLib.applyRange(line, 1, catalystScalar)

Getting a default range spec of 0.5 at:
t_insert(modLines, { line = line, extra = extra, modList = modList, modTags = modTags, variantList = variantList, crafted = crafted, custom = custom, fractured = fractured, implicit = implicit, range = rangedLine and (tonumber(rangeSpec) or 0.5), valueScalar = catalystScalar })

Finally having the range spec applied in BuildModList at:
if modLine.range then
local strippedModeLine = modLine.line:gsub("\n"," ")
-- Look at the min and max of the range to confirm it's *actually* a range
local rangeMin, rangeMax = itemLib.getLineRangeMinMax(strippedModeLine)
if rangeMin ~= rangeMax then
local catalystScalar = getCatalystScalar(self.catalyst, modLine.modTags, self.catalystQuality)
-- Put the modified value into the string
local line = itemLib.applyRange(strippedModeLine, modLine.range, catalystScalar)
-- Check if we can parse it before adding the mods
local list, extra = modLib.parseMod(line)
if list and not extra then
modLine.modList = list
t_insert(self.rangeLineList, modLine)
end
end
end

@Gnomiro
Copy link

Gnomiro commented May 6, 2021

Having similar problems as I also use ctrl for advanced modifications. Is there currently any work on this? A relatively easy workaround would could probably be based on the {}-brackets which are, as far as I know, only used in advanced mod descriptions. If any of them are present the ()-brackets could be skipped or interpreted differently.

If no one is working on it I maybe will have a look at it later this week.

@Wires77
Copy link
Member

Wires77 commented Oct 15, 2021

Having similar problems as I also use ctrl for advanced modifications. Is there currently any work on this? A relatively easy workaround would could probably be based on the {}-brackets which are, as far as I know, only used in advanced mod descriptions. If any of them are present the ()-brackets could be skipped or interpreted differently.

If no one is working on it I maybe will have a look at it later this week.

Unfortunately, PoB also uses curly brackets internally to give lines a special designation. I do want to support advanced mod descriptions, and it's probably not worth excluding them unless we're adding support for them at the same time.

@SnosMe
Copy link

SnosMe commented Oct 16, 2021

It looks like PoB always places additional info on same line

{crafted}Allocates Adder's Touch
{tags:resource,life}{range:0.5}Regenerate (1.2-1.6)% of Life per second

while the text from game has one { in the beginning of line and one } at the end, so you can clearly distinguish between them.

{ Suffix Modifier "of the Mongoose" (Tier: 9) — Attribute }
+12(8-12) to Dexterity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants