-
Notifications
You must be signed in to change notification settings - Fork 22
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
3.16 Export Fixes for Items and Passives #38
Conversation
…don't have proper translations from internal descriptions to normal text.
…m's table name.
…fixed this elsewhere.
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.
# ('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', | ||
# }), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
''' | ||
This defines the expected data elements for an item class. | ||
''' |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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()): |
There was a problem hiding this comment.
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'] |
There was a problem hiding this comment.
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']
There was a problem hiding this comment.
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'])) |
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PyPoE/poe/file/psg.py
Outdated
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing
PyPoE/poe/file/translations.py
Outdated
warnings.warn('Broken quantifier "%s" - Error: %s' % | ||
(string, e.args[0]), TranslationWarning) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing
PyPoE/poe/file/translations.py
Outdated
warnings.warn('Duplicate id "%s"' % | ||
translation_id, DuplicateIdentifierWarning) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing
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 I wonder if there's specific requirements for your branch to use stuff you already submitted into the @Journeytojah would be good to get your input here. |
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. |
…iated with doodads.
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
'Armour'
type to the item class map.MAP_FRAGMENT_FAMILIES
enum with new values and remapped existing values so they're accurate.PassiveSkillGraph.psg
so that the passive export will work.renaming that was previously added and merged in from /3.16-update, as it was breaking other places that were expecting those field names. This fixes [Items export - 3.16] Projectiles.dat parsing is broken #33.
Additionally, implemented generic fixes as described in #37, but copied here:
Caveats
FAO
@pm5k @acbeaumo @Journeytojah