Page 1 of 1

Q4 Modding - Looking for the console commands.

Posted: Fri Nov 18, 2005 1:59 am
by jester!
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?

Posted: Fri Nov 18, 2005 4:35 am
by ^misantropia^
In the engine, where you can't directly access it. You might have luck with this snippet:

Code: Select all

cvarSystem->SetCVarBool( "r_singleLight", true );
However, you can't change the cvar's flags so it will always be marked as a cheat.

Posted: Fri Nov 18, 2005 2:03 pm
by ^misantropia^
Well, it seems you can update cvars with a bit of trickery. Here you go:

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;
}
Call it like this to unmark r_singleLight as a cheat:

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
}

Posted: Fri Nov 18, 2005 3:33 pm
by jester!
Cool, thanks. :icon32: