From 1722272b79d89bef506df586c8631d7a1cfdc86d Mon Sep 17 00:00:00 2001 From: Jamal Millner II Date: Thu, 10 Oct 2024 08:08:52 -0400 Subject: [PATCH] Fully autonomous maybe a couple more tweaks left --- PlayerScript.gd | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/PlayerScript.gd b/PlayerScript.gd index eca97d5..49d3221 100644 --- a/PlayerScript.gd +++ b/PlayerScript.gd @@ -202,6 +202,10 @@ func Circling(): print(Individual_Steps) Cicling = false print("Circling is false!!!!") + for ints in CircleIntsMax+1: + Tree_Array.pop_back() + Tree_Array[-1] -= 1 + print(Tree_Array) if CircleInts != 0: print("Go back to circle part :(") @@ -214,7 +218,7 @@ func HowManyIntsInCircle(): CircleIntsMax = Intersections.size() - (Intersections.find(Current_Position)+1) CircleInts = CircleIntsMax for n in CircleInts: - if Tree_Array[-(n+1)] == 1: + if Tree_Array[-(n+1)] == 1: CircleInts -= 1 print(CircleInts) @@ -229,8 +233,10 @@ func FirstCirclePart(): print("This is X: ",Skipping_array[0]) + print(Tree_Array) + #print("The tree array at last int is: ",Tree_Array[Skipping_array[0]]) - if Tree_Array[Skipping_array[0]] == 1: + if Tree_Array[Tree_Array.size() - 1] == 1: #Tree_Array[Skipping_array[0]] == 1: print("Skip") Skip() @@ -299,6 +305,9 @@ func FinishCircling(): GoBack(Individual_Steps[0]) Individual_Steps.pop_front() print(Individual_Steps) + for ints in CircleIntsMax+1: + Tree_Array.pop_back() + Tree_Array[-1] -= 1 else: print("Its Off the Root!!!") Cicling = false @@ -308,6 +317,10 @@ func FinishCircling(): Individual_Steps.pop_front() print("Its On the Root!!!") print(Individual_Steps) + for ints in CircleIntsMax+1: + Tree_Array.pop_back() + Tree_Array[-1] -= 1 + print(Tree_Array) Move_Check10 = move func DeadEndCircles(): @@ -520,6 +533,7 @@ func AutoSolve(): var cp = Current_Position var OptionArrays = [[cp[0],cp[1]+1],[cp[0],cp[1]-1],[cp[0]+1,cp[1]],[cp[0]-1,cp[1]]] + for n in DirectionStrengths.size(): var MoveScore = DumpDuplicate.rfind(DirArray[n]) if Colliders[n] == true: @@ -542,10 +556,12 @@ func AutoSolve(): #print(Set) if IntOptions[Set].find(DirArray[n]) == -1: DirectionStrengths[n] -= 1000 - for i in OptionArrays: if Intersections.find(i) != -1: DirectionStrengths[n] -= 100 + if Cicling == true: + print("ITS CIRCLING DO SOME MODS") + print(IntOptions ) AutoBacktrack = false var HighestPoints = DirectionStrengths.find(max(DirectionStrengths[0],DirectionStrengths[1],DirectionStrengths[2],DirectionStrengths[3])) print(DirectionStrengths)