Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. stategraph_basicrace_prerace_handler_stateenter = function(l_1_arg0, l_1_arg1, l_1_arg2)
  2. Game.ResetCopsForRestart()
  3. Game.SetCopsEnabled(l_1_arg0.CopsInRace)
  4. Game.SetChanceOfRain(l_1_arg0.ChanceOfRain)
  5. Debug.Print("Pre-race setup")
  6. l_1_arg2.NextGoal = {}
  7. l_1_arg2.GoalCount = {}
  8. l_1_arg2.GoalList = {}
  9. l_1_arg2.LapsLeft = {}
  10. l_1_arg2.InRace = {}
  11. l_1_arg2.Element = {}
  12. l_1_arg2.Character = {}
  13. l_1_arg2.NumAutoSpawned = 0
  14. l_1_arg2.AutoSpawnedTriggers = {}
  15. for l_1_3 = 1, l_1_arg2.NumRacers do
  16. l_1_arg2.GoalList[l_1_3] = l_1_arg0.Checkpoint
  17. l_1_arg2.Character[l_1_3] = Game.GetRacerCharacter(l_1_3)
  18. if l_1_arg2.Character[l_1_3] ~= nil and l_1_arg2.Character[l_1_3].CannedPath ~= nil then
  19. Debug.Print("Racer " .. l_1_3 .. " using canned path")
  20. l_1_arg2.GoalList[l_1_3] = l_1_arg2.Character[l_1_3].CannedPath
  21. end
  22. l_1_arg2.GoalCount[l_1_3] = 0
  23. if l_1_arg2.GoalList[l_1_3] ~= nil then
  24. l_1_arg2.GoalCount[l_1_3] = l_1_arg2.GoalList[l_1_3].Count
  25. end
  26. local l_1_6 = l_1_arg0.racefinish
  27. local l_1_7 = 0
  28. if l_1_arg2.GoalCount[l_1_3] > 0 then
  29. l_1_6 = l_1_arg2.GoalList[l_1_3][1]
  30. l_1_7 = 1
  31. end
  32. l_1_arg2.NextGoal[l_1_3] = l_1_7
  33. l_1_arg2.LapsLeft[l_1_3] = l_1_arg0.NumLaps
  34. l_1_arg2.InRace[l_1_3] = true
  35. l_1_arg2.Element[l_1_3] = Game.GetRacerElement(l_1_3)
  36. Game.SetRacerGoal(l_1_3, l_1_6)
  37. end
  38. l_1_arg2.NumberFinished = 0
  39. l_1_arg2.NumAllowedForLaps = {}
  40. local l_1_3 = l_1_arg2.NumAllowedForLaps
  41. local l_1_4 = l_1_arg0.NumLaps
  42. l_1_3[l_1_4] = l_1_arg2.NumRacers + 1
  43. l_1_3 = l_1_arg0.NumLaps
  44. l_1_3 = l_1_3 - 1
  45. l_1_4 = 0
  46. l_1_3 = l_1_3 - -1
  47. for l_1_5 = l_1_3, l_1_4, -1 do
  48. l_1_arg2.NumAllowedForLaps[l_1_3] = l_1_arg2.NumAllowedForLaps[l_1_3 + 1] - l_1_arg0.KnockoutsPerLap
  49. if l_1_arg2.NumAllowedForLaps[l_1_3] < 1 then
  50. l_1_arg2.NumAllowedForLaps[l_1_3] = 1
  51. end
  52. end
  53. l_1_arg2.NumCheckpoints = 0
  54. l_1_3 = l_1_arg0.Checkpoint
  55. if l_1_3 ~= nil then
  56. l_1_3 = l_1_arg0.Checkpoint
  57. l_1_3 = l_1_3.Count
  58. l_1_arg2.NumCheckpoints = l_1_3
  59. end
  60. l_1_3 = RaceStatus
  61. l_1_3, l_1_4 = l_1_3:ClearCheckpoints, l_1_3
  62. l_1_3(l_1_4)
  63. l_1_3 = 1
  64. l_1_4 = l_1_arg2.NumCheckpoints
  65. l_1_3 = l_1_3 - 1
  66. for l_1_3 = l_1_3, l_1_4 do
  67. local , l_1_4, l_1_5 =
  68. l_1_4 = RaceStatus
  69. l_1_4, l_1_5 = l_1_4:AddCheckpoint, l_1_4
  70. l_1_4(l_1_5, l_1_arg0.Checkpoint[l_1_3])
  71. end
  72. l_1_3 = RaceStatus
  73. l_1_3, l_1_4 = l_1_3:AddCheckpoint, l_1_3
  74. l_1_3(l_1_4, l_1_arg0.racefinish)
  75. l_1_3 = Game
  76. l_1_3 = l_1_3.IsOnlineGame
  77. l_1_3 = l_1_3()
  78. if not l_1_3 then
  79. l_1_3 = Game
  80. l_1_3 = l_1_3.IsLANGame
  81. l_1_3 = l_1_3()
  82. end
  83. l_1_arg2.OnlineRace = l_1_3
  84. l_1_3 = l_1_arg2.CameFromNIS
  85. if not l_1_3 then
  86. l_1_3 = Game
  87. l_1_3 = l_1_3.WarpPlayerToTrigger
  88. l_1_4 = l_1_arg0.racestart
  89. l_1_3(l_1_4)
  90. end
  91. l_1_3 = Game
  92. l_1_3 = l_1_3.RestoreStartPositions
  93. l_1_3()
  94. l_1_3 = false
  95. l_1_arg2.CameFromNIS = l_1_3
  96. l_1_3 = RaceStatus
  97. l_1_3, l_1_4 = l_1_3:NotifyScriptWhenLoaded, l_1_3
  98. l_1_3(l_1_4)
  99. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement