quakec cvar change
Moderator: InsideQC Admins
28 posts
• Page 1 of 2 • 1, 2
quakec cvar change
is there a way to change a cvar, every time i shoot with a shotgun for example?
-

behind_you - Posts: 237
- Joined: Sat Feb 05, 2011 6:57 am
- Location: Tripoli, Libya
Re: quakec cvar change
mmm. do you want that a specific function is realized as if it was lowering the command line and writes there something?
Is it that or I understood badly?
Is it that or I understood badly?
hi, I am nahuel, I love quake and qc.
-

Nahuel - Posts: 492
- Joined: Wed Jan 12, 2011 8:42 pm
- Location: mar del plata
lets say i had a shotgun. Everytime i shoot with it, i want the sv_maxspeed to become 250. How do i accomplish this?
-

behind_you - Posts: 237
- Joined: Sat Feb 05, 2011 6:57 am
- Location: Tripoli, Libya
Ranger366 wrote:behind_you wrote:lets say i had a shotgun. Everytime i shoot with it, i want the sv_maxspeed to become 250. How do i accomplish this?
stuffcmd (self, "sv_maxspeed 250\n");
called in W_FireShotgun or whatever, a very hacky thing
I agree
hi, I am nahuel, I love quake and qc.
-

Nahuel - Posts: 492
- Joined: Wed Jan 12, 2011 8:42 pm
- Location: mar del plata
ok now whenever i shoot with the shotgun it says 'sv_maxspeed' changed to '250.' how do i make it not say that?
-

behind_you - Posts: 237
- Joined: Sat Feb 05, 2011 6:57 am
- Location: Tripoli, Libya
behind_you wrote:ok now whenever i shoot with the shotgun it says 'sv_maxspeed' changed to '250.' how do i make it not say that?
You can't. It's a server cvar, which means that any changes made to it are broadcast to all connected clients.
By the way, if you're going to do this, do it carefully. People might have set their own values for cvars that suit the way they like to play the game, and they won't take kindly to you stomping all over their settings. At the very least save out the previous value and restore it properly when done - don't assume that it's always at the default.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
ok can i stop from broadcasting all server cvars? Im making a single player mod so it should matter, right? Or do bots get affected by this sort of thing?
-

behind_you - Posts: 237
- Joined: Sat Feb 05, 2011 6:57 am
- Location: Tripoli, Libya
behind_you wrote:ok can i stop from broadcasting all server cvars? Im making a single player mod so it should matter, right? Or do bots get affected by this sort of thing?
Only clients (and fakeclients eventually) get affected by it.
I think with "bots" you mean enemies such as the ogre or the enforcer - they dont get affected.
-

Ranger366 - Posts: 203
- Joined: Thu Mar 18, 2010 5:51 pm
im using frikbots, they arent getting affected, right? Nd that stupid broadcast message is pissin me off.
-

behind_you - Posts: 237
- Joined: Sat Feb 05, 2011 6:57 am
- Location: Tripoli, Libya
mh wrote:You can't stop it broadcasting unless you modify the engine.
Where specifically? Thats what im currently trying to find out
-

behind_you - Posts: 237
- Joined: Sat Feb 05, 2011 6:57 am
- Location: Tripoli, Libya
stuffcmd(foo, "sv_foo\n");
forgive me while I vomit....
*vomits*
try localcmd("sv_foo\n"); instead. It'll probably work more reliably.
Won't silence the prints though.
You should use grep/find-in-files for that instead. "'%s' changed to '%s'\n" will probably turf something up.
forgive me while I vomit....
*vomits*
try localcmd("sv_foo\n"); instead. It'll probably work more reliably.
Won't silence the prints though.
You should use grep/find-in-files for that instead. "'%s' changed to '%s'\n" will probably turf something up.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
In the Cvar_Set function, this is the block of code that you need to remove:
- Code: Select all
if (var->server && changed)
{
if (sv.active)
SV_BroadcastPrintf ("\"%s\" changed to \"%s\"\n", var->name, var->string);
}
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
28 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 1 guest