TheEvilWithin2.asl 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. state("TEW2", "Current Patch")
  2. {
  3. float ComputerLoad : 0x2ABFC1D; // 2 while loading
  4. int Pause : 0x3734978; // just for rn to see what the mod wants
  5. int Loading : 0x246624E; // loading 0
  6. int Chapter : 0x03712248, 0x5C;
  7. float x : 0x39CA190;
  8. float y : 0x39CA194;
  9. float z : 0x39CA198;
  10. }
  11. state("TEW2", "1.02")
  12. {
  13. int ComputerLoad : 0x3D6E634; // 0 while loading
  14. int Pause : 0x3637B00; // 1 paused, 0 unpaused
  15. int Loading : 0x236D5B8; // 2369317 0 loading, 2816 while not
  16. int Chapter : 0x3615208, 0x5C;
  17. float x : 0x38CD190;
  18. float y : 0x38CD194;
  19. float z : 0x38CD198;
  20. }
  21. startup
  22. {
  23. settings.Add("chap", true, "All Chapters");
  24. settings.Add("end", true, "End Split");
  25. settings.SetToolTip("end", "The end split for when you finish chapter 17. The opposite of start!");
  26. vars.Chapters = new Dictionary<string,string>
  27. {
  28. {"starter","Chapter 1 - Into the Flame"},
  29. {"2","Chapter 2 - Something Not Quite Right"},
  30. {"3","Chapter 3 - Resonances"},
  31. {"4","Chapter 4 - Behind the Curtain"},
  32. {"5","Chapter 5 - Lying in Wait"},
  33. {"6","Chapter 6 - On the Hunt"},
  34. {"7","Chapter 7 - Lust For Art"},
  35. {"8","Chapter 8 - Premiere"},
  36. {"9","Chapter 9 - Another Evil"},
  37. {"10","Chapter 10 - Hidden From the Start"},
  38. {"11","Chapter 11 - Reconnecting"},
  39. {"12","Chapter 12 - Bottomless Pit"},
  40. {"13","Chapter 13 - Stronghold"},
  41. {"14","Chapter 14 - Burning the Altar"},
  42. {"15","Chapter 15 - The End of This World"},
  43. {"16","Chapter 16 - In Limbo"},
  44. {"17","Chapter 17 - A Way Out"},
  45. };
  46. foreach (var Tag in vars.Chapters)
  47. {
  48. settings.Add(Tag.Key, true, Tag.Value, "chap");
  49. };
  50. vars.onStart = (EventHandler)((s, e) => // thanks gelly for this, it's basically making sure it always clears the vars no matter how livesplit starts
  51. {
  52. vars.doneMaps.Clear();
  53. vars.doneMaps.Add(current.Chapter.ToString());
  54. });
  55. settings.SetToolTip("starter", "This is used as the starter setting, disabling this also disables the original start command!");
  56. timer.OnStart += vars.onStart;
  57. if (timer.CurrentTimingMethod == TimingMethod.RealTime) // stolen from dude simulator 3, basically asks the runner to set their livesplit to game time
  58. {
  59. var timingMessage = MessageBox.Show (
  60. "This game uses Time without Loads (Game Time) as the main timing method.\n"+
  61. "LiveSplit is currently set to show Real Time (RTA).\n"+
  62. "Would you like to set the timing method to Game Time? This will make verification easier",
  63. "LiveSplit | The Evil Within 2",
  64. MessageBoxButtons.YesNo,MessageBoxIcon.Question
  65. );
  66. if (timingMessage == DialogResult.Yes)
  67. {
  68. timer.CurrentTimingMethod = TimingMethod.GameTime;
  69. }
  70. }
  71. }
  72. init
  73. {
  74. switch (modules.First().ModuleMemorySize)
  75. {
  76. case 74637312 : version = "Current Patch";
  77. break;
  78. case 73007104 : version = "1.02";
  79. break;
  80. default: version = "";
  81. break;
  82. }
  83. vars.doneMaps = new List<string>();
  84. vars.endsplit = 0;
  85. vars.Loader = 0;
  86. }
  87. update
  88. {
  89. if(settings["end"])
  90. {
  91. if (version == "1.02" && current.x > 42099.80858 && current.x < 42099.80860 && current.y > -28778.58009 && current.y < -28778.58007 && current.Chapter == 17)
  92. {
  93. vars.endsplit = 1;
  94. }
  95. }
  96. //|| (current.ComputerLoad == 0 && current.Loading != 0)
  97. if ((current.Loading == 0) || (current.Pause == 1))
  98. {
  99. vars.Loader = 1;
  100. }
  101. else
  102. {
  103. vars.Loader = 0;
  104. }
  105. }
  106. start
  107. {
  108. return ((current.Chapter == 1) && (settings["starter"]) && (old.Chapter != current.Chapter) && (!vars.doneMaps.Contains(current.Chapter.ToString())));
  109. }
  110. split
  111. {
  112. if (settings[current.Chapter.ToString()] && (!vars.doneMaps.Contains(current.Chapter.ToString())))
  113. {
  114. vars.doneMaps.Add(current.Chapter.ToString());
  115. return true;
  116. }
  117. if (vars.endsplit == 1)
  118. {
  119. vars.endsplit = 0;
  120. return true;
  121. }
  122. }
  123. isLoading
  124. {
  125. return (vars.Loader == 1);
  126. }
  127. reset
  128. {
  129. return (current.Chapter == 0);
  130. }
  131. exit
  132. {
  133. timer.OnStart -= vars.onStart;
  134. }