Events after onTileScript has been processed? [solved]
by Max Kielland · in Torque Game Builder · 01/29/2013 (8:06 am) · 2 replies
Hi,
I need to run some initialisation after all the tiles have called the onTileScript.
I have single stepped through the whole project and the onTileScript is called after initializeProject() in main.cs There seems to be no code or events after the onTileScript has been processed and the game actually starts (I guess onTileScript is called when the game has started).
Is there any event I can hook up to to get called after the tileMap has called all the tile layer's onTileScript?
I need to run some initialisation after all the tiles have called the onTileScript.
I have single stepped through the whole project and the onTileScript is called after initializeProject() in main.cs There seems to be no code or events after the onTileScript has been processed and the game actually starts (I guess onTileScript is called when the game has started).
Is there any event I can hook up to to get called after the tileMap has called all the tile layer's onTileScript?
About the author
Owner of MK Development www.mkdevelopment.se
#2
So the short answer is: No there is no callback available for this purpose.
Okay It seems like I have to recompile the source. I have severe problems with reading the mouse buttons anyway so it seems like a good idea to do some changes and recompile.
Thank you.
02/02/2013 (6:22 am)
t2dSceneGraph::onUpdateScene(%this) is called on every single frame and it feels a bit odd to put in logic to only fire once on the first frame.So the short answer is: No there is no callback available for this purpose.
Okay It seems like I have to recompile the source. I have severe problems with reading the mouse buttons anyway so it seems like a good idea to do some changes and recompile.
Thank you.
Associate William Lee Sims
Machine Code Games
If you just need to be generally correct, you could implement t2dSceneGraph's "onUpdateScene" callback.
If you need to be exactly right, you'll need to add a callback at the end of t2dTileLayer::renderObject:
Now the t2dTileLayer will have an "onRenderComplete" callback which is also after the last "onTileScript" has been called.