CS:GO Game Modes/Guardian

From Valve Developer Community
Jump to: navigation, search
CS:GO Game Modes/Guardian
English
Counter-Strike: Global Offensive Level Creation
Csgo icon guardian.png

Guardian (internally cooperative) is a game mode in Counter-Strike: Global Offensive Counter-Strike: Global Offensive. This site covers the special requirements to make this game mode work for a map.

The mode was first introduced around OpBloodhound.pngOperation Bloodhound as a way to play co-op with a friend inside specific maps.

The gd_ prefix is for maps that are designed primarily for this game mode, but it has no internal purpose. Valve had created the new map gd_crashsite as well as some edits: gd_bank, gd_cbble, gd_lake and gd_sugarcane. Only gd_cbble still exists in the current game files and has a modified T spawn: The fountain is a bomb spot with some additional cover.

Valve originally planned the Guardian game mode to be played on special gd_ maps, but then moved away from it when they realised that it is easier to make regular maps support this game mode instead of creating new maps only for it. On the other hand, one could still make a map that is designed for this game mode, it might be a more interesting gameplay experience!

Game Mode Description

  • The human players play against bots. They spawn near a bomb site as CT or near a hostage as T and must defend it against waves of rushing bots.
  • Each round starts with a freezetime and buying. From then on, bots will spawn in waves. When all bots are dead, the players receive health and are allowed to buy until the bots respawn for the next wave.
  • The human players win the round and the game by making a given number of kills under special conditions, e.g. with a specified weapon. The condition and the number of special kills that has already been made can be seen in a HUD element on the left. As soon as the required number of kills is reached, all players are stopped and an end panel is shown after which the next map loads.
  • The human players lose a round immediately, all players are stopped and the round restarts...
    • if the human players are all dead,
    • if a bomb has been planted on their bomb site or
    • if their hostage has been picked up.
  • The human players lose the game if mp_maxrounds is reached and they did not win a round.

Playing Guardian on any Map

The Guardian game mode can be programmed almost entirely with console commands so that the only map requirements are player spawns and at least one bombsite or hostage. This means that all regular de_ or cs_ maps are eligible for Guardian. Since OpRiptide.pngOperation Riptide it is even possible to play custom Bomb Defusal scenarios on CS:GO Danger Zone Danger Zone maps, provided there is a proper Guardian Config being used.

Tip.png Tip: Valve has prepared a number of guardian configs for the official maps as a part of the Operations which can be found at csgo/maps/cfg/guardian_[...].cfg. For some de_ maps, there are even multiple for each bomb spot.
Note that the files with the prefix guardian_opXX_[...].cfg are up to date and work correctly on the destined map; The others might use outdated commands/syntaxes and need to be edited to work correctly.

There are two steps to play Guardian on a map:

  1. Invoke the commands game_type 4, game_mode 0 and map <mapname>, or all in one command: map <mapname> guardian (see CS:GO Game Modes).
  2. In-game, the adjustment of some ConVars is required (especially to make bots spawn in waves) and more adjustments can be made to customize a mission. However, there is no official way to accomplish the execution of these console commands. There are some options:
    • Execute the commands manually in-game. You don't want to do that.
    • Create new CFG file in csgo/maps/cfg/ (or simply csgo/cfg/) and write the commands. Execute it using execwithwhitelist <filename>.cfg */maps or exec <filename>.cfg */maps (or simply exec <filename>) and restart the game, e.g. using mp_restartgame 1.
    • Write the commands in csgo/cfg/gamemode_cooperative_server. Advantage: These files are executed automatically. For publishing, a custom variant of these files can be packed into a map, overriding a local file!
    • Use a VScript and its functions SendToConsole or SendToConsoleServer to execute the commands.
    • If you are the maker of the map, you can add a VScript that does the CFG execiton when the map loads, see below. This however might override any CFGs that are executed earlier such that it is not possible to play a different guardian scenario on this particular map other than the one that the VScript defines.

Guardian Configs

As mentioned above, besides launching the map in the Guardian game mode, there is "just" a number of console commands that have to be executed get a proper Guardian Scenario. This section is about what to execute and the effects of certain console commands and convars.

In the following, you find a baseline for a Guardian Config. Of course it does not contain map specific settings (e.g. spawn points defined by coordinates), so it alone won't deliver too good results but it should make any map at least playable for this game mode. In Hostage Rescue it can happen that the human players spawn and die immediately because they are to far away from the hostage.

Note.png Note: Remember that by default, the game will always execute the CFG files csgo/cfg/gamemode_competitive.cfg, gamemode_cooperative.cfg, gamemode_cooperative_server.cfg. The former two should not be modified, at most the third. You might also want to read through the former two.
Baseline for a Guardian Config

For Bomb Defusal, you typically want something like the following as a baseline.

// Respawning
mp_respawn_on_death_t	1	// In bomb defusal, terrorists should respawn
mp_respawn_on_death_ct	0	// Humans should not respawn by this rule. The game still handles human player respawns between waves
mp_use_respawn_waves	2	// 0: Rolling waves, like warmup respawns, 2: Spawn bots together when the whole bot team is dead
mp_maxrounds			30	// Give humans 15 tries. When humans win a round, the game ends
mp_roundtime			30	// Give humans 30 minutes per try...
mp_default_team_winner_no_objective 2	// ... and make them lose if the time is up (-1: map default, 0: draw, 2: Ts win, 3: CTs win)

// Bots
bot_quota		5
bot_quota_mode	normal	// Exactly 5 bots

// Spawn points
mp_guardian_target_site 0 // Target bomb site index (-1: none), play around with this value
mp_randomspawn			3 // Respawn team 3 (human CTs) at target bomb site. Custom spawn points (mp_guardian_add_player_spawn_pt) have priority

// Boundaries
mp_guardian_player_dist_min	1000	// Distance from target bomb site center (or hostage) until screen fades gray. The warning sound is played at a distance of about min+(max-min)/4.
mp_guardian_player_dist_max	1200	// Distance from target bomb site center (or hostage) until damage occurs

// Human players' objective
mp_guardian_special_kills_needed	10		// The number of kills needed with a specific weapon.
mp_guardian_special_weapon_needed	"awp"	// The condition(s) that a kill must meet to increment the kills needed to complete the mission
mp_guardian_loc_string_hud	"#guardian_mission_type_kills"	// Localized string token to use on hud for this mission, otherwise defaults to "Get Kills: <weapon>"
mp_guardian_loc_weapon		""				// Override to weapon dialog var applied to UI

// Buying anywhere
sv_buy_status_override	0		// Teams that are allowed to buy (-1: don't override, 0: everyone 1: no one, 2: Ts, 3: CTs)
mp_buy_anywhere			1		// Buy anywhere (still, humans can only buy between waves!)
mp_buytime				1800	// Buy forever (round duration in seconds)

For Hostage Rescue, this requires just a little edit and some different commands:

// Respawning
mp_respawn_on_death_t	0	// Humans are T here, so don't respawn them...
mp_respawn_on_death_ct	1	// ...but do respawn the bots on CT
mp_default_team_winner_no_objective	3	// The humans should lose on timeout (-1: map default, 0: draw, 2: Ts, 3: CTs)

// Spawn points
mp_guardian_target_site -1	// There is no bomb site that the game could generate random spawns at
mp_randomspawn			0	// Turn mp_randomspawn off instead, otherwise we get random spawns across the map

// Hostage Rescue
mp_guardian_force_collect_hostages_timeout	0	// Force bots to go rescue a hostage after not seeing an enemy for this amount of seconds
mp_hostages_spawn_same_every_round			1	// Hostages should not change their location between rounds (which they don't anyway)

Boundaries

After invoking mp_guardian_shoot_point, the game will visualize the existing boundaries. Green with a black grid means that the local player is inside a prism's volume.
Red with no grid means that the local player is outside a prism's volume.

The location where the Guardian Scenario is played depends and can also be manipulated.

  • On Bomb Defusal maps, setting the convar mp_guardian_target_site to 0 or 1 determines the location, either bomb site A or B. Set this to -1 if there is no bomb site.
  • On Hostage Rescue maps, a specific hostage that is already on the map can be selected using mp_hostages_spawn_force_positions <i> or alternatively, a new hostage can be placed using mp_hostages_spawn_force_positions_xyz <x> <y> <z>.
  • On CS:GO Danger Zone Danger Zone maps, one can create a Bomb Defusal scenario by using mp_plant_c4_anywhere 1 and the commands mp_guardian_bomb_plant_[...] to define the boundaries (see below) of a custom bomb target as well as a custom X decal with mp_guardian_bomb_plant_custom_x_mark_location "<x> <y> <z>".

Typically, the human players should stay near the location where the Guardian Scenario takes place. This is achieved with boundaries such that if the human player leaves them, their view fades to gray, they receive a warning and if they go even further, they receive lethal damage. These boundaries can be defined as a sphere (if possible) or using custom bounds (always possible).

  • If there is a func_bomb_target or a hostage_entity, then it is possible to use the sphere around its origin as bounds. In this case, the convar mp_guardian_player_dist_min can be set to describe the radius of the inner sphere where the human players can move freely. Then the convar mp_guardian_player_dist_max can be set to a larger radius: The human players receive damage if they step outside this larger sphere. The area between the inner and outer sphere is used for the transition to gray.
  • Custom bounds consist of an arbitrary number of convex prisms and each convex prism consists of an arbitrary number of points. Valve has implemented a system in-game to create, visualize (!) and save such structures, see below. When some bounds are defined, then mp_guardian_player_dist_min and _max get a slightly different meaning. When a player starts to run outside of the bounds, the fade to gray starts right at the border of the bounds and damage starts at a distance of max - min, for example after 100 units if min=800, max=900 which by the way would have the same effect as min=1370, max=1470 and so forth.
Creating Custom Boundaries

For the bounds of bomb targets, replace mp_guardian_ with mp_guardian_bomb_plant_ in each of the following commands, except for mp_guardian_shoot_point.

  1. Start by invoking mp_guardian_clear_all_bounds to wipe everything that has been added so far.
  2. To add a new prism, invoke mp_guardian_new_bounds. This might also finish the previous prism.
  3. To add a point to the prism, aim at that position and invoke mp_guardian_shoot_point. To save a lot of time, bind this command to a mouse button (mouse1). Alternatively you can also add a point by its coordinates using mp_guardian_add_bounds_pt <x> <y> <z>.
    Note.png Note: The prism will always stay convex; This means that when adding a point, the volume can only become larger and never smaller. Shooting a point inside the current volume has no effect. To get a playable area that is concave, create multiple prisms by going back to step 2.
  4. When you're finished, invoke mp_guardian_emit_bounds_config and copy the text in the console to your Guardian Config - that's it.
    How?: How to turn the volume visualization back off?
Placementtip.gif Example: 
//guardian bounds config
mp_guardian_clear_all_bounds
mp_guardian_new_bounds
mp_guardian_add_bounds_pt -53.0 -70.6 11774.0
mp_guardian_add_bounds_pt -21.0 -837.4 12026.4
mp_guardian_add_bounds_pt -21.0 -872.3 11774.0
mp_guardian_add_bounds_pt -21.0 -966.0 12026.4
mp_guardian_add_bounds_pt -23.0 -1370.0 11774.0
mp_guardian_add_bounds_pt -78.0 -1454.7 12026.4
mp_guardian_add_bounds_pt -98.0 -1454.7 11774.0
mp_guardian_add_bounds_pt -172.4 -1449.4 12026.4
mp_guardian_add_bounds_pt -220.3 -443.2 11774.0
mp_guardian_add_bounds_pt -219.0 -358.5 12026.4
mp_guardian_add_bounds_pt -218.6 -340.0 11774.0
mp_guardian_add_bounds_pt -209.1 -70.0 12026.4
mp_guardian_add_bounds_pt -77.0 -54.1 11774.0
mp_guardian_new_bounds
mp_guardian_add_bounds_pt -292.4 -69.0 11774.0
mp_guardian_add_bounds_pt -218.5 -70.6 12001.4
mp_guardian_add_bounds_pt -208.0 -83.2 11774.0
mp_guardian_add_bounds_pt -188.0 -921.2 12001.4
mp_guardian_add_bounds_pt -188.0 -941.2 11774.0
mp_guardian_add_bounds_pt -218.2 -954.5 12001.4
mp_guardian_add_bounds_pt -235.9 -956.9 11774.0
mp_guardian_add_bounds_pt -386.3 -963.4 12001.4
mp_guardian_add_bounds_pt -422.8 -959.2 11774.0
mp_guardian_add_bounds_pt -428.0 -943.4 12001.4
mp_guardian_add_bounds_pt -577.0 -309.0 11774.0
mp_guardian_add_bounds_pt -582.5 -135.0 12001.4
mp_guardian_new_bounds
mp_guardian_add_bounds_pt -467.1 -741.5 11776.0
mp_guardian_add_bounds_pt -467.1 -761.5 11871.0
mp_guardian_add_bounds_pt -654.9 -799.0 11776.0
mp_guardian_add_bounds_pt -776.9 -799.0 11871.0
mp_guardian_add_bounds_pt -792.9 -798.2 11776.0
mp_guardian_add_bounds_pt -994.4 -688.6 11871.0
mp_guardian_add_bounds_pt -991.8 -616.1 11776.0
mp_guardian_add_bounds_pt -987.5 -525.2 11871.0
mp_guardian_add_bounds_pt -972.6 -518.5 11776.0
mp_guardian_add_bounds_pt -951.1 -518.0 11871.0
mp_guardian_add_bounds_pt -507.5 -518.0 11776.0

Spawn Points

With no adjustments, the players would spawn at the default info_player_(counter)terrorist entities.

The definite solution to get custom spawn points are the following commands. Use the clear command once followed by at least 2 human spawns or 5 enemy spawns, respectively. In-game, you can obtain the coordinates with getpos_exact.

mp_guardian_clear_all_player_spawns
mp_guardian_add_player_spawn_pt <x> <y> <z> <pitch> <yaw> <roll>

mp_guardian_clear_all_enemy_spawns
mp_guardian_add_enemy_spawn_pt <x> <y> <z> <pitch> <yaw> <roll>

In Bomb Defusal, it is also possible to set mp_randomspawn to 3. This convar determines which teams should spawn randomly (at info_deathmatch_spawn entities) where 0 means none, 1: both teams, 2: Ts and 3: CTs. Normally, those spawns are generated across the entire Nav Mesh, however, in CS:GO Guardian Guardian it is special that they are only generated near the one func_bomb_target that is specified by mp_guardian_target_site, if any. These spawns can be re-generated with dm_reset_spawns and viewed with map_showspawnpoints <seconds> if the generation was successful.
Sadly this system cannot be used in Hostage Rescue, thus mp_randomspawn should be 0 and it is easier to set the spawn points with the above commands.


Player Mission

By game logic, the human players win a round (and the game) as soon as they score a certain number of special kills that meet certain conditions which can be set with the following convars.

// Human players' objective
mp_guardian_special_kills_needed	10		// The number of special kills needed to win the game
mp_guardian_special_weapon_needed	"awp"	// The condition(s) that a kill must meet to increment the kills needed to complete the mission
mp_guardian_loc_string_hud	"#guardian_mission_type_kills"	// Localized string token to use on hud for this mission, otherwise defaults to "Get Kills: <weapon>"
mp_guardian_loc_weapon		""				// Override to weapon dialog var applied to UI

mp_guardian_special_kills_needed stands for the number of kills that the human players must score to win the game. If set to 0 or a negative value, the game ends as soon as the humans score one kill.

mp_guardian_special_weapon_needed determines the condition(s) that kills must pass to be counted as a special kill. It can be one or a combination of the following:

Expression What kind of kills count? 
"" Every kill. Does not work when changed to during a round.
awp, ak47, ... Only kills with the specified weapon (omitting the weapon_ prefix). Does not work when changed to during a round.
%weapon_awp%, %weapon_ak47%, ... Only kills with the specified weapon. See Category:CS:GO Weapons for a list of weapons. Does not work with weapon_fists, weapon_shield.
%weapon_secondary% Only pistol kills: Glock-18, P2000, USP-S, Dual Berettas, P250, Tec-9, CZ75-Auto, Fiveseven, Desert Eagle, R8 Revolver.
%weapon_smg% Only SMG kills: MAC-10, MP9, MP7, MP5-SD, UMP-45, P90, PP-Bizon.
%weapon_heavy% Only heavy weapon kills: Nova, XM1014, Sawed-Off, MAG-7, M249, Negev.
%weapon_rifle% Only rifle kills: Galil AR, FAMAS, AK-47, M4A4, M4A1-S, SSG 08, SG 553, AUG, AWP, G3SG1, SCAR-20.
%weapon_grenade% Only grenade kills, including grenade impact kills: Molotov, Incendiary Grenade, Decoy Grenade, Flashbang, HE Grenade, Smoke Grenade, Tactical Awareness Grenade, Snowball.
%weapon_melee% Only melee kills: Knife, Axe, Hammer, Wrench, weapon_melee.
%weapon_knife% Only knife kills.
%cond_damage_burn% Only kills caused by fire.
%cond_damage_headshot% Only kills caused by a headshot.
%cond_damage_collateral% Only kills caused by a bullet that has already killed another enemy on its path.
%cond_match_ts_unique_weapon% Only kills with weapons that the human team has not scored any kill with yet.
%cond_player_airborne%
%cond_victim_airborne%
Only kills where the killer/victim is in midair.
%cond_player_blind%
%cond_victim_blind%
Only kills where the killer/victim is (or has just been) under the flashbang effect.
%cond_player_zoomed% Only kills where the killer has scoped with a weapon.
%cond_victim_distance% <= 10 Only kills where the victim is at most 10 meters away from the killer (distance from eye to eye?).
Note.png Note: 
  • Unlike the other expressions, %cond_victim_distance% returns a float and not just 0 or 1.
  • All of the operators ==, !=, <, >, <=, >= work, too.
%<invalid_expression>% No kill.
!%...% NOT operator: A kill must NOT meet the condition to be counted.
%...% || %...% OR operator: A kill must meet ANY of these conditions to be counted.
%...% && %...% AND operator: A kill must meet ALL of these conditions to be counted.
( ... ) Brackets can be used to group expressions and to influence the order of evaluation of the previous three operators. Note that due to operator precedence !A && B || C is equivalent to ((!A) && B) || C.
Placementtip.gif Example: 

mp_guardian_special_weapon_needed "%weapon_awp%" requires the human players to score kills with the AWP.
mp_guardian_special_weapon_needed "%weapon_smg% && %cond_player_airborne%" requires the human players to score kills with any SMG while being in midair.
mp_guardian_special_weapon_needed "%weapon_awp% && !%cond_player_zoomed% || %weapon_ssg08%" requires the human players to score kills either while unscoped with the AWP or with the SSG 08.
mp_guardian_special_weapon_needed "%cond_damage_headshot% && (%weapon_deagle% || %weapon_revolver%)" requires the human players to score headshot kills with either the Desert Eagle or the R8 Revolver.

mp_guardian_loc_string_hud is the mission text shown on the left of the screen. This can be any text surrounded by quotation marks, but for language compatiblity, there are predefined string tokens that can be found at csgo/resource/csgo_<language>.txt and used with a preceding hash sign. It makes sense to use one of the following:

mp_guardian_loc_string_hud Displayed Text in English 
"" Get kills: {s:weapon}
"#guardian_mission_type_kills" Get kills: {s:weapon}
"#guardian_mission_type_headshots" Get headshots: {s:weapon}
"#guardian_mission_type_unscoped" Get unscoped kills: {s:weapon}
"#guardian_mission_type_enemy_weapon" Get kills with enemy's {s:weapon}
"#guardian_mission_type_enemy_airborne" Get airborne kills: {s:weapon}
"#guardian_mission_type_flashbang" Kill blinded enemies
"#guardian_mission_type_ct_weapons" Get kills with Counter-Terrorist weapons

mp_guardian_loc_weapon is what the expression {s:weapon} will be replaced with. Ideally, this is also a localized string, but it is rarely needed at all because the game already does a good job picking a string itself. Some of the existing strings are:

mp_guardian_loc_weapon Displayed Text in English 
#quest_enemy_weapon Enemy Weapon
#quest_weapon_CZ75a_or_enemy_weapon CZ75-Auto or any enemy weapon
#quest_weapon_sniperrifle any sniper rifle
#quest_weapon_m4 any M4 rifle
#quest_weapon_starter_ct any default CT pistol
#quest_weapon_ct Counter-Terrorist weapon
#quest_weapon_t Terrorist weapon
#quest_weapon_any_pistol any pistol
#quest_weapon_any_weapon any weapon
#quest_weapon_any_shotgun any shotgun
#quest_weapon_any_smg any smg
#quest_weapon_ssg08_or_mag7 SSG 08 or MAG-7
#quest_weapon_awp_or_p90 AWP or P90
#quest_weapon_unique_pistol Different Pistols

The following are examples from the existing files inside csgo/maps/cfg/ to give you an idea of how these three commands can be used together:

Filename mp_guardian_special_weapon_needed mp_guardian_loc_string_hud mp_guardian_loc_weapon 
guardian_op09_card1 "%weapon_ssg08% || %weapon_mag7%" "" "#quest_weapon_ssg08_or_mag7"
guardian_op09_card1_2 "%weapon_p90% || %weapon_awp%" "" "#quest_weapon_awp_or_p90"
guardian_op09_card4 "%weapon_nova% || %weapon_xm1014% || %weapon_mag7% || %weapon_sawedoff%" "" "#quest_weapon_any_shotgun"
guardian_op09_card7_1 "%weapon_awp% && !%cond_player_zoomed%" "#guardian_mission_type_unscoped" ""
guardian_op09_card8 "%weapon_m4a1% || %weapon_m4a1_silencer% || %weapon_hkp2000% || %weapon_usp_silencer% || %weapon_famas% || %weapon_aug% || %weapon_mag7% || %weapon_scar20% || %weapon_fiveseven% || %weapon_mp9%" "#guardian_mission_type_ct_weapons" ""
guardian_op09_card9 "%weapon_usp_silencer% && %cond_damage_headshot%" "#guardian_mission_type_headshots" ""
guardian_op09_card11_1 "%weapon_grenade%" "" ""
guardian_op09_card11_2 "( %weapon_incgrenade% || %weapon_molotov% ) && %cond_damage_burn%" "" ""
guardian_op10_ancient_a "%weapon_nova% || %weapon_mag7% || %weapon_sawedoff% || %weapon_xm1014%" "" "#SFUI_WPNHUD_Shotgun"
guardian_op10_apollo "%cond_match_ts_unique_weapon% && %weapon_secondary%" "" "#quest_weapon_unique_pistol"
guardian_op10_dust2_b "(%cond_victim_distance% <= 10)" "" "#quest_1071_hud_var_desc"
guardian_op10_nuke_b "(%weapon_mp9% || %weapon_mp7% || %weapon_mp5sd% || %weapon_ump45% || %weapon_mp9% || %weapon_bizon% || %weapon_p90% || %weapon_mac10%)" "" "#quest_weapon_any_smg"
guardian_op10_overpass_a "(%weapon_aug% && %cond_damage_headshot%)" "" "#quest_1067_hud_var_desc"
guardian_op10_train_b "%weapon_ssg08% || %weapon_awp% || %weapon_scar20% || %weapon_g3sg1%" "" "#quest_weapon_sniperrifle"
guardian_op10_vertigo_b "%weapon_glock% || %weapon_tec9% || %weapon_sawedoff% || %weapon_mac10% || %weapon_galilar% || %weapon_ak47% || %weapon_sg556% || %weapon_g3sg1%" "" "#quest_weapon_t"


Economy and Equipment

From here on, you can bring up any ideas that you might have for the mission. There is no right or wrong configuration. Regard the following snippets as inspiration. There are a lot of convars that you can manipulate.

// economy settings
mp_startmoney						800		// Only given on game start! Not given when humans lose and the round restarts!
mp_afterroundmoney					800		// Given every new round, except the first, so set this to the same as mp_startmoney
mp_maxmoney							16000
cash_player_killed_enemy_default	300    // Money award to player when they kill an enemy (which then gets scaled per weapon)
cash_player_killed_enemy_factor		1		
cash_player_get_killed				0    // Money a player can get when they are killed by another player
cash_player_bomb_planted			300
cash_team_survive_guardian_wave				1000
cash_team_elimination_bomb_map				0
cash_team_loser_bonus						-16000
cash_team_loser_bonus_consecutive_rounds	0
cash_team_bonus_shorthanded					0 // Should set to 0 because teams are unbalanced
mp_guardian_bot_money_per_wave	800	// The amount of money bots get time each wave the players complete.  This # is abs

sv_buy_status_override	0		// Teams that are allowed to buy (-1: don't override, 0: everyone 1: no one, 2: Ts, 3: CTs)
mp_buy_anywhere			1		// Buy anywhere (still, humans can only buy between waves!)
mp_buytime				1800	// Buy forever (round duration in seconds)
mp_buy_during_immunity	0

mp_buy_allow_guns		255	// 0: none, 255: all, sum up what shall be allowed: 1=pistols, 2=SMGs, 4=rifles, 8=shotguns, 16=snipers, 32=heavy
mp_buy_allow_grenades	1
mp_items_prohibited		0	// can disable specific items

// default equipment
mp_free_armor				0
mp_ct_default_primary		""
mp_ct_default_secondary		"weapon_hkp2000"
mp_ct_default_melee			"weapon_knife"
mp_ct_default_grenades		""
mp_t_default_primary		""
mp_t_default_secondary		"weapon_glock"
mp_t_default_melee			"weapon_knife"
mp_t_default_grenades		""
sv_guardian_extra_equipment_ct				""	// Extra starting equipment for CT players in guardian modes
sv_guardian_extra_equipment_t				""	// Extra starting equipment for Terrorist players in guardian modes
sv_guardian_starting_equipment_humans		"weapon_healthshot"	// Extra starting equipment for human players in guardian modes (not whitelisted)
sv_guardian_health_refresh_per_wave			50	// Health given to survivors per wave in guardian mode.
sv_guardian_spawn_health_ct					100	// Starting health in guardian modes.
sv_guardian_spawn_health_t					100	// Starting health in guardian modes.
sv_guardian_respawn_health					50	// Starting health of guardian players when respawned.
sv_guardian_refresh_ammo_for_items_on_waves	""	// List of additional weapons to refill ammo on waves.
Tip.png Tip: If you want to restrict the human players from buying certain weapons, you can either adjust cash values or make use of mp_items_prohibited to disallow exact items.
Tip.png Tip: It is possible to use something like mp_items_prohibited "33" to restrict weapon_mp7, so weapon_mp5sd is equipped automatically. This example is from csgo/maps/cfg/guardian_op09_card2.cfg.
Tip.png Tip: You can also use extraordinary items:
sv_guardian_extra_equipment_ct exojump as seen in csgo/maps/cfg/guardian_op09_card4.
sv_guardian_extra_equipment_t weapon_shield as seen in csgo/maps/cfg/guardian_op09_card13.cfg
sv_guardian_extra_equipment_t "parachute" as seen in csgo/maps/cfg/guardian_op11_blacksite_1.cfg.


Bots

// initial bot difficulty
bot_difficulty 2

// bot gets easier on team T each time they win a round
sv_bots_get_easier_each_win								1
sv_bots_get_harder_after_each_wave						2
sv_bots_force_rebuy_every_round							0
sv_auto_adjust_bot_difficulty 							0

// heavy weapons guy
sv_guardian_heavy_all	0	// 1: every bot is a heavy
sv_guardian_heavy_count	0	// max the number of heavies that will come
sv_guardian_max_wave_for_heavy	0	// last  wave number that can have a heavy
sv_guardian_min_wave_for_heavy	0	// first wave number that can have a heavy

// bot weapons. if zero, bots may not use weapon type
bot_allow_machine_guns		1	// If nonzero, bots may use SMGs.
bot_allow_pistols			1	// If nonzero, bots may use pistols.
bot_allow_rifles			1	// If nonzero, bots may use rifles.
bot_allow_shotguns			1	// If nonzero, bots may use shotguns.
bot_allow_snipers 			1	// If nonzero, bots may use sniper rifles.
bot_allow_sub_machine_guns	1	// If nonzero, bots may use sub-machine guns.

bot_allow_rogues			1	// If nonzero, bots may occasionally go 'rogue'. Rogue bots do not obey radio commands
mp_guardian_give_random_grenades_to_bots 1	// If set guardian bots will be given grenades at the beginning of the wave.
sv_guardian_reset_c4_every_wave	0	// 0: the C4 stays where bots have dropped it after a wave. 1: they spawn with the C4

The AI for the bots can be set with mp_bot_ai_bt. In short: Bots can be programmed map specifically using .kv3 text files (as seen in csgo/scripts/ai/guardian/) which allow the programmer to make bots

  • teleport (e.g. closer to the interesting part of the map),
  • throw grenades with exact lineups,
  • rush to a specified coordiante.
  • ...
Note.png Note: All bots use the same AI script. This means they might try to escort hostages or to pick up the dropped bomb even though they are on the wrong team.


Automatic execution of Guardian Configs

local TYPE	= ScriptGetGameType()
local MODE	= ScriptGetGameMode()
local ROUND	= ScriptGetRoundsPlayed()

if (TYPE == 4 && MODE == 0 && ROUND == 0) // Guardian uses game_type 4 and game_mode 0
{
	SendToConsole(format("execwithwhitelist guardian_%s.cfg */maps", GetMapName()))
	// SendToConsole(format("exec guardian/%s", GetMapName()))
}

Using VScript it is possible to fire events depending on the game mode, which is also used for CS:GO Wingman Wingman.

The code on the right is an example for a VScript that - if saved as .nut file inside csgo/scripts/vscripts/ and used as an Entity Script of an entity in the map - can execute commands to the console when the map loads but only if the current game mode is Guardian.

In this particular case it executes the CFG file under csgo/maps/cfg/ that has the same name as the current map but with the prefix guardian_.

Confirm:The function SendToConsole might have the problem that it works only for local servers where a player is the host. The function SendToConsoleServer might not work because the command exec and its variants are not whitelisted - however, executing every single command from the CFG should work, assuming those convars are whitelisted.