Jump to content

Extension fails to enable (made for Resident Evil remaster)


Pawper

Recommended Posts

Hi,

 

Had a go at creating an extension for the Resident Evil remaster. Unfortunately, it's failing to enable. I was following https://wiki.nexusmods.com/index.php/Creating_a_game_extension_for_Vortex

 

If you could please provide any insight, I would appreciate it! I'm not super experienced with Javascript (yet).

 

{
"name": "Game: Resident Evil biohazard HD REMASTER",
"author": "Pawper",
"version": "0.0.1",
"description": "Support for Resident Evil biohazard HD REMASTER"
}

 

 

//Add this to the top of the file
const winapi = require('winapi-bindings');

function findGame() {
try {
const instPath = winapi.RegGetValue(
'HKEY_LOCAL_MACHINE',
'SOFTWARE\\WOW6432Node\\GOG.com\\Games\\' + GOGAPP_ID,
'PATH');
if (!instPath) {
throw new Error('empty registry key');
}
return Promise.resolve(instPath.value);
} catch (err) {
return util.GameStoreHelper.findByAppId([STEAMAPP_ID, GOGAPP_ID])
.then(game => game.gamePath);
}
}

// Nexus Mods domain for the game. e.g. nexusmods.com/residentevilbiohazardhdremaster
const GAME_ID = 'residentevilbiohazardhdremaster';

//Steam Application ID, you can get this from https://steamdb.info/apps/
const STEAMAPP_ID = '304240';

//Import some assets from Vortex we'll need.
const path = require('path');
const { fs, log, util } = require('vortex-api');

function main(context) {
//This is the main function Vortex will run when detecting the game extension.
context.registerGame({
id: GAME_ID,
name: 'Resident Evil biohazard HD REMASTER',
mergeMods: true,
queryPath: findGame,
queryModPath: () => '.',
logo: 'gameart.jpg',
executable: () => 'bhd.exe',
requiredFiles: [
'bhd.exe'
],
setup: prepareForModding,
environment: {
SteamAPPId: STEAMAPP_ID,
},
details: {
steamAppId: STEAMAPP_ID,
gogAppId: GOGAPP_ID,
},
});

return true
}

module.exports = {
default: main,
};

 

Link to comment
Share on other sites

Hey,

 

It's not a bad first effort, so here's a tip.

 

If your extension fails to load, you can go to extensions tab to find out why. With the current code it looks like this:

anzeBfo.png

 

 

While you can't see the entire message. It's saying "prepareForModding" is not a function. Which is correct.

 

So you need to do the following:

  • Remove the line "setup: prepareForModding," as you have not set a prepareForModding function.
  • Remove the line "gogAppId: GOGAPP_ID," as you have not set a GOG App ID.

 

After that, the extension should load.

 

Hope this helps.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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