ETMods.net

N!tmod, a Wolfenstein: Enemy Territory Modification!

You are not logged in.

Announcement

You can donate to help us keeping services online.

#1 03-Jun-13 23:33:08

Gauki
BETA Tester
From: Germany
Registered: 30-Aug-12
Posts: 114
Website

enable/disable bots on eacht map

is it possible to enalbe and disable bots on each map? (mapscript ?- kick bots after mapstart?? )

example: oasis: 6 bots

fueldump 4 bots

map xy: 0 bots

?

thx in advance wink


DooC_sigbanner.gif

Offline

#2 04-Jun-13 02:24:38

ailmanki
BETA Tester
Registered: 08-Jun-12
Posts: 42
Website

Re: enable/disable bots on eacht map

create a mapconfig for those maps, and add the cvars and bot comands to it..

bot maxbots 4
bot kickall ...

If you use map voting, you might have troubles with maps which do mixcase in the name like Fata_Morgana.


b_350_20_692108_381007_FFFFFF_000000.pngb_350_20_692108_381007_FFFFFF_000000.png

Offline

#3 04-Jun-13 20:42:05

Gauki
BETA Tester
From: Germany
Registered: 30-Aug-12
Posts: 114
Website

Re: enable/disable bots on eacht map

oki, thats what i thought! but how can i tell it bots should remove for example after warmup ?


DooC_sigbanner.gif

Offline

#4 05-Jun-13 05:50:28

ailmanki
BETA Tester
Registered: 08-Jun-12
Posts: 42
Website

Re: enable/disable bots on eacht map

I think it is not possible todo that with mapconfigs. As far as I know the mapconfig is executed on start of warmup, and then again on start of map.
Unless I missed something big_smile, I think thats only possible with lua.

edit: it might be possible todo some fancy mapscript, I think there was a way to detect warmup. But if its then possible to send a command to omnibot from the mapscript - that I doubt.

Last edited by ailmanki (05-Jun-13 06:00:25)


b_350_20_692108_381007_FFFFFF_000000.pngb_350_20_692108_381007_FFFFFF_000000.png

Offline

#5 05-Jun-13 21:36:23

Micha
Member
From: Germany
Registered: 11-Feb-13
Posts: 38
Website

Re: enable/disable bots on eacht map

Put this in a lua file for example: bot.lua
Then check in server.cfg for lua_modules and change the value: set lua_modules "bot.lua"

--change this value to change bot behavier
botbehavier = 3
			-- 1: bot amount depends on match status (warmup, running)
			-- 2: bot amount depends on map
			-- 3: both  (1+2 behavier)
			
--enter your mapnames and bot value here 
--(format must be the same as the example!)
map_table = {
	{ mapname = "adlernest", 		botamount = "1", },        
	{ mapname = "radar",			botamount = "2", },
	{ mapname = "oasis",			botamount = "7", },
	{ mapname = "et_ice",			botamount = "8", },
}

--amount of bots playing while on warmup (botbehavier 1 or 3)
warmupbots = 6

--------------------------------------------END OF CONFIG--------------------------------------------------------

function et_InitGame(leveltime, randomseed, restart)
    gamestate = tonumber(et.trap_Cvar_Get( "gamestate" ))
	mapnames = et.trap_Cvar_Get( "mapname" )
	
	--Game status bot amount
	--gamestate: 0 game running, 1 all players ready, 2 warmup, 3 intermission
	if gamestate == 0 then
		if botbehavier == 1 or botbehavier == 3 then
			et.trap_SendConsoleCommand( et.EXEC_APPEND, "bot maxbots 0\n" )
			et.trap_SendConsoleCommand( et.EXEC_APPEND, "bot kickall\n" )
		end
	elseif gamestate == 2 then
		if botbehavier == 1 or botbehavier == 3  then
			et.trap_SendConsoleCommand( et.EXEC_APPEND, "bot maxbots "..warmupbots.."\n" )
		end
	end
	
	--Map bot amount
	for _, line in ipairs(map_table) do
		if mapnames == line.mapname then
			local botamount = line.botamount
			if botbehavier == 2 or (botbehavier == 3 and gamestate == 2) then
				et.trap_SendConsoleCommand( et.EXEC_APPEND, "bot maxbots "..botamount.."\n" )
			end
		end
	end

end

Last edited by Micha (05-Jun-13 22:38:01)

Offline

#6 09-Jun-13 15:50:37

Gauki
BETA Tester
From: Germany
Registered: 30-Aug-12
Posts: 114
Website

Re: enable/disable bots on eacht map

micha u are my hero smile will test it tomorrow ^^


DooC_sigbanner.gif

Offline

Board footer

Powered by FluxBB