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

[REQ] Dependencies in [mod].json #284

Closed
Powback opened this issue Feb 7, 2018 · 2 comments
Closed

[REQ] Dependencies in [mod].json #284

Powback opened this issue Feb 7, 2018 · 2 comments

Comments

@Powback
Copy link

Powback commented Feb 7, 2018

Some mods requires other mods to work.
Instead of having to manually enter all the mods into modlist.txt, there should be a possibility of loading the mods listed in the dependencies section of [mod].json

Example:

{
	"Name": "SomeMod",
	"Authors": ["SomeGuy"],
	"Description": "DoesSomething",
	"Dependencies":["Mod1","Mod2"],
	"URL": "none",
	"Version": 0,
	"HasWebUI": false,
	"HasVeniceEXT": true
}

In addition to that, VEXT should check if said mod exists, and if it doesn't it should print a message saying that [mod] tried to load [OtherMod] which doesn't exist.
(This also applies to mods in modlist.txt)

If the mod is listed multiple times, it should obviously only be loaded once.

Mods that could be used as dependencies:

  • VEManager
  • BundleManager (Which loads bundles and adds the entries to the correct registry)
  • ObjectManager (Which handles object spawning and client synchronization)
  • AudioManager
  • MessageManager
  • SomeModThatsNotAManager

This will also act as a replacement for my original "Global Mods" idea, referenced at #230 , albeit with a different purpose.

@Powback Powback changed the title [REQ] Requirements in [mod].json [REQ] Dependencies in [mod].json Aug 7, 2018
@OrfeasZ OrfeasZ added this to the 1.0 Release milestone Aug 13, 2018
@3ti65
Copy link

3ti65 commented Aug 20, 2018

Please make the dependencies an array of objects that contain both name and version of the mod thats being depended upon.

@OrfeasZ
Copy link
Contributor

OrfeasZ commented Aug 26, 2018

Build 13489 adds support for declaring mod dependencies and enforces semver for all mod versions. Any mods that are unable to meet their dependency requirements will fail to load. Any circular dependencies will prevent all mods from loading.

Dependencies are declared in the mod.json file as follows:

{
	"Name": "My Great Mod",
	"Version": "1.0.0",
	"Dependencies": {
		"mod1": "1.1.0", // Requires exactly version 1.1.0.
		"mod2": ">2.0.0", // Requires a version later than 2.0.0.
		"mod3": "~1.2.3", // Requires a version with the same major and minor components, and with an equal or greater patch component (>= 1.2.3, < 1.3.0).
		"mod4": "^1.2.3", // Requires a version with the same major component, and with an equal or greater minor or patch component (>= 1.2.3, < 2.0.0)
	},
	...
}

The following operands are supported: =, >, <, >=, <=, ^, ~. Specifying no operand is the equivalent of specifying =. The provided dependency key should match the folder where the mod is installed in.

@OrfeasZ OrfeasZ closed this as completed Aug 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants