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

3.16 Export Fixes for Items and Passives #38

Merged
merged 16 commits into from
Nov 9, 2021

Conversation

angelic-knight
Copy link
Collaborator

@angelic-knight angelic-knight commented Nov 4, 2021

Abstract

Allow exporting of passives and items for 3.16.
Additionally, include some generic fixes that I developed to aid in 3.16 updates.

Action Taken

Additionally, implemented generic fixes as described in #37, but copied here:

  • In util.py, revert my previous change which sanitized double quotes. Another commit by someone else handled this better upstream of the change I'm reverting.
  • In item.py, print out the rowid of the item being processed every so often (between 100 and 200 times total, in equal length increments)
  • In lua.py, fix the crafting item class categories keys parameter to match what we use in our wiki. This fixes issue 24
  • In passives.py, prevent crashing out when a passive has no icon path, and give a warning instead.
  • In skill.py, print out some rowids and add in some typo fixes which were I think were in /patches already.

Caveats

  • I did not add a new hideout doodad conflict resolver, so [Items export - 3.16] Hideout Doodads Conflict Resolver Relies on Non-existent column #34 is still alive and causing problems. Of note is that it's blocking the totems from being exported.
  • The wiki side will need to be updated for the armour defence ranges still.
  • We should probably update names of fields in stable.py at some point to match the updates to the dat spec repository (they had been updated but I'm reverting them here as it was simpler than changing other places in PyPoE).
  • In this PR, and in all my others up to this point, I have not changed or tested image exports.

FAO

@pm5k @acbeaumo @Journeytojah

…don't have proper translations from internal descriptions to normal text.
Adding printing to indicate current rows being processed (up to 200 row IDs and names will print) during exporting.
Re-evaluated and updated the MAP_FRAGMENTS_FAMILIES enum
Fixed some specs that were erroring out during item exporting.
…ssues where conflicts aren't resolved)

Fix the HeistJobs.dat spec to include the new columns for 3.16
Supporting exporting passives that don't have icon paths.
Revert some spec column name changes that were causing issues. I need to run the spec autogeneration sometime and then update PyPoE hardcoded references to use the new values instead of manually editing the spec.
Adding disambiguation suffixes for Energy Blade skill gem and Energy Blade swords (that you get from using the skill gem)
Removed old fix to an issue since it was fixed a better way (in fields.py).
Added extra printing to skill export.
Comment on lines 2396 to 2406
# ('HideoutNPCsKey', {
# 'template': 'master',
# 'format': lambda v: v['Hideout_NPCsKey']['Name'],
# 'condition': lambda v: v is not None,
# }),
# ('MasterLevel', {
# 'template': 'master_level_requirement',
# }),
# ('FavourCost', {
# 'template': 'master_favour_cost',
# }),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a case of YAGNI?

Will we ever have any need for this? @Journeytojah @angelic-knight
If not needed, just remove outright instead of comment. But please check with one another first.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be safe to delete. @Journeytojah, what's your take on it?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine to remove.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed this and surrounding related code.

Comment on lines +2815 to +2817
'''
This defines the expected data elements for an item class.
'''
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me like we're inside of a method here, which would mean that we should use line comments here instead of docstrings. Can we please change this to be # This defines the expected data elements for an item class. insead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's within a class, not a method.
I'm tweaking it so intellisense will pick up on the docstring.

@@ -3281,6 +3321,23 @@ def _export(self, parsed_args, items):

return r

def _print_item_rowid(self, parsed_args, base_item_type):
#Don't print anything if not running in the rowid mode.
if (not 'start' in vars(parsed_args).keys()) or (not 'end' in vars(parsed_args).keys()):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as #37 (comment)

'Id']['ItemDisplayString' + row['RarityKey'].name_upper][
'Text']
if row['BeastRarity'] != RARITY.ANY:
components[-1]['rarity'] = self.rr['ClientStrings.dat'].index['Id']['ItemDisplayString' + row['BeastRarity'].name_upper]['Text']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one's a doozy to follow by-eye. Can we try:

if row['BeastRarity'] != RARITY.ANY:
    display_string = 'ItemDisplayString' + row['BeastRarity'].name_upper
    components[-1]['rarity'] = self.rr['ClientStrings.dat'].index['Id'][display_string]['Text']

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure 👍

#atlas_start_node doesn't have an icon path
else:
data['icon'] = ''
warnings.warn('Icon path file not found for {}: {}'.format(passive['Id'], passive['Name']))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as #37 (comment)

@@ -742,7 +742,7 @@ def export(self, parsed_args, skills):
if not parsed_args.allow_skill_gems and skill in \
self.rr['SkillGems.dat'].index['GrantedEffectsKey']:
console(
'Skipping skill gem skill "%s"' % skill['Id'],
'Skipping skill gem skill "{}" at row {}'.format(skill['Id'], skill.rowid),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -751,15 +751,14 @@ def export(self, parsed_args, skills):
self._skill(ge=skill, infobox=data, parsed_args=parsed_args)
except Exception as e:
console(
'Error when parsing skill "%s":' % skill['Id'],
'Error when parsing skill "{}" at {}:'.format(skill['Id'], skill.rowid),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unknown = struct.unpack_from(
'<' + 'B'*unknown_length, data, offset=offset
)
offset += 1*unknown_length

root_length = struct.unpack_from('<I', data, offset=offset)[0]
if(root_length > 1000):
raise ValueError(
'root_length is unrealistically large at {}.\nStopping to prevent allocating too much memory'.format(root_length)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing

Comment on lines 1055 to 1056
warnings.warn('Broken quantifier "%s" - Error: %s' %
(string, e.args[0]), TranslationWarning)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing

Comment on lines 1598 to 1599
warnings.warn('Duplicate id "%s"' %
translation_id, DuplicateIdentifierWarning)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing

@pm5k
Copy link
Collaborator

pm5k commented Nov 6, 2021

I am also concerned that you have seemingly doubled-up your own workload since a lot of changes from #37 show up here. The reason we keep dev separate from patches is so that some fixes don't affect certain mappings/schema.

I wonder if there's specific requirements for your branch to use stuff you already submitted into the dev PR (#37), is that the case here?

@Journeytojah would be good to get your input here.

@angelic-knight
Copy link
Collaborator Author

I've removed all the changes from #37 except for the handling of passives that don't have icon paths, as that was crashing in 3.16.

@pm5k pm5k merged commit c1682a8 into Project-Path-of-Exile-Wiki:patches Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants