View Full Version : Location of Console variables
Ricksk
07-24-2007, 02:06 PM
I was searching console variables like "host_timescale" and "sv_cheats" in the SDK, but I couldnt find them.
Somebody know where are they declarated?
mastersmith98
07-24-2007, 04:00 PM
you mean like being able to change them in the code?
Ricksk
07-24-2007, 04:19 PM
Not change the value of them, but able to edit/copy their code.
Keair
07-24-2007, 04:34 PM
If you're just looking for examples of ConVars, then movevars_shared.cpp and movevars_shared.h are good sources.
Ricksk
07-24-2007, 04:53 PM
Thanks, but in those files we can't see the real code of the commands, just the declaration, right? Where are their code? And why when we search for "host_timescale" and "sv_cheats" we can't find them in the code?
I was curious about the "host_timescale", to improve it to a bullettime.
noob cannon lol
07-24-2007, 05:56 PM
Those cvars are declared by the engine. You can get a pointer to them by using cvar->FindVar(). Keep in mind that host_timescale does not work correctly even when you revert the cheat flag- you might need to hack around some stuff to get it working correctly.
EDIT: actually, i might be wrong on that
Ricksk
07-24-2007, 06:17 PM
The problem is this... To use host_timescale I need to activate the sv_cheats, but if I do this, a message is printed on the screen announcing that the cheats are on. Can I disable the message?
mastersmith98
07-24-2007, 09:52 PM
what I did was just bind a key to hosttimescale, its a hack but it gets the effect you want.
Ricksk
07-24-2007, 10:29 PM
I did it, but it need the sv_cheats 1...
noob cannon lol
07-25-2007, 07:21 AM
The problem is this... To use host_timescale I need to activate the sv_cheats, but if I do this, a message is printed on the screen announcing that the cheats are on. Can I disable the message?
Do something like...
pHostTimescale->m_nFlags &= ~FCVAR_CHEAT;
Ricksk
07-25-2007, 08:10 AM
Thanks, I will try it :D
Ricksk
07-25-2007, 09:05 AM
Dont have acess to m_nFlags, its private. I tried to change it to public, but dont seems to work...
Ricksk
08-01-2007, 05:47 PM
ConVar *pSv_Cheats = cvar->FindVar("sv_cheats");
pSv_Cheats->SetValue(1);
engine->ServerCommand("host_timescale 0.3\n");
engine->ServerCommand("phys_pushscale 20\n");
engine->ServerCommand("cl_phys_timescale 0.1\n");
pSv_Cheats->SetValue(0);
Why the hell it doesnt work?
Ricksk
08-01-2007, 06:12 PM
Okey... The commands seem to need the sv_cheats 1 when running background in the engine... somebody knows the "main" of the code, where I can put the code to work?
(be in slowmotion and ot activate the cheats)
Marine
08-01-2007, 06:23 PM
engine->ServerCommand("cl_phys_timescale 0.1\n"); << Client side command. Not server. engine->ClientCommand/ClientCmd
Ricksk
08-01-2007, 07:00 PM
Okey, but the host_timescale?
I think that it needs sv_cheats 1 in every tick of the game, can I change sv_cheat to 1/0 fast and use the command? How?
Marine
08-01-2007, 07:55 PM
Server commands DO NOT REQUIRE CHEATS!
Client Commands do. But i dont think they do through the clientcmd command.
Ricksk
08-01-2007, 08:05 PM
host_timescale is a server command, and requires cheat. You can test it ;) And I dunno how to make it dont need cheats =/
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.