1
1
# Libraries and Core Files
2
2
import time
3
3
import FFX_Logs
4
- # import FFX_core
4
+ import FFX_core
5
5
import FFX_Screen
6
6
import FFX_Battle
7
+ import FFX_memory
8
+
9
+ #Plug in controller
7
10
import FFX_Xbox
8
- FFXC = FFX_Xbox .FFXC
11
+ FFXC = FFX_Xbox .controllerHandle ()
12
+
13
+ #Speed run sectional files
14
+ import FFX_DreamZan
15
+ import FFX_Baaj
16
+ import FFX_Besaid1
17
+ #import FFX_Besaid2
18
+ import FFX_Boats
19
+ import FFX_Kilika
20
+ import FFX_Luca
21
+ import FFX_Blitz
22
+ import FFX_Miihen
23
+ import FFX_MRR
24
+ import FFX_Djose
25
+ import FFX_Moonflow
26
+ import FFX_Guadosalam
27
+ import FFX_ThunderPlains
28
+ import FFX_mWoods
29
+ import FFX_mTemple
30
+ import FFX_home
31
+ import FFX_rescueYuna
32
+ import FFX_Gagazet
33
+ import FFX_Zanarkand
34
+ import FFX_Sin
9
35
10
36
#Gamestate, "none" for new game, or set to a specific section to start from the first save.
11
37
#See the if statement tree below to determine starting position for Gamestate.
12
38
#These are the popular ones. New Game ('none') is the last one.
39
+ #Gamestate = "Baaj"
40
+ #StepCounter = 1
13
41
#Gamestate = "Besaid"
14
42
#StepCounter = 3
15
43
#Gamestate = "Kilika"
16
44
#StepCounter = 1
17
45
#Gamestate = "Luca"
18
46
#StepCounter = 1
19
- #Gamestate = "Luca"
47
+ #StepCounter = 3
20
48
#StepCounter = 5
49
+ #Gamestate = "Miihen"
50
+ #StepCounter = 1
21
51
#Gamestate = "MRR"
22
52
#StepCounter = 1
23
53
#Gamestate = "Djose"
24
54
#StepCounter = 1
55
+ #Gamestate = "Moonflow"
56
+ #StepCounter = 2
25
57
#Gamestate = "Guadosalam"
26
58
#StepCounter = 2
27
59
#Gamestate = "Macalania"
30
62
#Gamestate = "Home"
31
63
#StepCounter = 1
32
64
#Gamestate = "rescueYuna"
65
+ #StepCounter = 1
33
66
#StepCounter = 2
34
67
#Gamestate = "Gagazet"
35
68
#StepCounter = 1
69
+ #Gamestate = "Zanarkand"
70
+ #StepCounter = 4
71
+ #Gamestate = "Sin"
72
+ #StepCounter = 2
73
+ #StepCounter = 4
36
74
Gamestate = "none"
37
75
StepCounter = 1
38
76
44
82
45
83
####################################################################################################
46
84
#RNG - Using Rossy's FFX.exe fix, this allows us to choose the RNG seed we want. From 0-255
47
- #rngSeedNum = 31 #Favorite one so far
48
- #rngSeedNum = 45 #Another good possibility
49
- rngSeedNum = 46
85
+ #rngSeedNum = 31 #Potential
86
+ #rngSeedNum = 45 #Potential
87
+ #rngSeedNum = 49 #Favorite one so far, but problem on Chocobo Eater
88
+ rngSeedNum = 56
50
89
rngReviewOnly = True
51
90
print ("Game type will be: " , gameLength )
52
91
####################################################################################################
57
96
strengthCount = 0
58
97
endGameVersion = 0
59
98
gems = 0 #Set to 2 if loading in after Evrae Altana with two gems
99
+ earlyHaste = 0
60
100
earlyTidusGrid = False
61
101
if forceBlitzWin == True :
62
102
blitzWin = True
@@ -92,7 +132,7 @@ def reportGamestate():
92
132
FFX_Screen .clearMouse (0 )
93
133
94
134
#Initiate memory reading, after we know the game is open.
95
- import FFX_memory
135
+ # import FFX_memory
96
136
FFX_memory .start ()
97
137
FFX_memory .setRngSeed (rngSeedNum ) #Using Rossy's FFX.exe fix, this allows us to choose the RNG seed we want. From 0-255
98
138
rngSeed = FFX_memory .rngSeed ()
@@ -110,7 +150,8 @@ def reportGamestate():
110
150
import FFX_LoadGame
111
151
112
152
if Gamestate == "Baaj" and StepCounter == 1 :
113
- FFX_LoadGame .LoadBaaj ()
153
+ FFX_LoadGame .loadOffset (21 )
154
+ #FFX_LoadGame.LoadBaaj()
114
155
if Gamestate == "Baaj" and StepCounter == 5 :
115
156
FFX_LoadGame .LoadFirst ()
116
157
if Gamestate == "Besaid" and StepCounter == 1 : #Save pop-up after falling off of Rikku's boat
@@ -120,37 +161,31 @@ def reportGamestate():
120
161
if Gamestate == "Besaid" and StepCounter == 3 : #Crusader's lodge after "Enough, Wakka!"
121
162
FFX_LoadGame .loadOffset (29 )
122
163
while FFX_memory .userControl ():
123
- FFXC .set_value ('AxisLy' , 1 )
124
164
if FFX_memory .getCoords ()[0 ] > 0.5 :
125
- FFXC .set_value ( 'AxisLx' , 1 )
165
+ FFXC .set_movement ( 1 , 1 )
126
166
else :
127
- FFXC .set_value ( 'AxisLx' , 0 )
167
+ FFXC .set_movement ( 0 , 1 )
128
168
if Gamestate == "Boat1" : #Besaid beach before boarding SS Liki ( nice alliteration :D )
129
169
FFX_LoadGame .loadOffset (41 )
130
170
FFX_LoadGame .Boat1 ()
131
171
if Gamestate == "Kilika" and StepCounter == 1 : #Just after entering the woods
132
172
FFX_LoadGame .loadOffset (32 )
133
- FFXC .set_value ('AxisLy' , 1 )
134
- time .sleep (5 )
135
- FFXC .set_value ('AxisLx' , - 1 )
136
- FFXC .set_value ('AxisLy' , 0 )
173
+ FFXC .set_movement (0 , 1 )
137
174
time .sleep (5 )
138
- FFXC .set_value ('AxisLx' , 0 )
139
- FFXC .set_value ('AxisLy' , 0 )
140
- if Gamestate == "Kilika" and StepCounter == 3 : #Temple save sphere before scene with Donna
141
- FFX_LoadGame .KilikaTrials ()
175
+ FFXC .set_neutral ()
142
176
if Gamestate == "Luca" and StepCounter == 1 : # Approaching Luca via boat
143
177
FFX_LoadGame .loadOffset (46 )
144
178
if Gamestate == "Luca" and StepCounter == 3 : # after Oblitzerator, before Blitzball
145
- FFX_LoadGame .loadOffset (9 )
179
+ FFX_LoadGame .loadOffset (25 )
180
+ earlyHaste = 3
146
181
if Gamestate == "Luca" and StepCounter == 5 : # After Blitzball, before battles.
147
182
FFX_LoadGame .loadOffsetBattle (8 )
148
- earlyHaste = 1
183
+ earlyHaste = 3
149
184
#if Gamestate == "Luca" and StepCounter == 6: #After the talk with Auron
150
185
# FFX_LoadGame.loadPostBlitz()
151
186
if Gamestate == "Miihen" and StepCounter == 1 : #After the talk with Auron
152
- FFX_LoadGame .loadOffset (20 )
153
- FFX_LoadGame .LoadMiihenStart ()
187
+ FFX_LoadGame .loadOffset (33 )
188
+ FFX_LoadGame .LoadMiihenStart_Laugh ()
154
189
if Gamestate == "MRR" and StepCounter == 1 : #Mi'ihen North after meeting Seymour
155
190
FFX_LoadGame .loadOffset (18 )
156
191
FFX_LoadGame .LoadMRR ()
@@ -162,6 +197,7 @@ def reportGamestate():
162
197
if Gamestate == "Djose" and StepCounter == 2 : #Just before the Djose temple
163
198
FFX_LoadGame .djoseTemple ()
164
199
if Gamestate == "Moonflow" and StepCounter == 2 : #North bank, before Rikku
200
+ FFX_LoadGame .loadOffset (19 )
165
201
FFX_LoadGame .moonflow2 ()
166
202
if Gamestate == "Guadosalam" and StepCounter == 2 : #After the Farplane
167
203
FFX_LoadGame .loadOffset (3 )
@@ -181,9 +217,9 @@ def reportGamestate():
181
217
if Gamestate == "Macalania" and StepCounter == 6 : #Outside temple, before escaping.
182
218
FFX_LoadGame .loadOffset (15 )
183
219
time .sleep (0.5 )
184
- FFXC .set_value ( 'AxisLy' , 1 )
220
+ FFXC .set_movement ( 0 , 1 )
185
221
time .sleep (1.5 )
186
- FFXC .set_value ( 'AxisLy' , 0 )
222
+ FFXC .set_neutral ( )
187
223
time .sleep (0.5 )
188
224
if Gamestate == "Macalania" and StepCounter == 7 : #Before Wendigo
189
225
FFX_LoadGame .loadWendigo ()
@@ -192,6 +228,7 @@ def reportGamestate():
192
228
if Gamestate == "Home" and StepCounter == 2 :
193
229
FFX_LoadGame .loadOffset (4 )
194
230
if Gamestate == "rescueYuna" and StepCounter == 1 : # Airship, before pathing to the deck
231
+ FFX_LoadGame .loadOffset (30 )
195
232
FFX_LoadGame .loadRescue ()
196
233
if Gamestate == "rescueYuna" and StepCounter == 2 : # Bevelle trials
197
234
FFX_LoadGame .loadOffset (42 )
@@ -214,36 +251,15 @@ def reportGamestate():
214
251
FFX_LoadGame .loadOffset (35 )
215
252
FFX_LoadGame .zanTrials ()
216
253
if Gamestate == "Zanarkand" and StepCounter == 4 : # After Sanctuary Keeper
217
- FFX_LoadGame .loadOffset (1 )
254
+ FFX_LoadGame .loadOffset (9 )
218
255
if Gamestate == "Sin" and StepCounter == 2 : #Save sphere on the Highbridge before talking to Shedinja
219
- FFX_LoadGame .loadOffset (22 )
220
- if Gamestate == "Sin" and StepCounter == 3 : #Before "inside sin" pathing
256
+ FFX_LoadGame .loadOffset (27 )
257
+ if Gamestate == "Sin" and StepCounter == 4 : #Before point of no return
221
258
FFX_LoadGame .loadOffset (2 )
222
-
259
+ FFX_LoadGame . loadEggHunt ()
223
260
224
- #Movement files
225
- import FFX_DreamZan
226
- if gameLength != "short" :
227
- import FFX_Baaj
228
- import FFX_Besaid1
229
- import FFX_Besaid2
230
- import FFX_Boats
231
- import FFX_Kilika
232
- import FFX_Luca
233
- import FFX_Blitz
234
- import FFX_Miihen
235
- import FFX_MRR
236
- import FFX_Djose
237
- import FFX_Moonflow
238
- import FFX_Guadosalam
239
- import FFX_ThunderPlains
240
- import FFX_mWoods
241
- import FFX_mTemple
242
- import FFX_home
243
- import FFX_rescueYuna
244
- import FFX_Gagazet
245
- import FFX_Zanarkand
246
- import FFX_Sin
261
+
262
+ #Movement files - moved to FFX_compileAll.py
247
263
248
264
#try:
249
265
rikkucharged = 0
@@ -255,6 +271,7 @@ def reportGamestate():
255
271
Gamestate = "DreamZan"
256
272
time .sleep (0.5 )
257
273
FFX_DreamZan .NewGame (gameLength )
274
+ FFX_DreamZan .NewGame2 ()
258
275
startTime = FFX_Logs .timeStamp ()
259
276
FFX_Logs .writeStats ("Start time:" )
260
277
FFX_Logs .writeStats (str (startTime ))
@@ -409,32 +426,31 @@ def reportGamestate():
409
426
if Gamestate == "Luca" and StepCounter == 2 :
410
427
reportGamestate ()
411
428
FFX_Luca .preBlitz ()
429
+ endTime = FFX_Logs .timeStamp ()
430
+ totalTime = endTime - startTime
431
+ print ("Pre-Blitz time: " , str (totalTime ))
432
+ FFX_Logs .writeStats ("Pre Blitz time:" )
433
+ FFX_Logs .writeStats (totalTime )
412
434
if rngReviewOnly == True and earlyHaste == - 1 : # Used to run multiple tests via a single execution
413
435
Gamestate = "none"
414
436
StepCounter = 1
415
- FFXC .set_value ('AxisLy' , - 1 ) #Step away from the save sphere
416
- FFXC .set_value ('AxisLx' , 0 )
437
+ FFXC .set_movement (0 , - 1 ) #Step away from the save sphere
417
438
time .sleep (2 )
418
- FFXC .set_value ('AxisLy' , 0 )
419
- FFXC .set_value ('AxisLx' , 0 )
439
+ FFXC .set_neutral ()
420
440
import FFX_Reset
421
441
print ("------------------------------------------" )
422
442
print ("------------------------------------------" )
423
443
print ("Resetting" )
424
444
print ("------------------------------------------" )
425
445
print ("------------------------------------------" )
426
- FFXC .set_value ('AxisLx' , 0 )
427
- FFXC .set_value ('AxisLy' , 0 )
428
446
FFX_memory .clickToControl ()
429
- endTime = FFX_Logs .timeStamp ()
430
-
431
- totalTime = endTime - startTime
432
- print ("The game duration (real time) was: " , str (totalTime ))
447
+
448
+
433
449
#FFX_Logs.writeStats("Test duration:")
434
450
#FFX_Logs.writeStats(totalTime)
435
451
time .sleep (2 )
436
452
437
- FFX_Reset .resetToMainMenu (FFX_memory . getMap () )
453
+ FFX_Reset .resetToMainMenu ()
438
454
StepCounter = 1
439
455
rngSeedNum += 1
440
456
FFX_Logs .nextStats (rngSeedNum ) #Start next stats file
@@ -454,7 +470,7 @@ def reportGamestate():
454
470
if Gamestate == "Luca" and StepCounter == 4 :
455
471
reportGamestate ()
456
472
blitzWin = FFX_Blitz .blitzMain (forceBlitzWin )
457
- FFX_Screen .awaitSave ()
473
+ FFX_Xbox .awaitSave ()
458
474
StepCounter = 5
459
475
460
476
@@ -476,7 +492,14 @@ def reportGamestate():
476
492
477
493
if Gamestate == "Miihen" and StepCounter == 2 :
478
494
reportGamestate ()
479
- #FFX_Miihen.wrapUp()
495
+
496
+ #Report duration at the end of Mi'ihen section for all runs.
497
+ endTime = FFX_Logs .timeStamp ()
498
+ totalTime = endTime - startTime
499
+ print ("Mi'ihen End timer is: " , str (totalTime ))
500
+ FFX_Logs .writeStats ("Miihen End time:" )
501
+ FFX_Logs .writeStats (totalTime )
502
+
480
503
if rngReviewOnly == True and rngSeedNum - rngSeedOrig < 5 : # Used to run multiple tests via a single execution
481
504
Gamestate = "none"
482
505
StepCounter = 1
@@ -486,18 +509,12 @@ def reportGamestate():
486
509
print ("Resetting" )
487
510
print ("------------------------------------------" )
488
511
print ("------------------------------------------" )
489
- FFXC .set_value ('AxisLx' , 0 )
490
- FFXC .set_value ('AxisLy' , 0 )
512
+ FFXC .set_neutral ()
491
513
FFX_memory .clickToControl ()
492
- endTime = FFX_Logs .timeStamp ()
493
514
494
- totalTime = endTime - startTime
495
- print ("The game duration (real time) was: " , str (totalTime ))
496
- FFX_Logs .writeStats ("Test duration:" )
497
- FFX_Logs .writeStats (totalTime )
498
515
time .sleep (2 )
499
516
500
- FFX_Reset .resetToMainMenu (FFX_memory . getMap () )
517
+ FFX_Reset .resetToMainMenu ()
501
518
StepCounter = 1
502
519
rngSeedNum += 1 #Start next stats file
503
520
FFX_Logs .nextStats (rngSeedNum )
@@ -513,7 +530,7 @@ def reportGamestate():
513
530
if Gamestate == "MRR" and StepCounter == 1 :
514
531
reportGamestate ()
515
532
wakkaLateMenu = FFX_MRR .arrival ()
516
- FFX_MRR .mainPath (wakkaLateMenu )
533
+ FFX_MRR .mainPath (wakkaLateMenu [ 0 ] )
517
534
if FFX_memory .gameOver ():
518
535
Gamestate = "gameOverError"
519
536
StepCounter = 2
@@ -684,7 +701,7 @@ def reportGamestate():
684
701
685
702
#In case we're loading mid game...
686
703
if endGameVersion == 0 :
687
- endGameVersion = 4
704
+ endGameVersion = 1
688
705
# 1 = two Return spheres, two Friend spheres
689
706
# 2 = two Return spheres, two Friend spheres
690
707
# 3 = Game over (four Friend spheres)
@@ -748,9 +765,12 @@ def reportGamestate():
748
765
749
766
if Gamestate == "Sin" and StepCounter == 3 :
750
767
reportGamestate ()
751
- FFX_Sin .insideSin (gameLength , autoEggHunt , rngSeedNum )
752
- FFX_Battle .BFA ()
768
+ FFX_Sin .insideSin ()
753
769
StepCounter = 4
770
+
771
+ if Gamestate == "Sin" and StepCounter == 4 :
772
+ FFX_Sin .eggHunt (autoEggHunt )
773
+ FFX_Battle .BFA ()
754
774
Gamestate = "End"
755
775
756
776
#print("Waiting for Yu Yevon to die.")
0 commit comments