Pawper Posted June 30, 2020 Share Posted June 30, 2020 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 fileconst 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/residentevilbiohazardhdremasterconst 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 More sharing options...
Pickysaurus Posted June 30, 2020 Share Posted June 30, 2020 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: 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.