// 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 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"
float autocvar_g_turrets_targetscan_mindelay;
bool autocvar_g_use_ammunition;
bool autocvar_g_waypointeditor;
+bool autocvar_g_waypointeditor_symmetrical;
+vector autocvar_g_waypointeditor_symmetrical_center;
bool autocvar_g_waypoints_for_items;
#define autocvar_g_weapon_stay cvar("g_weapon_stay")
bool autocvar_g_weapon_throwable;
IMPULSE(navwaypoint_spawn)
{
if (!autocvar_g_waypointeditor) return;
- waypoint_schedulerelink(waypoint_spawn(this.origin, this.origin, 0));
- bprint(strcat("Waypoint spawned at ", vtos(this.origin), "\n"));
+ vector org = this.origin;
+ bool sym = boolean(autocvar_g_waypointeditor_symmetrical);
+
+ LABEL(add_wp);
+ waypoint_schedulerelink(waypoint_spawn(org, org, 0));
+ bprint(strcat("Waypoint spawned at ", vtos(org), "\n"));
+ if(sym)
+ {
+ vector map_center = autocvar_g_waypointeditor_symmetrical_center;
+ org = this.origin;
+ org.x = map_center.x - (org.x - map_center.x);
+ org.y = map_center.y - (org.y - map_center.y);
+ if (vdist(org - this.origin, >, 10))
+ {
+ sym = false;
+ goto add_wp;
+ }
+ }
}
IMPULSE(navwaypoint_remove)
{
if (!autocvar_g_waypointeditor) return;
entity e = navigation_findnearestwaypoint(this, false);
+ bool sym = boolean(autocvar_g_waypointeditor_symmetrical);
+
+ LABEL(remove_wp);
if (!e) return;
if (e.wpflags & WAYPOINTFLAG_GENERATED) return;
return;
}
+ entity wp_sym = NULL;
+ if (sym)
+ {
+ vector map_center = autocvar_g_waypointeditor_symmetrical_center;
+ vector org = this.origin;
+ org.x = map_center.x - (org.x - map_center.x);
+ org.y = map_center.y - (org.y - map_center.y);
+ FOREACH_ENTITY_CLASS("waypoint", !(it.wpflags & WAYPOINTFLAG_GENERATED), {
+ if(vdist(org - it.origin, <, 3))
+ {
+ wp_sym = it;
+ break;
+ }
+ });
+ }
bprint(strcat("Waypoint removed at ", vtos(e.origin), "\n"));
waypoint_remove(e);
+ if (sym && wp_sym)
+ {
+ e = wp_sym;
+ sym = false;
+ goto remove_wp;
+ }
}
IMPULSE(navwaypoint_relink)