From f508af9103fd8e5f8ca1ea99c3039dae76fbdd59 Mon Sep 17 00:00:00 2001 From: Jacky720 <32578221+Jacky720@users.noreply.github.com> Date: Tue, 4 Oct 2022 21:06:06 -0400 Subject: [PATCH 1/2] Attempt fixes to reported erring scripts --- .../Scripts/Builtin Scripts/DeltaHATE.csx | 20 ++++++++++++++----- .../Scripts/Builtin Scripts/DeltaMILK.csx | 11 ---------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/UndertaleModTool/Scripts/Builtin Scripts/DeltaHATE.csx b/UndertaleModTool/Scripts/Builtin Scripts/DeltaHATE.csx index 568e1f6f8..d11a7ac71 100644 --- a/UndertaleModTool/Scripts/Builtin Scripts/DeltaHATE.csx +++ b/UndertaleModTool/Scripts/Builtin Scripts/DeltaHATE.csx @@ -2,6 +2,7 @@ EnsureDataLoaded(); +// Is actually incompatible. Something broke when I (Space Core) tried to combine the UT and SURVEY_PROGRAM code. if (Data?.GeneralInfo?.DisplayName?.Content.ToLower() == "deltarune chapter 1 & 2") { ScriptError("Error 0: Incompatible with the new Deltarune Chapter 1 & 2 demo"); @@ -116,7 +117,16 @@ void StringSwap(int n, int k) Data.Strings[n].Content = value; } -if (Data.GeneralInfo.Filename.Content.ToLower().Contains("undertale")) +string GameName = Data.GeneralInfo.DisplayName.Content.ToLower(); +bool deltamode = false; +if (GameName.Contains("undertale") || GameName.Contains("nxtale")) + deltamode = false; +else if (GameName.Contains("survey_program")) + deltamode = true; +else + deltamode = ScriptQuestion("Is this Deltarune Chapter 1 or a mod thereof?") ? true : false; + +if (!deltamode) { List choicer_lines = new List(); List final_lines = new List(); @@ -228,10 +238,10 @@ foreach (var obj in Data.GameObjects) { if (!obj.Visible) continue; - if (obj._Sprite.CachedId >= 0) - obj.Sprite = Data.Sprites[obj._Sprite.CachedId]; - if (obj._TextureMaskId.CachedId >= 0) - obj.TextureMaskId = Data.Sprites[obj._TextureMaskId.CachedId]; + if (obj._sprite.CachedId >= 0) + obj.Sprite = Data.Sprites[obj._sprite.CachedId]; + if (obj._textureMaskId.CachedId >= 0) + obj.TextureMaskId = Data.Sprites[obj._textureMaskId.CachedId]; } ScriptMessage("* GASTER NOISES *\n\nIT'S DONE"); \ No newline at end of file diff --git a/UndertaleModTool/Scripts/Builtin Scripts/DeltaMILK.csx b/UndertaleModTool/Scripts/Builtin Scripts/DeltaMILK.csx index f7d44e623..aafb59b9f 100644 --- a/UndertaleModTool/Scripts/Builtin Scripts/DeltaMILK.csx +++ b/UndertaleModTool/Scripts/Builtin Scripts/DeltaMILK.csx @@ -1,16 +1,5 @@ EnsureDataLoaded(); -if (Data?.GeneralInfo?.DisplayName?.Content.ToLower() == "deltarune chapter 1 & 2") -{ - ScriptError("Error 0: Incompatible with the new Deltarune Chapter 1 & 2 demo"); - return; -} -else if (Data?.GeneralInfo?.DisplayName?.Content.ToLower() == "deltarune chapter 1&2") -{ - ScriptError("Error 1: Incompatible with the new Deltarune Chapter 1 & 2 demo"); - return; -} - ScriptMessage("Select the MILK that you prefer\nReplace every non-background sprite with milk (for Deltarune)\nby krzys_h"); var milk = Data.Sprites.ByName("spr_checkers_milk").Textures[0].Texture; From 9a3a343b2149d3957e651f57f1409196e4e5c9be Mon Sep 17 00:00:00 2001 From: Jacky720 <32578221+Jacky720@users.noreply.github.com> Date: Wed, 5 Oct 2022 08:52:24 -0400 Subject: [PATCH 2/2] [m] rm redundant ternary --- UndertaleModTool/Scripts/Builtin Scripts/DeltaHATE.csx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UndertaleModTool/Scripts/Builtin Scripts/DeltaHATE.csx b/UndertaleModTool/Scripts/Builtin Scripts/DeltaHATE.csx index d11a7ac71..a2fd7b267 100644 --- a/UndertaleModTool/Scripts/Builtin Scripts/DeltaHATE.csx +++ b/UndertaleModTool/Scripts/Builtin Scripts/DeltaHATE.csx @@ -124,7 +124,7 @@ if (GameName.Contains("undertale") || GameName.Contains("nxtale")) else if (GameName.Contains("survey_program")) deltamode = true; else - deltamode = ScriptQuestion("Is this Deltarune Chapter 1 or a mod thereof?") ? true : false; + deltamode = ScriptQuestion("Is this Deltarune Chapter 1 or a mod thereof?"); if (!deltamode) { @@ -244,4 +244,4 @@ foreach (var obj in Data.GameObjects) obj.TextureMaskId = Data.Sprites[obj._textureMaskId.CachedId]; } -ScriptMessage("* GASTER NOISES *\n\nIT'S DONE"); \ No newline at end of file +ScriptMessage("* GASTER NOISES *\n\nIT'S DONE");