Get map name while loading?⎷⎛⎝

Hello gentlemen,
I come here to ask you guys if there is a way to get the name of the map right after you join the server, while loading and before the loading screen goes away. I need to be able to for a project I am working on and it would be of great help. Thank you.

FYI: game.GetMap() does NOT work while loading.

This would only be possible in the menu environment. The client state doesn’t exist yet at that point.

When you say menu environment, do you mean the VGUI and GUI? Because I am rebuilding the loading menu and have access to those command.

Why did you mess up the formatting of the forum?



It makes my question stick out. :stuck_out_tongue:

When I say it would be possible, it would be because you have queried the master server list, made your own list of servers and already know the map the server you are joining is running.

Ya true true. I really didn’t want to have to map a whole menu system, but I could. Not that hard. :slight_smile:
Thanks crazy.

	if( g_ClientEngine )
		const char* strMap = g_ClientEngine->GetLevelName();
		gLua->Push( ( strMap != NULL ? strMap : "" ) );
	} else {
		gLua->Push( "" );
	return 1;

Yay lua modules in the menu environment!