/* Metro2033.asl - An ASL script for LiveSplit for the game Metro 2033 (Steam version, not Redux) @author Ekelbatzen Hosted previously by Chimpaneez and presumably Ekelbatzen before that @version 1 on June 3rd 2016 by Ekelbatzen stateIsLoading, stateLevel, bossState, vars.levelCodeMenu, vars.levelcodeBoss, vars.bossStateDead, vars.isIngameCode + original split & isLoading logic @version 1.1 on August 8th, 2025 by Meta Added ASL Helper */ state("metro2033") { int stateIsLoading : 0x616960; // 3 means ingame, other values means something else like in menu int stateLevel : 0x641814; // Maybe a level id code? int bossState : 0x614F78, 0x8, 0x24; // 1 if boss is alive, 2 if dead } startup { #region ASL Helper Setup //Load asl-help binary and instantiate it - will inject code into the asl in the background //This isnt actually a Unity game but shhhhhhh Assembly.Load(File.ReadAllBytes("Components/asl-help")).CreateInstance("Basic"); //Setting Game Name and toggling alert to ensure runner is comparing against Game TIme vars.Helper.GameName = "Metro 2033"; vars.Helper.AlertLoadless(); #endregion //vars setup vars.levelcodeMenu = 0; vars.levelcodeBoss = 32; vars.bossStateDead = 2; vars.isIngameCode = 3; } // Returns True when split should be done split { bool isNotStarting = old.stateLevel != vars.levelcodeMenu; bool isNormalSplit = isNotStarting && current.stateLevel != old.stateLevel; bool isLastLevel = current.stateLevel == vars.levelcodeBoss; bool isBossDead = current.bossState == vars.bossStateDead; bool isBossSplit = isNotStarting && isLastLevel && isBossDead; return isNormalSplit || isBossSplit; } // Returns True while game timer should be paused, False to continue isLoading { // stateLevel 0 is main menu, stateIsLoading 3 means being ingame return current.stateIsLoading != vars.isIngameCode || current.stateLevel == vars.levelcodeMenu; }