Counterbalancing across Trial Types

OS: Windows 10
PsychoPy version: 2021.2.2
Standard Standalone?: Y
What are you trying to achieve?: Our experiment has 4 trial types (A, B, C and D), each trial displays 4 images (1, 2, 3, 4). We would like to counterbalance the image order across trial types in such a way that the image orders are counterbalanced across the entire experiment (and not just within trial type A/B/C/D). The experiment is currently set up to randomize the order of each trial type and play all 4 types, followed by an attention task and then loop back to repeat. The trials are repeated 32 times in this experiment. We have created an excel file containing the counterbalanced image orders (ranging from 1-32). We want all 32 counterbalanced image orders to play, randomized without repeat, regardless of trial type A/B/C/D.

What did you try to make it work?: I created 2 loops around the trial type, going from outside in: Trial_Type, Trial_File. Trial_Type contains the path to a different excel file for each of the 4 condition types. Within each of those excel files is a file path to the images for each image order combination (Columns: Image_1_Path, Image_2_Path, etc.). Trial_File references those spreadsheets, $ImageOrder. Within the trial, the images reference $Image_1_Path etc.

What specifically went wrong when you tried that?:

As it is right now when I run this experiment it goes through all 32 renditions of the image order before continuing. Additionally, I have also been able to get this experiment to work by randomly picking 1 of the 32 image orders each time it cycles through the trial loop, but this does not keep track of which image orders have been chosen across the entire experiment.