foundryvtt / foundryvtt

Public issue tracking and documentation for Foundry Virtual Tabletop - software connecting RPG gamers in a shared multiplayer environment with an intuitive interface and powerful API.
https://foundryvtt.com/
241 stars 9 forks source link

Documentation about modules that depend on a system #4072

Closed aaclayton closed 3 years ago

aaclayton commented 4 years ago

Originally in GitLab by @akrigline

The documentation for module.json says the following:

system

A system ID or array of system IDs which are required in order to use this module. For example, specifying "system": "dnd5e" will only allow the module to be used by Worlds which are running the dnd5e game system.

This does not seem to be the case. The actual field on the manifest is systems which can be either array or string.

Additionally, there is an undocumented minimumSystemVersion attribute which seems to be at least partially useful for this exact use case. While it does not prevent a user from updating if their installed system version doesn't match, it at least prevents the user from activating the module.

Here are the combinations of json attributes I tested in an effort to find a combination that would prevent a user from using a module which broke in versions of the dnd5e system prior to 0.99.

The environment:

  • Foundry Core: 0.7.6 electron version
  • World System: Simple Worldbuilding 0.4
  • Module: 5e-ogl-character-sheet

To test, I had to close foundry between changes, otherwise my changes didn't seem to take.

Case 0: Control

// absolutely nothing!

Result: Module can be activated


Case 1: Maximum Precaution

  "dependencies": [
    {
      "name": "dnd5e",
      "type": "system",
      "version": 0.99
    }
  ],
  "minimumSystemVersion": 0.99,
  "system": ["dnd5e"],

Result: Module can not be activated. :heavy_check_mark:


Case 2: dependency and system

  "dependencies": [
    {
      "name": "dnd5e",
      "type": "system",
      "version": 0.99
    }
  ],
  "system": ["dnd5e"],

Result: Module can be activated. :warning:


Case 3: Only the minimumSystemVersion and system

  "system": ["dnd5e"],
  "minimumSystemVersion": 0.99,

Result: Module can not be activated. :heavy_check_mark:


Case 4: Only system

  "system": ["dnd5e"]

Result: Module can be activated. :warning:


Case 5: System but as a string

  "system": "dnd5e"

Result: Module can be activated. :warning:


Case 6: systems as array

  "systems": ["dnd5e"]

Result: Module can not be activated. :heavy_check_mark:


Case 7: systems as string

  "systems": "dnd5e"

Result: Module can not be activated. :heavy_check_mark:

aaclayton commented 3 years ago

Sorry, this issue seems to have gotten lost without being handled. I'll add it to %"Version 8 - Maintenance 3" to make sure we iron out what the docs should have.

aaclayton commented 3 years ago

Originally in GitLab by @joseph.spandrusyszyn

It appears as though the documentation has since been updated as requested by Calego, and says that the key is systems... however, it now appears (at least in 0.8.7) that Foundry is expected the key to be system.


"system": ["dnd5e"]

or

"system": "dnd5e"

Documentation says this shouldn't do anything, but including either of these in module.json prevents the module from being activated if the system is not dnd5e.


"systems": ["dnd5e"]

Documentation says this should prevent the module from being activated if the system is not dnd5e, but it doesn't.


"systems": "dnd5e"

Documentation says systems is supposed to be an array, so this shouldn't (and doesn't) do anything.

aaclayton commented 4 years ago

Thanks, we'll get the docs updated for this.