Skip to content
Beta: this is a preview of the new SplitScreen.Me. Data may be reset before launch.

Stranger of Paradise: Final Fantasy Origin · handler “Stranger of paradise final fantasy origin”

Version 2

Release notes

fix typo

Released
Size
3.1 KB
Downloads
1
Check
Unverified
SHA-256
03cf41655d186144416ff8a370ade63670073d09d5387feed2dda330bfa08062
Download v2 (.nc)All versions

Files 1

PathSize
handler.js17 KB

handler.js

Plain text
Hub.Handler.Version = 2; // Released at https://hub.splitscreen.me/ on Sat Apr 23 2022 15:35:30 GMT+0000 (Coordinated Universal Time).
Hub.Handler.Id = "PXjfPSTkww4XNw3yH";
Hub.Maintainer.Name = "gotenks";
Hub.Maintainer.Id = "PKW8fDRgHFm6aPaYH";

var answers0 = ["yes", "no"];
var answers1 = ["no", "very low", "low", "medium", "high", "max"];
var answers2 = ["no", "30", "60", "120"];
var answers3 = ["no", "50", "60", "70", "80", "90", "100"];
var answers4 = ["no", "low", "medium", "high"];
Game.AddOption("Apply aspect ratio fix?", "Matches resolution to window size to fix stretching,", "Fix", answers0);
Game.AddOption("Change graphics settings?", "Can improve performance at the cost of visual quality.", "preset", answers1);
Game.AddOption("Set a framerate(fps) limit?", "Can improve performance at the cost of responsiveness.", "fps", answers2);
Game.AddOption("Change the resolution scale?", "Can improve performance at the cost of visual clarity.", "resscale", answers3);
Game.AddOption("Change the texture quality?", "Reduce the gpu's Vram usage, if the game stutters too much set this to low.", "texture", answers4);

Game.ExecutableContext = ["commontexture"];
Game.KillMutex = ["FF_ORIGIN_MUTEX"];
Game.FileSymlinkExclusions = ["EOSSDK-Win64-Shipping.dll", "xinput1_3.dll", "SOPFFO.exe"];
Game.Description =
  "tested with the lastest version of the game from epic store(1.03) - this game is very heavy on the cpu and the vram, low your settings and limit your fps to 30 for better performance, low texture is recommended,the first time you launch the game make sure to get to the title screen before the windows resize, otherwise you will have to start it again, to connect the instances you have to finish the tutorial, play until you are in the world map, press start then go to the online menu with rb, select create a room and join on the other intances.";
Game.GameName = "STRANGER OF PARADISE FINAL FANTASY ORIGIN";
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.SymlinkFolders = true;
Game.SupportsKeyboard = false;
Game.ExecutableName = "SOPFFO.exe";
Game.GUID = "STRANGER OF PARADISE FINAL FANTASY ORIGIN";
Game.MaxPlayers = 3;
Game.MaxPlayersOneMonitor = 4;
Game.UseGoldberg = false;
Game.UseNemirtingasEpicEmu = true;
Game.EpicEmuArgs = true;
Game.LauncherTitle = "";
Game.UserProfileSavePath = "Documents\\My Games\\STRANGER OF PARADISE FINAL FANTASY ORIGIN\\EOS";
Game.UserProfileConfigPath = "Documents\\My Games\\STRANGER OF PARADISE FINAL FANTASY ORIGIN\\EOS";
Game.HideTaskbar = false;
Game.Hook.ForceFocus = true;
Game.Hook.ForceFocusWindowName = "STRANGER OF PARADISE FINAL FANTASY ORIGIN";
Game.HasDynamicWindowTitle = false;
Game.FakeFocus = true;
Game.FakeFocusInterval = 5000;
Game.SendFakeFocusMsg = true;
Game.HookFocus = true;
Game.ResetWindows = true;
Game.HookInit = false;
Game.Hook.DInputEnabled = false;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.Hook.CustomDllEnabled = false;
Game.XInputPlusDll = ["xinput1_3.dll"];
Game.Description = "";
Game.PauseBetweenProcessGrab = 15;
Game.PauseBetweenStarts = 40;

//ProtoInput:

Game.SupportsMultipleKeyboardsAndMice = false;

Game.ProtoInput.InjectStartup = true;
Game.ProtoInput.InjectRuntime_RemoteLoadMethod = false;
Game.ProtoInput.InjectRuntime_EasyHookMethod = true;
Game.ProtoInput.InjectRuntime_EasyHookStealthMethod = false;

