adding function to generate the trajectory files for the 'player script'