As per above, nope--
What I've usually done, in the case where there needs to be a timing script that might be called by many different objects that each need to track their own time is something simple like this:
myTimer = timing_script(myTimer);
I can set up something where myTimer starts as -1 (Create event), and then passes the time into the script; the script then passes the time back out again, so the calling instance keeps track of its own time. In this way, the script has no internal concept of time and just uses the input value instead, making it flexible and capable of working with multiple objects that have different times.
Sometimes, you'll need to return other values, and then an array is just as easy:
Create event: myTimedData = -1;
Somewhere else, like
Step event:
myTimedData = do_things_involving_timers(myTimedData);
infoFromScript = myTimedData[0];
In that setup, the script does something like this:
Code:
/// @description script do_something_involving_timers
/// @arg parameterArray
var params = argument[0];
if(is_array(params)){
var time = params[1]; // If parameters exist, use the second element in the array for "time"
}else{
var time = 0; // If no params exist, start timer at zero
}
/*
* Do stuff, compute things, modify time,
* compute return value.
*/
return [computedValue, time];
A script like that will send in -1 at the start, which will begin the timer at zero, then the script does whatever you want and basically returns
two values instead of one. The first value is whatever the script was
supposed to compute. The second value is the timer that you want to keep track of. In this way, it's easy to obtain the computed value for the script, while also maintaining an array of data that will get sent back into the script on the next step, enabling it to track time.
I use this same technique for things like menus that need to draw every step while remembering which option is highlighted and also remembering how far down the menu has been scrolled. Everything is computed while drawing, then returned as an array that is used in the next running of the script to preserve the data from the previous run-through.