set g_debug_bot_commands 0 "print scripted bot commands before executing"
set g_debug_defaultsounds 0 "always use default sounds"
set sv_use_csqc_players 1 "set to 0 to disable CSQC players for better Xonotic 0.5 compat"
-set cl_forceplayermodels 0 "make everyone look like your own model (requires server to have sv_use_csqc_players 1 and sv_defaultcharacter 0)"
-set cl_forceplayercolors 0 "make everyone look like your own color (requires server to have sv_use_csqc_players 1 and sv_defaultcharacter 0, and is ignored in teamplay)"
set cl_precacheplayermodels 0 "TODO please check if this needs to be 1 or if precaching a model the server already requested is fast enough to do it at runtime"
+seta cl_forceplayermodels 0 "make everyone look like your own model (requires server to have sv_use_csqc_players 1 and sv_defaultcharacter 0)"
+seta cl_forceplayercolors 0 "make everyone look like your own color (requires server to have sv_use_csqc_players 1 and sv_defaultcharacter 0, and is ignored in teamplay)"
+seta cl_forcemyplayermodel "" "set to the model file name you want to show yourself as (requires server to have sv_use_csqc_players 1; does not affect how enemies look with cl_forceplayermodels)"
+seta cl_forcemyplayerskin 0 "set to the skin number you want to show yourself as (requires server to have sv_use_csqc_players 1; does not affect how enemies look with cl_forceplayermodels)"
+seta cl_forcemyplayercolors 0 "set to the color value (encoding is same as _cl_color) for your own player model (requires server to have sv_use_csqc_players 1, and is ignored in teamplay; does not affect how enemies look with cl_forceplayermodels)"
// debug cvars for keyhunt attaching
set _angles "0 0 0"
float autocvar_cl_loddistance2 = 4096;
float autocvar_cl_forceplayermodels;
float autocvar_cl_forceplayercolors;
+string autocvar_cl_forcemyplayermodel;
+float autocvar_cl_forcemyplayerskin;
+float autocvar_cl_forcemyplayercolors;
float autocvar__cl_playerskin;
string autocvar__cl_playermodel;
float autocvar_cl_precacheplayermodels;
string forceplayermodels_model;
float forceplayermodels_modelindex;
float forceplayermodels_skin;
+
+string forceplayermodels_mymodel;
+float forceplayermodels_mymodelindex;
+
float forceplayermodels_attempted;
.string forceplayermodels_savemodel;
.float forceplayermodels_savemodelindex;
// forcemodel finding
if(!forceplayermodels_attempted)
{
+ forceplayermodels_attempted = 1;
+
// only if this failed, find it out on our own
entity e;
e = spawn();
forceplayermodels_model = e.model;
forceplayermodels_modelindex = e.modelindex;
forceplayermodels_skin = autocvar__cl_playerskin;
- forceplayermodels_attempted = 1;
+ remove(e);
+ }
+
+ if(autocvar_cl_forcemyplayermodel != "" && autocvar_cl_forcemyplayermodel != forceplayermodels_mymodel)
+ {
+ entity e;
+ e = spawn();
+ setmodel(e, autocvar_cl_forcemyplayermodel); // this is harmless, see below
+ forceplayermodels_mymodel = e.model;
+ forceplayermodels_mymodelindex = e.modelindex;
remove(e);
}
// apply it
- if(autocvar_cl_forceplayermodels && forceplayermodels_modelindex)
+ if(autocvar_cl_forcemyplayermodel != "" && forceplayermodels_mymodelindex && self.entnum == player_localnum + 1)
+ {
+ self.model = forceplayermodels_mymodel;
+ self.modelindex = forceplayermodels_mymodelindex;
+ self.skin = autocvar_cl_forcemyplayerskin;
+ }
+ else if(autocvar_cl_forceplayermodels && forceplayermodels_modelindex)
{
self.model = forceplayermodels_model;
self.modelindex = forceplayermodels_modelindex;
// forceplayercolors too
if(!teamplay)
- if(autocvar_cl_forceplayercolors)
+ {
+ if(autocvar_cl_forcemyplayercolors && self.entnum == player_localnum + 1)
+ self.colormap = 1024 + autocvar_cl_forcemyplayercolors;
+ else if(autocvar_cl_forceplayercolors)
self.colormap = player_localnum + 1;
+ }
}
// FEATURE: fallback frames