Quote:
Originally Posted by martin53
To stay indeppendent from number of instances, maybe better style to define inside RTE, after check that they're undefined:
Code:
GScriptClip("""
...
try { __ = RTE_myVar%%%%%% } catch(err) { global RTE_myVar%%%%%% = 0 }
...
first use of RTE_myVar%%%%%% in RTE
...
""", local=true)
|
An alternative would be to initialise in the function, but outside the RTE, avoiding a try/catch on each frame.
Code:
Eval("global RTE_myVar"+string(RTE_InstanceNumber)+"=0")
Both approaches are a bit ugly!
If staying with the try/catch approach, note the assignment to __ is unnecessary:
Code:
try { RTE_myVar%%%%%% } catch(err) { global RTE_myVar%%%%%% = 0 }