Game Development Community

Identifying the loaded level

by Konrad Carstein · in Torque Game Builder · 01/10/2009 (1:37 am) · 4 replies

Hi,

What would be the best way to determine which level has been loaded into a particular window? I see a lot of get methods in the t2dSceneWindow object.

I'm just looking for a way to confirm which level is loaded before I call .endLevel().

Thanks in advance!

#1
01/10/2009 (11:32 pm)
I'll try to expand, maybe i'm not describing my situation very well.

I'm creating some simple menus using the level editor. I then load this menu into a T2DSceneWindow that I've created that lays over the top of the sceneWindow2D.

I can easily display and hide the menu by changing the the visibility of the scene window. However I have more then one menu type that could be loaded into the scene window. So if I write a function like showMenu1() for instance. I want to confirm that the correct level file is loaded into the scenewindow before I change the visibility. If not, I can load it first. I'm just not having any lucking finding a way to scene which level file is loaded.

Thanks!
#2
01/11/2009 (1:00 am)
You could give one of your scene objects (or add a new one) a scriptname for identification.
#3
01/11/2009 (1:42 am)
Why not set global vars when you load the level and just query those?
#4
01/11/2009 (6:25 pm)
I can set the global var, that would work. I was just looking to see if there was a more graceful method of checking the scene window at any given time to see what was loaded. Otherwise, I just have to manage another global var anytime something gets loaded.

Sounds like that might be the only way at this point though.