diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2022-08-14 23:00:43 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2022-08-14 23:00:43 -0400 |
commit | c206c56d43af06f6f5add0422d8d0c271e1b8ad1 (patch) | |
tree | d4e548f64be0b4a28b1d668b50ea422216f19bf2 | |
parent | 46f4c031e1da279b7180087bf2f567ee25a6a822 (diff) | |
download | autosplitters-c206c56d43af06f6f5add0422d8d0c271e1b8ad1.tar.gz autosplitters-c206c56d43af06f6f5add0422d8d0c271e1b8ad1.tar.bz2 autosplitters-c206c56d43af06f6f5add0422d8d0c271e1b8ad1.zip |
[Manifold Garden] Timer starts on new game instead of first scene change
-rw-r--r-- | Manifold Garden.asl | 56 |
1 files changed, 26 insertions, 30 deletions
diff --git a/Manifold Garden.asl b/Manifold Garden.asl index 227656e..a7d7778 100644 --- a/Manifold Garden.asl +++ b/Manifold Garden.asl | |||
@@ -1,14 +1,9 @@ | |||
1 | // AutoSplit script for Manifold Garden 1.0.30.14704 | 1 | // AutoSplit script for Manifold Garden 1.0.30.14704 |
2 | // | 2 | // |
3 | // Written by hatkirby, with a lot of help from preshing and Gelly. | 3 | // Written by hatkirby, with help from preshing and Gelly. |
4 | // | 4 | // |
5 | // Automatically starts the timer ~2.4 seconds after starting a new game, and splits the timer | 5 | // Automatically starts the timer when a new game is started. You must still reset the timer |
6 | // when transitioning between game levels. You must still reset the timer manually between runs. | 6 | // manually between runs. |
7 | // If you accidentally backtrack through a portal, causing an unwanted split, you'll have | ||
8 | // to undo it manually (default NumPad8 in LiveSplit). | ||
9 | // | ||
10 | // To compensate for the late start, you should delay your start timer by 2.4 seconds in LiveSplit. | ||
11 | // (Right-click -> Edit Splits -> Start timer at:) | ||
12 | // | 7 | // |
13 | // A split is also triggered after being in one of the ending cutscenes for 1.1 seconds, | 8 | // A split is also triggered after being in one of the ending cutscenes for 1.1 seconds, |
14 | // since this is when the kaleidoscope appears. | 9 | // since this is when the kaleidoscope appears. |
@@ -25,23 +20,16 @@ | |||
25 | // https://technet.microsoft.com/en-us/Library/bb896647.aspx | 20 | // https://technet.microsoft.com/en-us/Library/bb896647.aspx |
26 | 21 | ||
27 | state("ManifoldGarden") { | 22 | state("ManifoldGarden") { |
28 | // This pointer path seems to work with Manifold Garden 1.1.0.14704 (2020-11-09): | 23 | // These pointer paths seem to work with Manifold Garden 1.1.0.14704 (2020-11-09): |
29 | int level: "UnityPlayer.dll", 0x01800AB8, 0x10, 0xB8, 0x10, 0x28, 0x18, 0x60, 0x7CC; | 24 | int level: "UnityPlayer.dll", 0x01800AB8, 0x10, 0xB8, 0x10, 0x28, 0x18, 0x60, 0x7CC; |
25 | bool transitionFadeHeld: "UnityPlayer.dll", 0x017945A8, 0x80, 0x10, 0x48, 0xA0, 0x10, 0xE40; | ||
26 | bool isLoadingGameFromUI: "UnityPlayer.dll", 0x017945A8, 0x90, 0x100, 0xC0, 0xC0, 0xC0, 0xC0, 0xDC1; | ||
30 | 27 | ||
31 | // This pointer path seems to work with Manifold Garden 1.0.30.13294 (2020-02-25): | 28 | // Older pointer paths: |
32 | //int level: "UnityPlayer.dll", 0x014BE300, 0x60, 0xA8, 0x38, 0x30, 0xB0, 0x118, 0x5C; | 29 | //int level: "UnityPlayer.dll", 0x014BE300, 0x60, 0xA8, 0x38, 0x30, 0xB0, 0x118, 0x5C; // 1.0.30.13294 (2020-02-25) |
33 | 30 | //int level: "UnityPlayer.dll", 0x01552858, 0x8, 0x0, 0xB8, 0x80, 0x80, 0x28, 0x5C; // 13294 | |
34 | // These ones also seem to work with version 13294, and can be tried as backups in case | 31 | //int level: "UnityPlayer.dll", 0x01552858, 0x28, 0x8, 0xB8, 0x80, 0x80, 0x28, 0x5C; // 13294 |
35 | // the one above stops working: | 32 | //int level: "UnityPlayer.dll", 0x01507BE0, 0x0, 0x928, 0x38, 0x30, 0xB0, 0x118, 0x5C; // 1.0.29.12904 (2020-02-??), 1.0.29.12830 (2019-12-18), 1.0.29.12781 (2019-12-11) |
36 | //int level: "UnityPlayer.dll", 0x01552858, 0x8, 0x0, 0xB8, 0x80, 0x80, 0x28, 0x5C; | ||
37 | //int level: "UnityPlayer.dll", 0x01552858, 0x28, 0x8, 0xB8, 0x80, 0x80, 0x28, 0x5C; | ||
38 | |||
39 | // This pointer path worked with Manifold Garden 1.0.29.12904 (2020-02-??) | ||
40 | // & Manifold Garden 1.0.29.12830 (2019-12-18) | ||
41 | // & Manifold Garden 1.0.29.12781 (2019-12-11): | ||
42 | //int level: "UnityPlayer.dll", 0x01507BE0, 0x0, 0x928, 0x38, 0x30, 0xB0, 0x118, 0x5C; | ||
43 | |||
44 | // This pointer path worked with older versions: | ||
45 | //int level: "UnityPlayer.dll", 0x01507C68, 0x8, 0x38, 0xA8, 0x58, 0x118, 0x5C; | 33 | //int level: "UnityPlayer.dll", 0x01507C68, 0x8, 0x38, 0xA8, 0x58, 0x118, 0x5C; |
46 | } | 34 | } |
47 | 35 | ||
@@ -54,7 +42,7 @@ startup { | |||
54 | vars.seqIndex = 0; | 42 | vars.seqIndex = 0; |
55 | vars.stopwatch = null; // Used for the final split | 43 | vars.stopwatch = null; // Used for the final split |
56 | vars.prev = new List<int>(); | 44 | vars.prev = new List<int>(); |
57 | vars.prev.Add(9); | 45 | vars.firstRoom = false; |
58 | } | 46 | } |
59 | 47 | ||
60 | init { | 48 | init { |
@@ -72,26 +60,31 @@ update { | |||
72 | } | 60 | } |
73 | 61 | ||
74 | start { | 62 | start { |
75 | if (old.level == -1 && current.level == 9) { | 63 | // Start the timer as soon as a game is being loaded (specifically the moment you click |
64 | // a save slot to start a new game in, although it will also start if you just load a file). | ||
65 | // This boolean is set to true during the studio logo when the game starts up, so we check | ||
66 | // for that as well. | ||
67 | if (current.transitionFadeHeld && current.isLoadingGameFromUI) { | ||
76 | print(String.Format("Level changed from {0} to {1}: START", old.level, current.level)); | 68 | print(String.Format("Level changed from {0} to {1}: START", old.level, current.level)); |
77 | if (settings["zero"]) { | 69 | if (settings["zero"]) { |
78 | vars.waypoints = new List<int>{106, 17, 110, 115, 111, 36, 44}; | 70 | vars.waypoints = new List<int>{106, 17, 110, 115, 111, 36, 44}; |
79 | } else { | 71 | } else { |
80 | vars.waypoints = null; | 72 | vars.waypoints = null; |
81 | } | 73 | } |
82 | vars.prevLevel = 9; | 74 | vars.prevLevel = current.level; |
83 | vars.seqIndex = 0; | 75 | vars.seqIndex = 0; |
84 | vars.stopwatch = Stopwatch.StartNew(); | 76 | vars.stopwatch = Stopwatch.StartNew(); |
85 | vars.prev.Clear(); | 77 | vars.prev.Clear(); |
86 | vars.prev.Add(current.level); | 78 | vars.firstRoom = false; |
87 | return true; | 79 | return true; |
88 | } | 80 | } |
89 | } | 81 | } |
90 | 82 | ||
91 | split { | 83 | split { |
92 | // Split when level index changes, but avoid splitting during a loading screen | 84 | // Split when level index changes. We don't split for the first room change in a run, |
93 | // or when the pointer path stops working: | 85 | // because that is always going to be changing from -1 to 9, and it happens a couple of |
94 | if (current.level != vars.prevLevel && current.level >= 0) { | 86 | // seconds after the timer starts. |
87 | if (vars.firstRoom && current.level != vars.prevLevel && current.level >= 0) { | ||
95 | string action = "NO SPLIT"; | 88 | string action = "NO SPLIT"; |
96 | 89 | ||
97 | // Ignore the split rules when script is reloaded mid-game: | 90 | // Ignore the split rules when script is reloaded mid-game: |
@@ -130,6 +123,9 @@ split { | |||
130 | vars.prevLevel = current.level; | 123 | vars.prevLevel = current.level; |
131 | vars.stopwatch = Stopwatch.StartNew(); | 124 | vars.stopwatch = Stopwatch.StartNew(); |
132 | return action.StartsWith("SPLIT"); | 125 | return action.StartsWith("SPLIT"); |
126 | } else if (!vars.firstRoom && current.level == 9) { | ||
127 | vars.firstRoom = true; | ||
128 | vars.prevLevel = current.level; | ||
133 | } | 129 | } |
134 | 130 | ||
135 | // Final split of the game: | 131 | // Final split of the game: |