-
Notifications
You must be signed in to change notification settings - Fork 10
/
WW2SniperCalltoVictory.asl
51 lines (43 loc) · 1.7 KB
/
WW2SniperCalltoVictory.asl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//World War II: Sniper - Call to Victory / Battlestrike: Call to Victory Autosplitter + Load Remover
//Load Removal by SuicideMachine
//Autosplitter code by rythin
//Addresses found by The_One & SuicideMachine
state("Lithtech") {
bool isPaused: 0x1C12D0, 0x194;
byte levelID: "lithtech.exe", 0x001C1330, 0xC; //doesn't work for the transition from Dropzone to Messenger
byte levelID2: "lithtech.exe", 0x001c17e0, 0x8, 0x4, 0xa68; //works for the above transition, but seems to split randomly? also one mission shares the value of C1 making auto-resets a pain
}
init {
//as in most lithtech games, the level value goes to 0 in loading screens,
//so we keep the value of the previous level here to compare to after a load happens
vars.prevLev = 26;
}
start {
//start when first level is loaded and the loading screen just finished
if (current.levelID == 26 && !current.isPaused && current.isPaused != old.isPaused) {
return true;
}
}
split {
//split on level transitions except for Dropzone -> Messenger (because the levelID for those two maps is the same)
if (current.levelID != vars.prevLev && current.levelID != 0) {
vars.prevLev = current.levelID;
return true;
}
//split Dropzone -> Messenger (since levelID2 is different for those two)
if (current.levelID2 == 41 && old.levelID2 == 0 && vars.prevLev == 6) {
return true;
}
//levelID2 has repeating values for different levels, making it not great for splitting anywhere else
//but it does fix this singular issue so we use it here
}
reset {
//reset when in C1, the beginning cutscene
if (current.levelID == 4) {
vars.prevLev = 26;
return true;
}
}
isLoading {
return current.isPaused;
}