Game.LockInputAtStart = false;
Game.LockInputSuspendsExplorer = false;
Game.ProtoInput.FreezeExternalInputWhenInputNotLocked = false;
Game.LockInputToggleKey = 0x23;
Game.ProtoInput.FindWindowHook = true;

Game.Play = function() {
  var PlayerNumber = Context.Nickname;
  var epicid = "0000000000000000000000000";

  var path = Context.NucleusUserRoot + "\\Documents\\My Games\\STRANGER OF PARADISE FINAL FANTASY ORIGIN\\EOS\\" + epicid + PlayerNumber + "\\config.xml";

  if (!System.IO.File.Exists(path)) {
    var dir = Context.NucleusUserRoot + "\\Documents\\My Games\\STRANGER OF PARADISE FINAL FANTASY ORIGIN\\EOS\\" + epicid + PlayerNumber;
    System.IO.Directory.CreateDirectory(dir);
    var lines = [
      '<?xml version="1.0" encoding="UTF-8"?>',
      "<settings>",
      "<CONFIG_TYPE>CUSTOM</CONFIG_TYPE>",
      "<FPS>30</FPS>",
      "<DISP_MODE>WINDOW</DISP_MODE>",
      "<SCR_REZ>1920x1080</SCR_REZ>",
      "<VSYNC>ON</VSYNC>",
      "<REN_REZ>70%</REN_REZ>",
      "<ANTI_ALIAS>OFF</ANTI_ALIAS>",
      "<SHADOW_QUAL>LOW</SHADOW_QUAL>",
      "<SHADOW_DIST>SHORT</SHADOW_DIST>",
      "<DYNAMIC_FRAME>OFF</DYNAMIC_FRAME>",
      "<TEXTURE_QUAL>LOW</TEXTURE_QUAL>",
      "<RT_REF>OFF</RT_REF>",
      "<AO>ON</AO>",
      "<MOT_BLUR>ON</MOT_BLUR>",
      "<CHROMA_ABERRATION>ON</CHROMA_ABERRATION>",
      "<VRAM_MONITOR>OFF</VRAM_MONITOR>",
      "</settings>"
    ];
    Context.WriteTextFile(path, lines);
  }

  var jsonPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NemirtingasEpicEmu.json";
  var params = [
    "{",
    '  "disable_online_networking": false,',
    '  "enable_lan": true,',
    '  "enable_overlay": true,',
    '  "language": ' + '"' + Context.EpicLang + '"' + ",",
    '  "username": ' + '"' + Context.Nickname + '"',
    "}"
  ];
  Context.WriteTextFile(jsonPath, params);

  var fix = Context.Options["Fix"];
  var preset = Context.Options["preset"];
  var fps = Context.Options["fps"];
  var resscale = Context.Options["resscale"];
  var texture = Context.Options["texture"];

  switch (resscale) {
    case "no":
      break;
    case "50":
      Context.ChangeXmlNodeInnerTextValue(path, "//REN_REZ", "50%");
      break;
    case "60":
      Context.ChangeXmlNodeInnerTextValue(path, "//REN_REZ", "60%");
      break;
    case "70":
      Context.ChangeXmlNodeInnerTextValue(path, "//REN_REZ", "70%");
      break;
    case "80":
      Context.ChangeXmlNodeInnerTextValue(path, "//REN_REZ", "80%");
      break;
    case "90":
      Context.ChangeXmlNodeInnerTextValue(path, "//REN_REZ", "90%");
      break;
    case "100":
      Context.ChangeXmlNodeInnerTextValue(path, "//REN_REZ", "100%");
      break;
  }

  if (fix == "yes") {
    var screenreswidth = Context.Width;
    var screenresheight = Context.Height;

    if (screenresheight == 540 && screenreswidth == 1920) {
      //1080p Horizontal

      Context.ChangeXmlNodeInnerTextValue(path, "//DISP_MODE", "WINDOW");
      Context.ChangeXmlNodeInnerTextValue(path, "//SCR_REZ", "3440x1440");
      //patch 3440x1440 res 70 0D 00 00 A0 05

      Context.PatchFileFindAll(
        System.IO.Path.Combine(Context.RootInstallFolder, "SOPFFO.exe"),
        System.IO.Path.Combine(Context.RootFolder, "SOPFFO.exe"),
        [0x70, 0x0d, 0x00, 0x00, 0xa0, 0x05],
        [0x80, 0x07, 0x00, 0x00, 0x1c, 0x02]
      );
    } else if (screenresheight == 1080 && screenreswidth == 960) {
      //1080p vertical

      Context.ChangeXmlNodeInnerTextValue(path, "//DISP_MODE", "WINDOW");
      Context.ChangeXmlNodeInnerTextValue(path, "//SCR_REZ", "3440x1440");
      Context.ChangeXmlNodeInnerTextValue(path, "//REN_REZ", "100%");

      Context.PatchFileFindAll(
        System.IO.Path.Combine(Context.RootInstallFolder, "SOPFFO.exe"),
        System.IO.Path.Combine(Context.RootFolder, "SOPFFO.exe"),
        [0x70, 0x0d, 0x00, 0x00, 0xa0, 0x05],
        [0xc0, 0x03, 0x00, 0x00, 0x38, 0x04]
      );
    } else if (screenresheight == 540 && screenreswidth == 960) {
      //1080p 1/4

      Context.ChangeXmlNodeInnerTextValue(path, "//DISP_MODE", "WINDOW");
      Context.ChangeXmlNodeInnerTextValue(path, "//SCR_REZ", "3440x1440");
      Context.ChangeXmlNodeInnerTextValue(path, "//REN_REZ", "100%");

      Context.PatchFileFindAll(
        System.IO.Path.Combine(Context.RootInstallFolder, "SOPFFO.exe"),
        System.IO.Path.Combine(Context.RootFolder, "SOPFFO.exe"),
        [0x70, 0x0d, 0x00, 0x00, 0xa0, 0x05],
        [0xc0, 0x03, 0x00, 0x00, 0x1c, 0x02]
      );
    } else if (screenreswidth == 1280 && screenresheight == 360) {
      //720p horizontal
      Context.ChangeXmlNodeInnerTextValue(path, "//DISP_MODE", "WINDOW");
      Context.ChangeXmlNodeInnerTextValue(path, "//SCR_REZ", "3440x1440");
      Context.ChangeXmlNodeInnerTextValue(path, "//REN_REZ", "100%");
      Context.PatchFileFindAll(
        System.IO.Path.Combine(Context.RootInstallFolder, "SOPFFO.exe"),
        System.IO.Path.Combine(Context.RootFolder, "SOPFFO.exe"),
        [0x70, 0x0d, 0x00, 0x00, 0xa0, 0x05],
        [0x00, 0x05, 0x00, 0x00, 0x68, 0x01]
      );
    } else if (screenreswidth == 640 && screenresheight == 720) {
      //720p vertical
      Context.ChangeXmlNodeInnerTextValue(path, "//DISP_MODE", "WINDOW");
      Context.ChangeXmlNodeInnerTextValue(path, "//SCR_REZ", "3440x1440");
      Context.ChangeXmlNodeInnerTextValue(path, "//REN_REZ", "100%");
      Context.PatchFileFindAll(
        System.IO.Path.Combine(Context.RootInstallFolder, "SOPFFO.exe"),
        System.IO.Path.Combine(Context.RootFolder, "SOPFFO.exe"),
        [0x70, 0x0d, 0x00, 0x00, 0xa0, 0x05],
        [0x80, 0x02, 0x00, 0x00, 0xd0, 0x02]
      );
    } else if (screenreswidth == 640 && screenresheight == 360) {
      //720p 1/4
      Context.ChangeXmlNodeInnerTextValue(path, "//DISP_MODE", "WINDOW");
      Context.ChangeXmlNodeInnerTextValue(path, "//SCR_REZ", "3440x1440");
      Context.ChangeXmlNodeInnerTextValue(path, "//REN_REZ", "100%");
      Context.PatchFileFindAll(
        System.IO.Path.Combine(Context.RootInstallFolder, "SOPFFO.exe"),
        System.IO.Path.Combine(Context.RootFolder, "SOPFFO.exe"),
        [0x70, 0x0d, 0x00, 0x00, 0xa0, 0x05],
        [0x80, 0x02, 0x00, 0x00, 0x68, 0x01]
      );
    } else if (screenreswidth == 2560 && screenresheight == 720) {
      //1440p horizontal
      Context.ChangeXmlNodeInnerTextValue(path, "//DISP_MODE", "WINDOW");
      Context.ChangeXmlNodeInnerTextValue(path, "//SCR_REZ", "3440x1440");
      Context.ChangeXmlNodeInnerTextValue(path, "//REN_REZ", "100%");
      Context.PatchFileFindAll(
        System.IO.Path.Combine(Context.RootInstallFolder, "SOPFFO.exe"),
        System.IO.Path.Combine(Context.RootFolder, "SOPFFO.exe"),
        [0x70, 0x0d, 0x00, 0x00, 0xa0, 0x05],
        [0x00, 0x0a, 0x00, 0x00, 0xd0, 0x02]
      );
    } else if (screenreswidth == 1280 && screenresheight == 1440) {
      //1440p vertical

      Context.ChangeXmlNodeInnerTextValue(path, "//DISP_MODE", "WINDOW");
      Context.ChangeXmlNodeInnerTextValue(path, "//SCR_REZ", "3440x1440");
      Context.ChangeXmlNodeInnerTextValue(path, "//REN_REZ", "100%");
      Context.PatchFileFindAll(
        System.IO.Path.Combine(Context.RootInstallFolder, "SOPFFO.exe"),
        System.IO.Path.Combine(Context.RootFolder, "SOPFFO.exe"),
        [0x70, 0x0d, 0x00, 0x00, 0xa0, 0x05],
        [0x00, 0x05, 0x00, 0x00, 0xa0, 0x05]
      );
    } else if (screenresheight == 1280 && screenreswidth == 720) {
      //1440p 1/4

      Context.ChangeXmlNodeInnerTextValue(path, "//DISP_MODE", "WINDOW");
      Context.ChangeXmlNodeInnerTextValue(path, "//SCR_REZ", "1280x720");
      Game.KeepAspectRatio = true;
      System.IO.File.Copy(System.IO.Path.Combine(Context.RootInstallFolder, "SOPFFO.exe"), System.IO.Path.Combine(Context.RootFolder, "SOPFFO.exe"), true);
    } else if (screenresheight == 2160 && screenreswidth == 1920) {
      //4k vertical

      Context.ChangeXmlNodeInnerTextValue(path, "//DISP_MODE", "WINDOW");
      Context.ChangeXmlNodeInnerTextValue(path, "//SCR_REZ", "3440x1440");
      Context.ChangeXmlNodeInnerTextValue(path, "//REN_REZ", "100%");
      Context.PatchFileFindAll(
        System.IO.Path.Combine(Context.RootInstallFolder, "SOPFFO.exe"),
        System.IO.Path.Combine(Context.RootFolder, "SOPFFO.exe"),
        [0x70, 0x0d, 0x00, 0x00, 0xa0, 0x05],
        [0x80, 0x07, 0x00, 0x00, 0x70, 0x08]
      );
    } else if (screenresheight == 1080 && screenreswidth == 3840) {
      //4k Horizontal

      Context.ChangeXmlNodeInnerTextValue(path, "//DISP_MODE", "WINDOW");
      Context.ChangeXmlNodeInnerTextValue(path, "//SCR_REZ", "3440x1440");

      //patch 3440x1440 res 70 0D 00 00 A0 05

      Context.PatchFileFindAll(
        System.IO.Path.Combine(Context.RootInstallFolder, "SOPFFO.exe"),
        System.IO.Path.Combine(Context.RootFolder, "SOPFFO.exe"),
        [0x70, 0x0d, 0x00, 0x00, 0xa0, 0x05],
        [0x00, 0x0f, 0x00, 0x00, 0x38, 0x04]
      );
    } else {
      System.IO.File.Copy(System.IO.Path.Combine(Context.RootInstallFolder, "SOPFFO.exe"), System.IO.Path.Combine(Context.RootFolder, "SOPFFO.exe"), true);
      Context.ChangeXmlNodeInnerTextValue(path, "//DISP_MODE", "WINDOW");
      Context.ChangeXmlNodeInnerTextValue(path, "//SCR_REZ", "1920x1080");
    }
  } else {
    Game.KeepAspectRatio = true;
    System.IO.File.Copy(System.IO.Path.Combine(Context.RootInstallFolder, "SOPFFO.exe"), System.IO.Path.Combine(Context.RootFolder, "SOPFFO.exe"), true);
  }

  switch (preset) {
    case "no":
      break;
    case "very low":
      Context.ChangeXmlNodeInnerTextValue(path, "//CONFIG_TYPE", "CUSTOM");
      Context.ChangeXmlNodeInnerTextValue(path, "//ANTI_ALIAS", "OFF");
      Context.ChangeXmlNodeInnerTextValue(path, "//SHADOW_QUAL", "NONE");
      Context.ChangeXmlNodeInnerTextValue(path, "//SHADOW_DIST", "SHORT");
      Context.ChangeXmlNodeInnerTextValue(path, "//RT_REF", "OFF");
      Context.ChangeXmlNodeInnerTextValue(path, "//AO", "OFF");
      Context.ChangeXmlNodeInnerTextValue(path, "//MOT_BLUR", "OFF");
      Context.ChangeXmlNodeInnerTextValue(path, "//CHROMA_ABERRATION", "OFF");
      break;
    case "low":
      Context.ChangeXmlNodeInnerTextValue(path, "//CONFIG_TYPE", "CUSTOM");
      Context.ChangeXmlNodeInnerTextValue(path, "//ANTI_ALIAS", "ON");
      Context.ChangeXmlNodeInnerTextValue(path, "//SHADOW_QUAL", "LOW");
      Context.ChangeXmlNodeInnerTextValue(path, "//SHADOW_DIST", "SHORT");
      Context.ChangeXmlNodeInnerTextValue(path, "//RT_REF", "OFF");
      Context.ChangeXmlNodeInnerTextValue(path, "//AO", "OFF");
      Context.ChangeXmlNodeInnerTextValue(path, "//MOT_BLUR", "OFF");
      Context.ChangeXmlNodeInnerTextValue(path, "//CHROMA_ABERRATION", "OFF");
      break;
    case "medium":
      Context.ChangeXmlNodeInnerTextValue(path, "//CONFIG_TYPE", "CUSTOM");
      Context.ChangeXmlNodeInnerTextValue(path, "//ANTI_ALIAS", "ON");
      Context.ChangeXmlNodeInnerTextValue(path, "//SHADOW_QUAL", "LOW");
      Context.ChangeXmlNodeInnerTextValue(path, "//SHADOW_DIST", "SHORT");
      Context.ChangeXmlNodeInnerTextValue(path, "//RT_REF", "OFF");
      Context.ChangeXmlNodeInnerTextValue(path, "//AO", "OFF");
      Context.ChangeXmlNodeInnerTextValue(path, "//MOT_BLUR", "OFF");
      Context.ChangeXmlNodeInnerTextValue(path, "//CHROMA_ABERRATION", "ON");
      break;
    case "high":
      Context.ChangeXmlNodeInnerTextValue(path, "//CONFIG_TYPE", "CUSTOM");
      Context.ChangeXmlNodeInnerTextValue(path, "//ANTI_ALIAS", "ON");
      Context.ChangeXmlNodeInnerTextValue(path, "//SHADOW_QUAL", "MIDDLE");
      Context.ChangeXmlNodeInnerTextValue(path, "//SHADOW_DIST", "NORMAL");
      Context.ChangeXmlNodeInnerTextValue(path, "//RT_REF", "OFF");
      Context.ChangeXmlNodeInnerTextValue(path, "//AO", "ON");
      Context.ChangeXmlNodeInnerTextValue(path, "//MOT_BLUR", "ON");
      Context.ChangeXmlNodeInnerTextValue(path, "//CHROMA_ABERRATION", "ON");
      break;
    case "max":
      Context.ChangeXmlNodeInnerTextValue(path, "//CONFIG_TYPE", "CUSTOM");
      Context.ChangeXmlNodeInnerTextValue(path, "//ANTI_ALIAS", "ON");
      Context.ChangeXmlNodeInnerTextValue(path, "//SHADOW_QUAL", "HIGH");
      Context.ChangeXmlNodeInnerTextValue(path, "//SHADOW_DIST", "LONG");
      Context.ChangeXmlNodeInnerTextValue(path, "//RT_REF", "ON");
      Context.ChangeXmlNodeInnerTextValue(path, "//AO", "ON");
      Context.ChangeXmlNodeInnerTextValue(path, "//MOT_BLUR", "ON");
      Context.ChangeXmlNodeInnerTextValue(path, "//CHROMA_ABERRATION", "ON");
      break;
  }

  switch (fps) {
    case "no":
      break;
    case "30":
      Context.ChangeXmlNodeInnerTextValue(path, "//FPS", "30");
      break;
    case "60":
      Context.ChangeXmlNodeInnerTextValue(path, "//FPS", "60");
      break;
    case "120":
      Context.ChangeXmlNodeInnerTextValue(path, "//FPS", "120");
      break;
  }

  switch (texture) {
    case "no":
      break;
    case "low":
      Context.ChangeXmlNodeInnerTextValue(path, "//TEXTURE_QUAL", "LOW");
      break;
    case "medium":
      Context.ChangeXmlNodeInnerTextValue(path, "//TEXTURE_QUAL", "MIDDLE");
      break;
    case "high":
      Context.ChangeXmlNodeInnerTextValue(path, "//TEXTURE_QUAL", "HIGH");
      break;
  }
};