Hey, I am completely new to modding Quake games and am looking for the console commands. Specifically the r_singlelight command and what makes it cheat protected...
Anyone know where it is?
Q4 Modding - Looking for the console commands.
-
- Posts: 4022
- Joined: Sat Mar 12, 2005 6:24 pm
In the engine, where you can't directly access it. You might have luck with this snippet:
However, you can't change the cvar's flags so it will always be marked as a cheat.
Code: Select all
cvarSystem->SetCVarBool( "r_singleLight", true );
-
- Posts: 4022
- Joined: Sat Mar 12, 2005 6:24 pm
Well, it seems you can update cvars with a bit of trickery. Here you go:
Call it like this to unmark r_singleLight as a cheat:
Code: Select all
// Update cvar. Returns true on success, false otherwise.
bool UpdateCVar( const char* name, idCVar& value ) {
if ( !name ) {
return false;
}
idCVar* cvar = cvarSystem->Find( name );
if ( !cvar ) {
return false;
}
*cvar = value;
return true;
}
Code: Select all
idCVar r_singleLight( "r_singleLight", "0", CVAR_BOOL, "Toggle single lights" );
if ( ReplaceCVar( "r_singleLight", r_singleLight ) ) {
// all ok
} else {
// cvar not found
}