You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When there are multiple processes with the same name matching a state descriptor, currently the newest one is seleted. Once a process is selected, you're stuck with it until it exits, or until you reload the autosplitter. It would be nice if init were able to reject processes, so that you could select a different one instead.
The motivating example for this is Borderlands 3 on Epic. Launching the game first starts a small launcher process, which automatically launches the main game process, but then stays running until it exits. Both processes are simply called Borderlands3.exe. Under current behavior, if the autosplitter loads while the game is already running, it selects the newer process, which is the full game like we want it to be. However, if the autosplitter is loaded first (e.g. if the game crashes mid run), it hooks onto the launcher process, and because the launcher doesn't exit it never moves on to the game process.
It is possible to work around this using reflection.
init {if(condition){varallComponents= timer.Layout.Components;// Grab the autosplitter from splitsif(timer.Run.AutoSplitter !=null&& timer.Run.AutoSplitter.Component !=null){allComponents= allComponents.Append(timer.Run.AutoSplitter.Component);}foreach(var component in allComponents){vartype= component.GetType();if(type.Name =="ASLComponent"){// Could also check script path, but renaming the script breaks that, and// running multiple autosplitters at once is already just asking for problemsvarscript= type.GetProperty("Script").GetValue(component);
script.GetType().GetField("_game",
BindingFlags.NonPublic | BindingFlags.Instance
).SetValue(script,null);}}return;}}
For BL3, setting the game to null causes init to be re-run, which will eventually select the newer process when it launches. In other situations, you may need to manually identify the new process and replace it with that instead.
The text was updated successfully, but these errors were encountered:
wooferzfg
transferred this issue from LiveSplit/LiveSplit.ScriptableAutoSplit
Apr 18, 2024
When there are multiple processes with the same name matching a state descriptor, currently the newest one is seleted. Once a process is selected, you're stuck with it until it exits, or until you reload the autosplitter. It would be nice if init were able to reject processes, so that you could select a different one instead.
The motivating example for this is Borderlands 3 on Epic. Launching the game first starts a small launcher process, which automatically launches the main game process, but then stays running until it exits. Both processes are simply called
Borderlands3.exe
. Under current behavior, if the autosplitter loads while the game is already running, it selects the newer process, which is the full game like we want it to be. However, if the autosplitter is loaded first (e.g. if the game crashes mid run), it hooks onto the launcher process, and because the launcher doesn't exit it never moves on to the game process.It is possible to work around this using reflection.
For BL3, setting the game to null causes init to be re-run, which will eventually select the newer process when it launches. In other situations, you may need to manually identify the new process and replace it with that instead.
The text was updated successfully, but these errors were encountered: