Firstly, I dont know if "return;" is valid in events (ie my_event).
Change them to the more conventional "break;" instead.
With the code you have it will work exactly the same.
(NOTE :: this has nothing to do with your error...)

Secondly, change the string definitions 'rec_str' and 'temp_str' to
STRING* rec_str = str_create("_______"); // stores the name of the recorded data file
STRING* temp_str = str_create("___"); // just a temporary string

I hate seeing those retro definitions, and they can fail un-expectedly if the
data you put in them overflows.
(NOTE :: this MAY have something to do with your error...)

Thirdly, the name of the play function is not 'correct'.
I dont know if you are allowed to pass parameters to an "action'.
Change it to "function play(entity_number)" instead, for safety.
(NOTE :: this MAY have something to do with your error...)

And finally, and most concerning...
Are you certain that the ME/MY entitiy is alive the whole time?
In the "while(temp < count)" loop, every time you perform a "wait"
there is the chance that ME is no longer valid, but you are not checking.
If ME gets removed by some other function, this loop will still attempt
to change the pan and pos of ME, causing a crash.
(NOTE :: this MOST LIKELY is the cause of your error...)


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial