From 40db904a6c3112d26d4fde5416be63a319ff4faa Mon Sep 17 00:00:00 2001 From: Jamal Millner II Date: Fri, 18 Oct 2024 08:09:42 -0400 Subject: [PATCH] Breaking up the Pathfinding algorythm that I would send to the drone!!! Going good so far need to scrape last dataset --- PlayerScript.gd | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/PlayerScript.gd b/PlayerScript.gd index 50187b6..f17fafb 100644 --- a/PlayerScript.gd +++ b/PlayerScript.gd @@ -157,23 +157,44 @@ func FoundGoal(): #Mark(Prev_dir) #TrackIntersections() #BackToStart() + var LastStep = [] + var IndividualStepsCopy = [] + LastStep = Ordered_Commands_Backward.duplicate(true) + LastStep.reverse() + LastStep.push_front(Prev_dir_Opp) + IndividualStepsCopy = Individual_Steps.duplicate(true) + IndividualStepsCopy.push_front(LastStep) TargetsArray.push_back(Current_Position) - AllSetsToGoal.push_back(Individual_Steps) + + AllSetsToGoal.push_back(IndividualStepsCopy) print(BackTrack_Array) - AllSetsToGoal.push_back(" BUFFER ") var TargetCopy = TargetsArray.duplicate(true) var SetsCopy = AllSetsToGoal.duplicate(true) TargetsArray = TargetCopy AllSetsToGoal = SetsCopy - print("Here is the Set to go to young bull: ",AllSetsToGoal) + print("Here is the Set to go to young bull: ") + Done = move func AllObjectsFound(): if Tree_Array_SetStart != Tree_Array[0]: if Move_Check1 != move: print("We Done!!!!!!!!!!!!!!!!!") - print("This is all the sets to goal gango", AllSetsToGoal) + print() + #for n in AllSetsToGoal.size(): + # print(n ," set is equal to : ", AllSetsToGoal[n] ) + # print() + + for n in AllSetsToGoal.size(): + var PrimaryPlaceHolder = AllSetsToGoal[n] + if n + 1 < AllSetsToGoal.size(): + var SearchPlaceHolder = AllSetsToGoal[n + 1] + print("Search Placeholder ",n, " is : ", SearchPlaceHolder ) + for i in SearchPlaceHolder: + print("The Broken up pieces is: ",i) + + Move_Check1 = move