Jump to content

Photo

Extension fails to enable (made for Resident Evil remaster)


  • Please log in to reply
1 reply to this topic

#1
SykoSilver

SykoSilver

    Regular

  • Members
  • PipPip
  • 73 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.nexusmo...sion_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_IDGOGAPP_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 { fslogutil } = 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,
  };

 



#2
Pickysaurus

Pickysaurus

    Community Manager

  • Admin
  • 12,319 posts

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. 






Page loaded in: 0.877 seconds