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

Verify Extension: [845] Helldivers 2 Vortex Extension #15504

Closed
9 of 15 tasks
insomnious opened this issue Apr 9, 2024 · 6 comments
Closed
9 of 15 tasks

Verify Extension: [845] Helldivers 2 Vortex Extension #15504

insomnious opened this issue Apr 9, 2024 · 6 comments

Comments

@insomnious
Copy link
Contributor

insomnious commented Apr 9, 2024

Verify Extension: Helldivers 2 Vortex Extension

Use this template to verify game extensions for Vortex ​

Extension Information

Get all relevant metadata and links from nexusmods.com

Extension Name Helldivers 2 Vortex Extension
Extension Mod ID 845
Extension URL https://www.nexusmods.com/site/mods/845
Game Name Helldivers 2
Game Domain helldivers2
Game URL https://www.nexusmods.com/helldivers2

Check to see if there is an existing extension for this game

Existing Extension URL

Verification checklist

  • If there is an existing extension for this game, is this functionally better?
  • Is the extension named correctly?
  • Is it packaged correctly?
  • Is artwork correct?
  • Is the changelog accurate?
  • Does it install into Vortex?
  • Does it correctly discover the game?
  • Does it successfully install a mod?
  • Does it successfully install a collection?
  • Does the game run correctly with the mods installed? ​

Adding extension to manifest

​ When complete, the verified extension needs adding to our manifest.

  • GitHub Action run
  • Manifest file manually checked for errors
  • Contacted author
  • Asked Community to enable Vortex for the game
  • Discord #vortex-announcements updated.
@IDCs
Copy link
Contributor

IDCs commented Apr 16, 2024

Although the extension defines a couple of modTypes to support the game's different modding patterns; it does not include modType tests to correctly identify these mods. A custom installer will also be needed to cater for some mod packaging patterns.

To unblock:

  • Add appropriate modType tests for each pattern (e.g. if it contains a file with the .dl_bin extension - that should be sufficient to assign the helldivers2-data modType)
  • The mods are packaged hectically in some cases and will require a custom installer to be written to install those correctly.

@ChemGuy1611
Copy link

ChemGuy1611 commented Apr 16, 2024

Could you help me out with how to code to automatically assign modType in mod installers? I understand how to get the installer to see the .dl_bin to check if the mod is supported for the installer, but I am not certain how to assign the modType to it at that point.

Here's what I have:

const modFileExt = ".dl_bin";

function testSupportedContent(files, gameId) {
  // Make sure we're able to support this mod.
  let supported = (gameId === spec.game.id) &&
      (files.find(file => path.extname(file).toLowerCase() === modFileExt) !== undefined);

  // Test for a mod installer.
  if (supported && files.find(file =>
          (path.basename(file).toLowerCase() === 'moduleconfig.xml') &&
          (path.basename(path.dirname(file)).toLowerCase() === 'fomod'))) {
      supported = false;
  }

  return Promise.resolve({
      supported,
      requiredFiles: [],
  });
}

function installContent(files) {
  // The .fbmod file is expected to always be positioned in the mods directory we're going to disregard anything placed outside the root.
  const modFile = files.find(file => path.extname(file).toLowerCase() === modFileExt);
  const idx = modFile.indexOf(path.basename(modFile));
  const rootPath = path.dirname(modFile);

  // Remove directories and anything that isn't in the rootPath.
  const filtered = files.filter(file =>
      ((file.indexOf(rootPath) !== -1) &&
          (!file.endsWith(path.sep))));

  const instructions = filtered.map(file => {
      return {
          type: 'copy',
          source: file,
          destination: path.join(file.substr(idx)),
      };
  });
  return Promise.resolve({ instructions });
}


//In the main function:

context.registerInstaller('helldivers2-dlbin', 25, testSupportedContent, installContent);

@IDCs
Copy link
Contributor

IDCs commented Apr 17, 2024

Certainly - you can create an additional instruction in the installer like so:
const setModTypeInstruction = { type: 'setmodtype', value: MODTYPE_ID }

Then just add the new instruction to the instructions array before returning the promise.
instructions.push(setModTypeInstruction);

@ChemGuy1611
Copy link

Got it! Updated the mod to Nexus.

@IDCs
Copy link
Contributor

IDCs commented Apr 22, 2024

Hi again - I didn't get to test your extension yet as I can already see that the installer hasn't been tested.

function installContent(files, gameSpec) {
  <...>
  MODTYPE_ID = "helldivers2-data"; // You're missing the variable declaration!
  const setModTypeInstruction = { type: 'setmodtype', value: MODTYPE_ID };
  <...>
  instructions.push(setModTypeInstruction);
  return Promise.resolve({ instructions });
}

// declare your variable before using it:
// const/var/let MODTYPE_ID

@ChemGuy1611
Copy link

Fixed and uploaded to Nexus. Just a note that I did test the code and it did work. But yes, I did add the proper declaration.

@ChemGuy1611 ChemGuy1611 mentioned this issue May 10, 2024
14 tasks
@IDCs IDCs closed this as completed May 30, 2024
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