I'm wanting to split up a script into functions for easier management and performance reasons. I have a script attached to a torch. The torch is not a persistent reference, it becomes a reference through dropping or the use of PlaceAtMe (which I clean up the reference after it is generated). There ios some math that runs each frame, and I'd like to put that off into a function so that it only gets called when needed. Good for performance (which will be negligable, I know, but it will be done), and good for tidiness. I'm wondering what is the best way to access the torch reference in the function script, which will be called from the torch object script. You need a quest or persistent reference to access a reference from another script, but is there another way? I've tried the ol' "MoveTo" technique of setting the torch form into a dummy cell and moving it from that cell. But it didn't work too well. Because of the nature of the mod, the multiple torches can be in the game world at any one time. So the references get mixed (I think).
So, how can I access a reference from an object script attched to a torch? The reference is the torch itself.