Jump to content

Vortex symkink not pointing to the right folder


ZJohnAsZ

Recommended Posts

When you have the Unofficial Patch installed and try to use the Vortex App to install mods, it won't deploy the mods to the right folder and I couldn't find a way to change it in vortex.

Usually, it would work with most games, but in the case of Bloodlines, when you tell Vortex where your "...\VtMB" folder is, the App takes in consideration that it has to Install mods in "...\VtMB\Vampire" folder. When you have the Unofficial Patch installed, the mods have to be put in "...\VtMB\Unofficial_Patch".

I found this that could probably help in fixing the issue, but since I am not a coder, I'm not sure what to exactly change.

...\Program Files\Black Tree Gaming Ltd\Vortex\resources\app.asar.unpacked\bundledPlugins\game-vtmbloodlines\info.json

const Promise = require('bluebird');
const path = require('path');
const winapi = require('winapi-bindings');
const { fs, util } = require('vortex-api');

const GAME_ID = 'vampirebloodlines';
const STEAM_ID = 2600;
const GOG_ID = 1207659240;

function readRegistryKey(hive, key, name) {
  try {
    const instPath = winapi.RegGetValue(hive, key, name);
    if (!instPath) {
      throw new Error('empty registry key');
    }
    return Promise.resolve(instPath.value);
  } catch (err) {
    return Promise.resolve(undefined);
  }
}

function requiresLauncher(gamePath) {
  // VtM Bloodlines does not seem to have any steam specific files within
  //  the game's discovery path... Attempt to launch via Steam if
  //  we're able to retrieve the game's information via the Steam wrapper
  return util.steam.findByAppId(STEAM_ID.toString())
    .then(game => Promise.resolve({ launcher: 'steam' }))
    .catch(err => Promise.resolve(undefined));
}

function findGame() {
  return util.steam.findByAppId(STEAM_ID.toString())
    .then(game => game.gamePath)
    .catch(() => readRegistryKey('HKEY_LOCAL_MACHINE',
      `SOFTWARE\\WOW6432Node\\GOG.com\\Games\\${GOG_ID}`,
      'PATH'))
    .catch(() => readRegistryKey('HKEY_LOCAL_MACHINE',
      `SOFTWARE\\GOG.com\\Games\\${GOG_ID}`,
      'PATH'))
}

function prepareForModding(discovery) {
  return fs.ensureDirWritableAsync(path.join(discovery.path, 'Vampire'), () => Promise.resolve());
}

function getUnofficialModPath() {
  const state = _API.store.getState();
  const discovery = util.getSafe(state, ['settings', 'gameMode', 'discovered', GAME_ID], undefined);
  return path.join(discovery.path, 'Unofficial_Patch');
}

function isUPModType(instructions) {
  return fs.statAsync(getUnofficialModPath())
    .then(() => Promise.resolve(true))
    .catch(() => Promise.resolve(false));
}

function main(context) {
  _API = context.api;
  context.registerGame({
    id: GAME_ID,
    name: 'Vampire the Masquerade\tBloodlines',
    logo: 'gameart.jpg',
    mergeMods: true,
    queryPath: findGame,
    requiresLauncher,
    queryModPath: () => 'Vampire',
    executable: () => 'Vampire.exe',
    requiredFiles: [],
    environment: {
      SteamAPPId: STEAM_ID.toString(),
    },
    details: {
      steamAppId: STEAM_ID,
    },
    setup: prepareForModding,
  });

  // The "unofficial patch" mod modifies the mods folder. GoG seems to include
  //  this by default ?
  context.registerModType('vtmb-up-modtype', 25,
    (gameId) => gameId === GAME_ID, () => getUnofficialModPath(),
    (instructions) => isUPModType(instructions));
}

module.exports = {
  default: main
};

Could I fix the issue by editing this file?

 

Edited by ZJohnAsZ
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...