CallOfCthulhu2018.asl 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // Splits once loading is done because can't do a logical check for which load screen is which without entering the level first sadly
  2. // Easiest fix compared to trying to sort through hours of finding a code for the current map as it's usually locked cause UE4 bad
  3. state("CallOfCthulhu")
  4. {
  5. }
  6. startup
  7. {
  8. settings.Add("missions", true, "Missions");
  9. vars.missions = new Dictionary<string,string>
  10. {
  11. {"1","Chapter 2: Dark Water"},
  12. {"2","Chapter 3: Garden of the Hawkins mansion"},
  13. {"3","Chapter 4: Tunnels Under the Hawkins mansion"},
  14. {"4","Chapter 5: Riverside Institute"},
  15. {"5","Chapter 6: Hawkins mansion"},
  16. {"6","Chapter 7: The Nameless Bookstore"},
  17. {"7","Chapter 8: Riverside Institute"},
  18. {"8","Chapter 9: Riverside Institute"},
  19. {"9","Chapter 10: Darkwater police station"},
  20. {"10","Chapter 11: Darkwater police station"},
  21. {"11","Chapter 12: Darkwater Port"},
  22. {"12","Chapter 13: Abandoned whaling station"},
  23. {"13","Chapter 14: Coastal Cave Alabaster Point"},
  24. };
  25. foreach (var Tag in vars.missions)
  26. {
  27. settings.Add(Tag.Key, true, Tag.Value, "missions");
  28. };
  29. if (timer.CurrentTimingMethod == TimingMethod.RealTime) // stolen from dude simulator 3, basically asks the runner to set their livesplit to game time
  30. {
  31. var timingMessage = MessageBox.Show (
  32. "This game uses Time without Loads (Game Time) as the main timing method.\n"+
  33. "LiveSplit is currently set to show Real Time (RTA).\n"+
  34. "Would you like to set the timing method to Game Time? This will make verification easier",
  35. "LiveSplit | Wanted: Weapons of Fate",
  36. MessageBoxButtons.YesNo,MessageBoxIcon.Question
  37. );
  38. if (timingMessage == DialogResult.Yes)
  39. {
  40. timer.CurrentTimingMethod = TimingMethod.GameTime;
  41. }
  42. }
  43. }
  44. init
  45. {
  46. vars.counter = 0; // Just so there is custimization per load, and that it doesn't decide to split within the same world
  47. vars.oldcomparision = 0; // Just in case you die or soft-reset it doesn't split again, comparing this to the current.loading1 per each split
  48. //Code original written by Micrologist
  49. var scn = new SignatureScanner(game, game.MainModule.BaseAddress, game.MainModule.ModuleMemorySize);
  50. var syncLoadTrg = new SigScanTarget(3, "44 8b 05 ?? ?? ?? ?? 48 8b da 4a 8d 0c c2") { OnFound = (p, s, ptr) => ptr + 0x4 + game.ReadValue<int>(ptr) };
  51. var syncLoadCounterPtr = scn.Scan(syncLoadTrg);
  52. vars.Watchers = new MemoryWatcherList
  53. {
  54. // GSyncLoadCount
  55. new MemoryWatcher<int>(new DeepPointer(syncLoadCounterPtr)) { Name = "syncLoadCount" },
  56. };
  57. }
  58. update
  59. {
  60. vars.Watchers.UpdateAll(game);
  61. current.Loading = vars.Watchers["syncLoadCount"].Current;
  62. }
  63. onStart
  64. {
  65. vars.counter = 0;
  66. }
  67. onReset
  68. {
  69. vars.counter = 0;
  70. }
  71. isLoading
  72. {
  73. return (current.Loading == 0);
  74. }