View Full Version : Registering your own cvars?
07-15-2009, 11:36 AM
I know it may be considered bad practice, but I'm attempting to register my own console variables in TF2.
According to the SDK documentation, the constructor should automatically register the cvar with the engine. However, this is not the case. Any reasons why this might be/how I could manually register this?
I have near-same problem too..
I'm trying to obfuscate well-known variables like described below: http://forum.gamedeception.net/showthread.php?t=7555 for OB.
Since there are some SDK differences I made such substutions:
// pCvar->m_pszName = newName;
*MakePtr(char**, &(pCvar->m_nFlags), -8) = newName;
// pNewVar->SetNext( 0 );
*MakePtr(int*, &(pNewVar->m_nFlags), -15) = NULL;
still unsure how to replace
pCvar->RegisterConCommandBase( pNewVar );
07-15-2009, 12:28 PM
Hmm, yep, same problem. The registerconcommandbase function does not exist in the OB SDK so I assume you need to recreate it.
how about you just put your cvar in the linked list at any point?
07-16-2009, 03:30 PM
What linked list? These are in-game cvars, not cvars specific to my hack.
07-16-2009, 05:12 PM
You can't just insert the node into the linked list because the size will not be updated. However, you can find the data structure they use to store the cvars, get a pointer to it, and then call its add or insert function.
07-16-2009, 05:51 PM
Powered by vBulletin® Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.