![]() |
Best way to detect the maps types ?
Ok I suspect that EPB didn't detect the CS maps correct. So I ask how is the best way to detect the map types? Maybe with the hostage models in the map or with bomb targets in to the DE maps ? Then how to detect the AWP maps and FY maps? Is there a way to read the name of the map and if the name start with cs_ then to set the bots to play for CS maps. And how I must do that? Maybe a code exsamples with a good explain will help.
|
Re: Best way to detect the maps types ?
For me, hooking the entities spawning is the best way. If you find a func_hostage_rescue then it's a hostage map, if you find a func_bomb_target or info_bomb_target then it's a bomb map. If you have a func_vip_safetyzone, then it's an AS map, if you have a func_escapezone then it's an escape map, etc... If you have nothing of these, then -> deathmatch.
Try to make it so that a map can have several types at once. |
Re: Best way to detect the maps types ?
Thanks PMB but do you have a idea how to detect FY maps and AWP maps ?
Can you tell me is this way is good : Code:
strcpy(filename, STRING(gpGlobals->mapname)); |
Re: Best way to detect the maps types ?
Some maps do not even start with xx_mapname. If I were you, I'd scan until the first underscore. And what if someone named a map "awesome_map" ? That wouldn't make it an AWP map.
|
Re: Best way to detect the maps types ?
Theres a few ways you could do this...
1. Read config files for every map, goto 2 if not found 2. Compare the first 3 letters of the mapname with a table that lists the prefix ( ie. "de_" ) and it's type ( ie. GTYPE_DE ) 3. As said by PMB, if all else fails assume deathmatch >:) |
Re: Best way to detect the maps types ?
Ok I will make two checks. First for func_bomb_target (for DE maps) after that for func_hostage_rescue (CS maps), func_vip_safetyzone(for AS maps) as PMB says. If that fail I will make the checking with the file name of the map. And if that fail then deathmatch. I think that this checks will be enogh for detecting the correct map type.
Thanks a lot guys. :) |
Re: Best way to detect the maps types ?
Another thing you could check for is if they have say, both a func_hostage_rescue and func_bomb_target.
|
Re: Best way to detect the maps types ?
In SoW2 we do gameplay mode detection in maps solely with entity finding. It works great.
|
All times are GMT +2. The time now is 02:32. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.