#include <common/csqcmodel_settings.qh>
#include <common/deathtypes/all.qh>
+#include <common/debug.qh>
#include <common/effects/all.qh>
#include <common/effects/qc/globalsound.qh>
#include <common/ent_cs.qh>
return true;
}
+void show_entnum(entity this)
+{
+ // waypoint editor implements a similar feature for waypoints
+ if (waypointeditor_enabled)
+ return;
+
+ if (wasfreed(this.wp_aimed))
+ this.wp_aimed = NULL;
+
+ WarpZone_crosshair_trace_plusvisibletriggers(this);
+ entity ent = NULL;
+ if (trace_ent)
+ {
+ ent = trace_ent;
+ if (ent != this.wp_aimed)
+ {
+ string str = sprintf(
+ "^7ent #%d\n^8 netname: ^3%s\n^8 classname: ^5%s\n^8 origin: ^2'%s'",
+ etof(ent), ent.netname, ent.classname, vtos(ent.origin));
+ debug_text_3d((ent.absmin + ent.absmax) * 0.5, str, 0, 7, '0 0 0');
+ }
+ }
+ if (this.wp_aimed != ent)
+ this.wp_aimed = ent;
+}
+
.string shootfromfixedorigin;
.bool dualwielding_prev;
bool PlayerThink(entity this)
if (frametime) player_powerups(this);
+ if (frametime && autocvar_sv_show_entnum) show_entnum(this);
+
if (IS_DEAD(this)) {
if (this.personal && g_race_qualifying) {
if (time > this.respawn_time) {
}
}
+ if (frametime && autocvar_sv_show_entnum) show_entnum(this);
+
if (IS_BOT_CLIENT(this) && !CS(this).autojoin_checked)
{
CS(this).autojoin_checked = true;
set cl_stripcolorcodes 0 "experimental feature (notes: strips ALL color codes from messages!)"
+// prints view position and orientation
+alias posview_camera_info "prvm_globalget client view_origin _posview_tmpcvar1; prvm_globalget client view_angles _posview_tmpcvar2; _posview_camera_info_2"
+alias _posview_camera_info_2 "echo view_origin ^7\"$_posview_tmpcvar1\"; echo view_angles ^7\"$_posview_tmpcvar2\""
+
+// prints csqcplayer position and orientation
+// NOTE: for some reason .angles contains only yaw, .v_angles only pitch, .v_angle_old both
+alias posview_csqcplayer_info "prvm_globalget client csqcplayer _posview_tmpcvar1; _posview_csqcplayer_info2"
+alias _posview_csqcplayer_info2 "prvm_edictget client $_posview_tmpcvar1 origin _posview_tmpcvar1; prvm_edictget client $_posview_tmpcvar1 v_angle_old _posview_tmpcvar2; _posview_csqcplayer_info3"
+alias _posview_csqcplayer_info3 "echo csqcplayer origin ^7\"$_posview_tmpcvar1\"; echo csqcplayer angles ^7\"$_posview_tmpcvar2\""
+set _posview_tmpcvar1 "0"
+set _posview_tmpcvar2 "0"
+
// Demo camera
set camera_enable 0 "Enables the camera for demo playback"
set camera_free 0 "Free camera instead of chasing the player"
set debug_text_3d_default_duration 10 "Default duration for debug_text_3d()"
set debug_text_3d_default_velocity "0 -10 0" "Default velocity for debug_text_3d() in screen coords (X and Y from top left)"
+///////// qc debugger shortcuts /////////
+// breakpoint
+alias ps_b "prvm_breakpoint server ${* ?}"
+alias pc_b "prvm_breakpoint client ${* ?}"
+alias pm_b "prvm_breakpoint menu ${* ?}"
+
+// entity
+alias ps_e "prvm_edict server ${* ?}"
+alias pc_e "prvm_edict client ${* ?}"
+alias pm_e "prvm_edict menu ${* ?}"
+
+// field get
+alias ps_fg "prvm_edictget server ${* ?}"
+alias pc_fg "prvm_edictget client ${* ?}"
+alias pm_fg "prvm_edictget menu ${* ?}"
+// field set
+alias ps_fs "prvm_edictset server ${* ?}"
+alias pc_fs "prvm_edictset client ${* ?}"
+alias pm_fs "prvm_edictset menu ${* ?}"
+// field watchpoint
+alias ps_fw "prvm_edictwatchpoint server ${* ?}"
+alias pc_fw "prvm_edictwatchpoint client ${* ?}"
+alias pm_fw "prvm_edictwatchpoint menu ${* ?}"
+
+// global get
+alias ps_gg "prvm_globalget server ${* ?}"
+alias pc_gg "prvm_globalget client ${* ?}"
+alias pm_gg "prvm_globalget menu ${* ?}"
+// global set
+alias ps_gs "prvm_globalset server ${* ?}"
+alias pc_gs "prvm_globalset client ${* ?}"
+alias pm_gs "prvm_globalset menu ${* ?}"
+// global watchpoint
+alias ps_gw "prvm_globalwatchpoint server ${* ?}"
+alias pc_gw "prvm_globalwatchpoint client ${* ?}"
+alias pm_gw "prvm_globalwatchpoint menu ${* ?}"
+///////// qc debugger shortcuts END /////////
+
// otherwise, antilag breaks
sv_gameplayfix_consistentplayerprethink 1
// autoscreenshots
set g_max_info_autoscreenshot 3 "how many info_autoscreenshot entities are allowed"
+
+// commands for saving and reloading the current posistion and view, even after a map restart
+// useful for taking screenshots and comparing things
+alias posview_load "_posview_set \"$_posview_pos\" \"$_posview_angles\""
+alias posview_save "_posview_save_to_cvars _posview_pos _posview_angles; _posview_save_$posview_verbose"
+alias _posview_save_0 ""
+alias _posview_save_1 "posview_info"
+
+// NOTE without ^7 the quote mark wouldn't be printed
+alias posview_info "echo saved player posview:; echo _posview_pos ^7\"$_posview_pos\"; echo _posview_angles ^7\"$_posview_angles\""
+seta posview_verbose 1 "also print posview on save so that a previously saved posview can be restored by copying it from the OS console log and pasted to the Xonotic console"
+
+// internal commands:
+// _posview_set <position> <view angles>: sets the specified position and view angles ("x y z" "pitch yaw roll")
+// _posview_save_to_cvars <pos_cvar> <angles_cvar>: saves current position and view angles to the specified cvars
+alias _posview_set "prvm_edictset server 1 origin \"$1\"; prvm_edictset server 1 fixangle 1; prvm_edictset server 1 angles \"$2\""
+alias _posview_save_to_cvars "prvm_edictget server 1 origin ${1 ?}; prvm_edictget server 1 v_angle ${2 ?}"
+seta _posview_pos "0 0 0"
+seta _posview_angles "0 0 0"
+
+
// mod names for server browser
// note: the lowest of these that mismatches default is used
set g_mod_physics "" "Current physics config name"
set sv_damagetext 2 "<= 0: disabled, >= 1: visible to spectators, >= 2: visible to attacker, >= 3: all players see everyone's damage"
+set sv_show_entnum 0 "Show the number and some info of the entity you're aiming at"
+
set sv_showfps 0 "Show player's FPS counters in the scoreboard. This setting acts as a delay in seconds between updates. NOTE: this feature gathers performance telemetry, it may require consent from players on the server depending on your legislation"
set sv_doors_always_open 0 "If set to 1 don't close doors which after they were open"