I'm trying to find a way to loop specific code blocks without losing any of the recorded attributes that were done inside the block.
i.e. my code flows like this:
setup environment (button)
setup drivers (button)
go: (button which incorporates the below)
1. trip assign
2. move-drivers
3. check-distance
tick
end
The code starts out with a number of drivers put in by the user and once I hit go after setup they get assigned a specific trip with variables like a color relating to a specific purpose, drive distance limits etc and then start to move in a systematic way. Every forward movement is recorded as +1 drive distance and once they hit the limit assigned they stop.
The issue is that once each driver stops (reaches distance lim) I want to record this as 1 trip for them and to loop (# of times determined by a variable I made ) them back to the trip assignment, motion and check distance portion (with new fresh assignments) without losing my total distance figures or any of the variables they've recorded. i.e. I want to simulate multiple trips for each driver recorded within the one run.