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

[DS1R] Using the 'Write Entities' button gets rid of vanilla entities Flags class #20

Open
LukeLavan opened this issue Oct 9, 2022 · 0 comments · May be fixed by #21
Open

[DS1R] Using the 'Write Entities' button gets rid of vanilla entities Flags class #20

LukeLavan opened this issue Oct 9, 2022 · 0 comments · May be fixed by #21

Comments

@LukeLavan
Copy link
Contributor

Steps to Reproduce:

  1. Launch Soulstruct via python -m soulstruct.
  2. Choose 'Dark Souls Remastered'.
  3. Initialize a new project by navigating to an empty directory.
  4. Point Soulstruct towards DS1R installation as normal.
  5. Choose "Yes, import all game files".
  6. Click through the 'Region Cleanup' prompt (choice doesn't matter).
  7. Choose "Yes, translate them".
  8. Choose "Yes, export them".
  9. Choose "Yes, include them".
  10. Navigate to the "Entities" tab ("m10_00_00_00 [Depths]" is chosen by default).
  11. Click the "Write Entities" button.
  12. Navigate to the "Events" tab ("m10_00_00_00 [Depths]" is chosen by default).
  13. Attempt to compile the script.

At this point, compilation will fail with the following error:
error

Issue

During project initialization, if the user chooses to translate entities the offer_entities_export function is called. During which, if the user also chooses export the entities Python modules, the user is offered inclusion of "pre-identified game IDs".

Answering yes to all of these ends up generating entities Python modules that include the pre-identified IDs from the vanilla_entities folder. For entities concerning the common event script, these are the only contents of the entity file and it can not be regenerated. However, each of the maps' entity files are generated using MSB.write_entities_module and specifying the append_to_module kwarg.

The issue is that if a map's entity file is regenerated using the "Write Entities" button, the resulting MSB.write_entities_module call does not attempt to append the respective "vanilla_entities" file to the resulting entities module. The result is that references to the Flags module fail during compilation, showing the error above.

Note that if the event script is compiled before the entities file is regenerated excluding the Flags class, then the error won't occur until Soulstruct is restarted. EMEVD.ENTITIES_ENUM_MANAGER seems to hold onto enums that have been imported, even if that enum is specifically not imported in subsequent decompilations, via its __CACHED_MODULE_CLASSES property. Restarting Soulstruct resets this cache of imported modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant