// waypoint editor enable
set g_waypointeditor 0
set g_waypointeditor_auto 0 "Automatically create waypoints for bots while playing; BEWARE, this currently creates too many of them"
-set g_waypointeditor_symmetrical 0 "Enable symmetrical editing of waypoints, useful in symmetrical CTF maps. NOTE: it assumes that the map is perfectly symmetrical"
-set g_waypointeditor_symmetrical_center "0 0" "Center (x y) for symmetrical editing of waypoints"
+set g_waypointeditor_symmetrical 0 "Enable symmetrical editing of waypoints: 1: center is automatically determined based on CTF flag positions (NOTE: it assumes that the map is perfectly symmetrical), 2: use custom center (g_waypointeditor_symmetrical_center)"
+set g_waypointeditor_symmetrical_center "0 0" "Custom center (x y) for symmetrical editing of waypoints"
set bot_ignore_bots 0 "When set, bots don't shoot at other bots"
set bot_join_empty 0 "When set, bots also play if no player has joined the server"
set bot_vs_human 0 "Bots and humans play in different teams when set. positive values to make an all-bot blue team, set to negative values to make an all-bot red team, the absolute value is the ratio bots vs humans (1 for equal count). Changes will be correctly applied only from the next game"
bprint(strcat("Waypoint spawned at ", vtos(org), "\n"));
if(sym)
{
- vector map_center = autocvar_g_waypointeditor_symmetrical_center;
+ vector map_center = havocbot_middlepoint;
+ if (autocvar_g_waypointeditor_symmetrical == 2)
+ map_center = autocvar_g_waypointeditor_symmetrical_center;
+
org = e.origin;
org.x = map_center.x - (org.x - map_center.x);
org.y = map_center.y - (org.y - map_center.y);
entity wp_sym = NULL;
if (sym)
{
- vector map_center = autocvar_g_waypointeditor_symmetrical_center;
+ vector map_center = havocbot_middlepoint;
+ if (autocvar_g_waypointeditor_symmetrical == 2)
+ map_center = autocvar_g_waypointeditor_symmetrical_center;
+
vector org = e.origin;
org.x = map_center.x - (org.x - map_center.x);
org.y = map_center.y - (org.y - map_center.y);
}
if(!n)
return;
- havocbot_ctf_middlepoint = s / n;
- havocbot_ctf_middlepoint_radius = vlen(fo - havocbot_ctf_middlepoint);
+ havocbot_middlepoint = s / n;
+ havocbot_middlepoint_radius = vlen(fo - havocbot_middlepoint);
}
// Evaluate best position to take
// Count mates on middle position
- cmiddle = havocbot_ctf_teamcount(this, havocbot_ctf_middlepoint, havocbot_ctf_middlepoint_radius * 0.5);
+ cmiddle = havocbot_ctf_teamcount(this, havocbot_middlepoint, havocbot_middlepoint_radius * 0.5);
// Count mates on defense position
- cdefense = havocbot_ctf_teamcount(this, mf.dropped_origin, havocbot_ctf_middlepoint_radius * 0.5);
+ cdefense = havocbot_ctf_teamcount(this, mf.dropped_origin, havocbot_middlepoint_radius * 0.5);
// Count mates on offense position
- coffense = havocbot_ctf_teamcount(this, ef.dropped_origin, havocbot_ctf_middlepoint_radius);
+ coffense = havocbot_ctf_teamcount(this, ef.dropped_origin, havocbot_middlepoint_radius);
if(cdefense<=coffense)
havocbot_role_ctf_setrole(this, HAVOCBOT_CTF_ROLE_DEFENSE);
{
vector org;
- org = havocbot_ctf_middlepoint;
+ org = havocbot_middlepoint;
org.z = this.origin.z;
this.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
navigation_goalrating_start(this);
havocbot_goalrating_ctf_ourstolenflag(this, 50000);
havocbot_goalrating_ctf_droppedflags(this, 30000, this.origin, 10000);
- havocbot_goalrating_enemyplayers(this, 10000, org, havocbot_ctf_middlepoint_radius * 0.5);
- havocbot_goalrating_items(this, 5000, org, havocbot_ctf_middlepoint_radius * 0.5);
+ havocbot_goalrating_enemyplayers(this, 10000, org, havocbot_middlepoint_radius * 0.5);
+ havocbot_goalrating_items(this, 5000, org, havocbot_middlepoint_radius * 0.5);
havocbot_goalrating_items(this, 2500, this.origin, 10000);
havocbot_goalrating_ctf_enemybase(this, 2500);
navigation_goalrating_end(this);
}
if (this.bot_strategytime < time)
{
- float mp_radius;
- vector org;
-
- org = mf.dropped_origin;
- mp_radius = havocbot_ctf_middlepoint_radius;
+ vector org = mf.dropped_origin;
this.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
navigation_goalrating_start(this);
havocbot_goalrating_ctf_ourbase(this, 30000);
havocbot_goalrating_ctf_ourstolenflag(this, 20000);
- havocbot_goalrating_ctf_droppedflags(this, 20000, org, mp_radius);
- havocbot_goalrating_enemyplayers(this, 15000, org, mp_radius);
- havocbot_goalrating_items(this, 10000, org, mp_radius);
+ havocbot_goalrating_ctf_droppedflags(this, 20000, org, havocbot_middlepoint_radius);
+ havocbot_goalrating_enemyplayers(this, 15000, org, havocbot_middlepoint_radius);
+ havocbot_goalrating_items(this, 10000, org, havocbot_middlepoint_radius);
havocbot_goalrating_items(this, 5000, this.origin, 10000);
navigation_goalrating_end(this);
}