lfnetwork.com mark read register faq members calendar

Thread: Auto Map Cycle doesnt work allways
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 08-08-2006, 05:51 PM   #1
jedi-Guard
Rookie
 
Join Date: Sep 2005
Posts: 207
Auto Map Cycle doesnt work allways

Need help with g_automapcycle
When i have the configuration like this
seta g_automapcycle "1"
seta bot_enable "0"
after duel_fraglimit, it wont load other map.
If i change the seta bot_enable "1".
so it looks like this
seta g_automapcycle "1"
seta bot_enable "1"
It works then.
How can i solv this problem, so Auto Map Cycle works while bot_enable is disabled

jedi-Guard is offline   you may: quote & reply,
Old 08-13-2006, 12:13 AM   #2
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
I don't see why bot_enable would even be causing problems. bot_enable has nothing to do with g_autoMapCycle. Another thing I should mention is that I have found many people who tend to lean to using JA+ seem to thing seta is the best way to set stuff, its not. using set is technically the best option as it doesn't throw all your junk into jampconfig.cfg or jampserver.cfg.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 08-14-2006, 11:03 AM   #3
jedi-Guard
Rookie
 
Join Date: Sep 2005
Posts: 207
Try to add seta bot_enable "0" in server.cfg
and seta g_automapcycle "1" also in server.cfg
open jampconfig.cfg and delete everything there
and start the dedicated server, not by the jampwinded.exe, but throught jamp.exe without joining the game.
Remember its a none mode server, which means it has no extra files, not even the jampwinded.exe
If you do it my way, you see what i mean, if you do something wrong, then you havnt understod what i said.
jedi-Guard is offline   you may: quote & reply,
Old 08-14-2006, 04:27 PM   #4
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
suz but why would i clear my config?

what is the point of disabling bot_enable for anyway? just dont set bot_minplayers and you wont get any bots.

and here's your answer because it was meant to only be used with bot_enable i guess:

follow this because it seems it was designed this way on purpose:
G_InitBots->G_LoadArenas->G_RefreshNextMap

Code:
	if ( trap_Cvar_VariableIntegerValue( "bot_enable" ) ) {
		BotAISetup( restart );
		BotAILoadMap( restart );
		G_InitBots( restart );
	}
Code:
/*
===============
G_InitBots
===============
*/
void G_InitBots( qboolean restart ) {
	G_LoadBots();
	G_LoadArenas();

	trap_Cvar_Register( &bot_minplayers, "bot_minplayers", "0", CVAR_SERVERINFO );

	//rww - new bot route stuff
	LoadPath_ThisLevel();
	//end rww
}
Code:
/*
===============
G_LoadArenas
===============
*/
static void G_LoadArenas( void ) {
	int			numdirs;
	char		filename[128];
	char		dirlist[1024];
	char*		dirptr;
	int			i, n;
	int			dirlen;

	g_numArenas = 0;

	// get all arenas from .arena files
	numdirs = trap_FS_GetFileList("scripts", ".arena", dirlist, 1024 );
	dirptr  = dirlist;
	for (i = 0; i < numdirs; i++, dirptr += dirlen+1) {
		dirlen = strlen(dirptr);
		strcpy(filename, "scripts/");
		strcat(filename, dirptr);
		G_LoadArenasFromFile(filename);
	}
//	trap_Printf( va( "%i arenas parsed\n", g_numArenas ) );
	
	for( n = 0; n < g_numArenas; n++ ) {
		Info_SetValueForKey( g_arenaInfos[n], "num", va2( "%i", n ) );
	}

	G_RefreshNextMap(g_gametype.integer, qfalse);
}
Code:
extern siegePers_t g_siegePersistant; //g_saga.c
//rww - auto-obtain nextmap. I could've sworn Q3 had something like this, but I guess not.
const char *G_RefreshNextMap(int gametype, qboolean forced)
{
	int			typeBits = 0;
	int			thisLevel = 0;
	int			desiredMap = 0;
	int			n = 0;
	char		*type = NULL;
	qboolean	loopingUp = qfalse;
	vmCvar_t	mapname;

	if (!g_autoMapCycle.integer && !forced)
	{
		return NULL;
	}

	if (!g_arenaInfos[0])
	{
		return NULL;
	}

	trap_Cvar_Register( &mapname, "mapname", "", CVAR_SERVERINFO | CVAR_ROM );
	for( n = 0; n < g_numArenas; n++ )
	{
		type = Info_ValueForKey( g_arenaInfos[n], "map" );

		if (Q_stricmp(mapname.string, type) == 0)
		{
			thisLevel = n;
			break;
		}
	}

	desiredMap = thisLevel;

	n = thisLevel+1;
	while (n != thisLevel)
	{ //now cycle through the arena list and find the next map that matches the gametype we're in
		if (!g_arenaInfos[n] || n >= g_numArenas)
		{
			if (loopingUp)
			{ //this shouldn't happen, but if it does we have a null entry break in the arena file
			  //if this is the case just break out of the loop instead of sticking in an infinite loop
				break;
			}
			n = 0;
			loopingUp = qtrue;
		}

		type = Info_ValueForKey(g_arenaInfos[n], "type");
		
		typeBits = G_GetMapTypeBits(type);
		if (typeBits & (1 << gametype))
		{
			desiredMap = n;
			break;
		}

		n++;
	}

	if (desiredMap == thisLevel)
	{ //If this is the only level for this game mode or we just can't find a map for this game mode, then nextmap
	  //will always restart.
		trap_Cvar_Set( "nextmap", "map_restart 0");
	}
	else
	{ //otherwise we have a valid nextmap to cycle to, so use it.
		type = Info_ValueForKey( g_arenaInfos[desiredMap], "map" );
		trap_Cvar_Set( "nextmap", va2("map %s", type));
	}

	return Info_ValueForKey( g_arenaInfos[desiredMap], "map" );
}
It is required because autoMapCycle needs to be able to read the arenas which it cannot do without bot_enable activated because the arena files are not loaded on the server otherwise.


iojamp project lead / coder

Last edited by ensiform; 08-14-2006 at 04:40 PM.
ensiform is offline   you may: quote & reply,
Old 08-14-2006, 07:38 PM   #5
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,187
Ensiform, you seem to know more about this than I do. Does seta automatically force that cvar setting into the currently being used .cfg?

Also, what does "sets" do? I've seen that used a few times.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 08-15-2006, 02:45 PM   #6
jedi-Guard
Rookie
 
Join Date: Sep 2005
Posts: 207
Its not about the needs or no needs of the Bot_enable command.
Its about getting the things the rightway to work, since there can be too many bugs as there can be too many misunderstanding talk between dedicated administrators.
Thats the way it is, and thats the way its gonna be. :P
jedi-Guard is offline   you may: quote & reply,
Old 08-15-2006, 04:23 PM   #7
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Quote:
Originally Posted by razorace
Ensiform, you seem to know more about this than I do. Does seta automatically force that cvar setting into the currently being used .cfg?

Also, what does "sets" do? I've seen that used a few times.
Seta = Set + Archive in jampconfig.cfg (if using jamp.exe in win) or jampserver.cfg (if using jampDed) This can cause problems and has been known to in the engine since Q3 1.16. for one, MAX_CVARS is 1024, this includes any scripts for vstrs.

Set = just adds the cvar to current and wont store it in another config.

Sets = same as set but append CVAR_SERVERINFO.

There is setu also for userinfo but you can only call this from client/ui modules.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Help Center > Dedicated Server > Auto Map Cycle doesnt work allways

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:17 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.