Quake II · handler “Quake II (Quake2XP)”
Version 2
Release notes
better description
- Released
- Size
- 1.5 KB
- Downloads
- 442
- Check
- Verified
- SHA-256
- fbe0d327ee69d40f5bc5f6fea3f55555000a0b1250616db146010456ca6f88c0
Files 1
| Path | Size |
|---|---|
| handler.js | 5.6 KB |
handler.js
Plain textHub.Handler.Version = 2; // Released at https://hub.splitscreen.me/ on Wed Jul 28 2021 12:52:19 GMT+0000 (UTC).
Hub.Handler.Id = "pLqgXNBzFSgK6tcGf";
Hub.Maintainer.Name = "Genjuro_Kibagami";
Hub.Maintainer.Id = "6s2Fuz9unXTtH453m";
var answers = ["None", "The Reckoning", "Ground Zero", "Eraser Bots"];
Game.AddOption("Select a Mod", "", "mod", answers);
Game.ExecutableContext = ["devil.dll"];
Game.DirSymlinkExclusions = [];
Game.FileSymlinkExclusions = [];
Game.DirSymlinkCopyInstead = ["baseq2", "rogue", "xatrix", "eraser"];
Game.UseNucleusEnvironment = false;
Game.NeedsSteamEmulation = false;
Game.UseGoldberg = false;
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.SymlinkFolders = true;
Game.ExecutableName = "quake2xp.exe";
Game.SteamID = "2310";
Game.GUID = "Quake 2";
Game.GameName = "Quake 2";
Game.MaxPlayers = 8;
Game.MaxPlayersOneMonitor = 8;
Game.HideTaskbar = true;
Game.Hook.ForceFocus = true;
Game.Hook.ForceFocusWindowName = "quake2xp";
Game.HasDynamicWindowTitle = true;
Game.FakeFocus = true;
Game.FakeFocusInterval = 40000;
Game.SendFakeFocusMsg = true;
Game.HookFocus = true;
Game.SetWindowHook = true;
Game.Hook.DInputEnabled = false;
Game.Hook.XInputEnabled = true;
Game.Hook.UseAlpha8CustomDll = true;
Game.Hook.CustomDllEnabled = false;
Game.XInputPlusDll = ["xinput1_4.dll", "xinput9_1_0.dll"];
Game.Description =
"This script requires Quake2XP to be installed in your clean Quake 2 files. Run Quake2xp.exe in your main game files first and change/save any graphics setting and all mission packs before launching via Nucleus. Start a multiplayer game in the first instance then press ok on the prompt to open the next instances when the server is ready, the other instances will connect automatically.";
Game.KeepSymLinkOnExit = true;
Game.PauseBetweenProcessGrab = 5;
Game.PauseBetweenStarts = 15;
Game.PromptAfterFirstInstance = true;
Game.Play = function() {
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\baseq2\\xpconfig.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "set r_customWidth ", Nucleus.SearchType.StartsWith) + '|set r_customWidth "' + Context.Width + '"',
Context.FindLineNumberInTextFile(txtPath, "set r_customHeight ", Nucleus.SearchType.StartsWith) + '|set r_customHeight "' + Context.Height + '"',
Context.FindLineNumberInTextFile(txtPath, "set r_mode ", Nucleus.SearchType.StartsWith) + '|set r_mode "' + 21 + '"',
Context.FindLineNumberInTextFile(txtPath, "set name ", Nucleus.SearchType.StartsWith) + '|set name "' + Context.Nickname + '"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
if (System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\rogue\\xpconfig.cfg")) {
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\rogue\\xpconfig.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "set r_customWidth ", Nucleus.SearchType.StartsWith) + '|set r_customWidth "' + Context.Width + '"',
Context.FindLineNumberInTextFile(txtPath, "set r_customHeight ", Nucleus.SearchType.StartsWith) + '|set r_customHeight "' + Context.Height + '"',
Context.FindLineNumberInTextFile(txtPath, "set r_mode ", Nucleus.SearchType.StartsWith) + '|set r_mode "' + 21 + '"',
Context.FindLineNumberInTextFile(txtPath, "set name ", Nucleus.SearchType.StartsWith) + '|set name "' + Context.Nickname + '"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
if (System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\xatrix\\xpconfig.cfg")) {
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\xatrix\\xpconfig.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "set r_customWidth ", Nucleus.SearchType.StartsWith) + '|set r_customWidth "' + Context.Width + '"',
Context.FindLineNumberInTextFile(txtPath, "set r_customHeight ", Nucleus.SearchType.StartsWith) + '|set r_customHeight "' + Context.Height + '"',
Context.FindLineNumberInTextFile(txtPath, "set r_mode ", Nucleus.SearchType.StartsWith) + '|set r_mode "' + 21 + '"',
Context.FindLineNumberInTextFile(txtPath, "set name ", Nucleus.SearchType.StartsWith) + '|set name "' + Context.Nickname + '"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
if (System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\eraser\\xpconfig.cfg")) {
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\eraser\\xpconfig.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "set r_customWidth ", Nucleus.SearchType.StartsWith) + '|set r_customWidth "' + Context.Width + '"',
Context.FindLineNumberInTextFile(txtPath, "set r_customHeight ", Nucleus.SearchType.StartsWith) + '|set r_customHeight "' + Context.Height + '"',
Context.FindLineNumberInTextFile(txtPath, "set r_mode ", Nucleus.SearchType.StartsWith) + '|set r_mode "' + 21 + '"',
Context.FindLineNumberInTextFile(txtPath, "set name ", Nucleus.SearchType.StartsWith) + '|set name "' + Context.Nickname + '"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
var mod = Context.Options["mod"];
if (mod == "None") {
var modarg = "";
}
if (mod == "The Reckoning") {
var modarg = "+set game xatrix";
}
if (mod == "Ground Zero") {
var modarg = "+set game rogue";
}
if (mod == "Eraser Bots") {
var modarg = "+set game eraser";
}
if (Context.PlayerID == 0) {
Context.StartArguments = modarg;
} else {
Context.StartArguments = modarg + " +connect 127.0.0.1";
}
};