Skip to content

Conversation

@shriakhilc
Copy link
Contributor

Summary of changes:

  • Temp actors are created in a dedicated temp folder in Foundry v13 and above.
  • Temp actors are only deleted if user has the permission.
  • Custom error message when failing to create a Folder.
  • Setting to automatically create required Folders. Defaults to false.

Links to #55


Current Behavior

In Foundry v12, users with the "Create Actors" permission (ACTOR_CREATE) are also able to delete actors. The module is able to create and delete multiple temp actors while loading the character details, before finally assigning the data to the original actor.

In case of a non-GM user importing a character with a familiar, that step fails with an error because they cannot create the "Familiars" folder.

In Foundry v13, only GM level users can delete actors. This leads to the import failing with an error when the module attempts to delete the first temp actor. The folder creation limitation remains the same.

New Behavior

In Foundry v12, there are no changes to the temp actor naming or location. They continue to get created at the root level and are deleted automatically. A new custom error message is shown when a non-GM user fails to create the "Familiars" folder. This message informs the user to either manually create the folder or enable the setting.

A new setting is added that toggles automatic creation of the required folders. This is only the "Familiars" folder in v12. A hook is used to create this folder whenever a GM level user logs in and the setting is enabled. As long as the folder exists, a non-GM user will not receive any error during import.

In Foundry v13, the setting also creates a second folder named "PathmuncherTemp". This location is used for all temp actors, and the actors are only deleted if the user has permission to do so. A number gets appended to the temp actor name (ex: "Mr Temp (LeafDruid) 0014") to help distinguish the stages. This might not be strictly necessary as the import process relies on ID and Foundry will allow duplicate actor names.

The setting is disabled by default to avoid introducing new folders to existing worlds where sheets are already set up.


I'm not familiar with the conventions around Foundry modules, so please let me know if creating folders in this way is alright. The main change will still work well without the setting and hook as long as GMs create those folders first.

- Temp actors are created in a dedicated temp folder.
- Temp actors are only deleted if user has the permission.
- Setting to automatically create required Folders. Defaults to false.
- Custom error message when failing to create a Folder.
@MrPrimate
Copy link
Owner

Sorry for the delay in reviewing this, I hope to get around to it in the next couple of days.

@MrPrimate MrPrimate merged commit b8ca8ae into MrPrimate:main Nov 14, 2025
1 check passed
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.

2 participants