Tree Array bug is fixed and Multi array solve needs to add last command before sending to master array

This commit is contained in:
2024-10-16 08:11:39 -04:00
parent 132d7d43c4
commit 6df92902ac

View File

@@ -11,7 +11,8 @@ var Intersections = [[]]
var Intersections_Copy = [] var Intersections_Copy = []
var Distance_From_Intersection = 0 var Distance_From_Intersection = 0
var Tree_Array = [99] var Tree_Array = [99]#[99]
var Tree_Array_SetStart = 99
var Options = [] var Options = []
var BackTrack_Array = [] var BackTrack_Array = []
var Traveled = false var Traveled = false
@@ -53,6 +54,7 @@ var Move_Check7 = 0
var Move_Check4 = 0 var Move_Check4 = 0
var Move_Check9 = 0 var Move_Check9 = 0
var Move_Check10 = 0 var Move_Check10 = 0
var Move_Check1 = 0
var Cicling = false var Cicling = false
var CircleIntsMax = 0 var CircleIntsMax = 0
var CircleInts = 0 var CircleInts = 0
@@ -77,7 +79,7 @@ var FirstGoTo = []
var AllSetsToGoal = [] var AllSetsToGoal = []
var TargetsArray = [] var TargetsArray = []
var Goal = false var Goal = false
#TODO Fix TREE ARRAY BUG
func _input(event): func _input(event):
#if Current_Position != TargetCord: #if Current_Position != TargetCord:
if event.is_action_pressed("ui_left"): if event.is_action_pressed("ui_left"):
@@ -98,9 +100,10 @@ func _input(event):
AutoBacktrack = false AutoBacktrack = false
elif event.is_action_pressed("ui_accept"): elif event.is_action_pressed("ui_accept"):
AutoSolve() AutoSolve()
#print(Tree_Array)
func _process(delta): func _process(delta):
#FoundGoal() FoundGoal()
AllObjectsFound() AllObjectsFound()
CallableRaycastData() CallableRaycastData()
Mark(Prev_dir) Mark(Prev_dir)
@@ -119,7 +122,7 @@ func _process(delta):
IntersectionDumping() IntersectionDumping()
CordsDumping() CordsDumping()
FinishCircling() FinishCircling()
print(Tree_Array)
#if Detail_Dict.Type == "3 Way Intersection": #if Detail_Dict.Type == "3 Way Intersection":
# print(Individual_Steps) # print(Individual_Steps)
#print(Detail_Dict.Type) #print(Detail_Dict.Type)
@@ -143,18 +146,20 @@ func _process(delta):
func FoundGoal(): func FoundGoal():
if TargetCord.find(Current_Position) != -1 and TargetsArray.find(Current_Position) == -1: if TargetCord.find(Cords[-1]) != -1 and TargetsArray.find(Cords[-1]) == -1:
Goal = true Goal = true
print("GOAL!!!!!!!!!!!") print("GOAL!!!!!!!!!!!")
print(Current_Position)
if Done != move: if Done != move:
print("Circling is: ", Cicling) print("Circling is: ", Cicling)
print("Current Pos: ", Current_Position) print("Current Pos: ", Current_Position)
print(Intersections) print(Intersections)
Mark(Prev_dir) #Mark(Prev_dir)
TrackIntersections() #TrackIntersections()
BackToStart() #BackToStart()
TargetsArray.push_back(Current_Position) TargetsArray.push_back(Current_Position)
AllSetsToGoal.push_back(Individual_Steps) AllSetsToGoal.push_back(Individual_Steps)
print(BackTrack_Array)
AllSetsToGoal.push_back(" BUFFER ") AllSetsToGoal.push_back(" BUFFER ")
var TargetCopy = TargetsArray.duplicate(true) var TargetCopy = TargetsArray.duplicate(true)
var SetsCopy = AllSetsToGoal.duplicate(true) var SetsCopy = AllSetsToGoal.duplicate(true)
@@ -163,10 +168,13 @@ func FoundGoal():
print("Here is the Set to go to young bull: ",AllSetsToGoal) print("Here is the Set to go to young bull: ",AllSetsToGoal)
Done = move Done = move
func AllObjectsFound(): func AllObjectsFound():
if Tree_Array.is_empty() and IntersectionDump.size() > 0: if Tree_Array_SetStart != Tree_Array[0]:
print("Solved") if Move_Check1 != move:
return true print("We Done!!!!!!!!!!!!!!!!!")
print("This is all the sets to goal gango", AllSetsToGoal)
Move_Check1 = move
func Mark(Prev_Direction): func Mark(Prev_Direction):
@@ -466,16 +474,17 @@ func Intersection_Tree():
Move_Check2 = move Move_Check2 = move
func CheckForTreeDeadEnds(): func CheckForTreeDeadEnds():
if Tree_Array[-1] <= 0:
Tree_Array[- 1] -= 1 if Tree_Array.size() > 0:
print(Individual_Steps[0]) if Tree_Array[-1] <= 0:
if Tree_Array.size() > 0: Tree_Array.pop_back()
Tree_Array[-1] -= 1
print(Tree_Array)
GoBack(Individual_Steps[0]) GoBack(Individual_Steps[0])
Individual_Steps.pop_front() Individual_Steps.pop_front()
Tree_Array.pop_back()
print(Tree_Array) else:
else: pass
pass
func GiveOrder(): func GiveOrder():
if Cicling == false: if Cicling == false: