Progs.dat can read client's vars?

Discuss programming in the QuakeC language.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Progs.dat can read client's vars?

Post by Spike »

Seven, those will read only the server's cvars, rather than the client's. That's fine if your mod is single-player only, but will break in coop/deathmatch. Any cvars read that way should be written with localcmd, and NOT stuffcmd.
Seven
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: Progs.dat can read client's vars?

Post by Seven »

Thank you Spike for your comment.

As you know, I am coming from the other side of Quake (= Single Player) than the usual Quake player.
That is why I tested these dpextensions and they worked in single player as they should.
I could read the config.cfg cvars and change them with these dpextensions inside SSQC.

If this will not work in multiplayer, then I am sorry and must withdraw or at least ristrict my post to single player.
Sometimes I forget that multiplayer is another world than single player...

Thank you Spike to correct it.

At least this way works for all single player mods. :)

KInd regards,
Seven
frag.machine
Posts: 2126
Joined: Sat Nov 25, 2006 1:49 pm

Re: Progs.dat can read client's vars?

Post by frag.machine »

single player = multiplayer game where the server runs in the same machine as the client and with maxplayers = 1
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Progs.dat can read client's vars?

Post by Spike »

single player = client/server distinctions are not possible/practical.

of course, its possible to have single player with a client/server distinction, eg diablo 3... and its possible, though unlikely, for someone to play quake in the same way, using one server with maxplayers and cvars set for single player (maybe because its the only one that can run a certain mod) with a separate client (maybe because they hate the client part of the engine they're forced to run for the server). Its not really worth making a mod to cope with that, as you'd likely lose saved games, so whatever.

There are mods that do directly query client cvars in the server code. If its something trivial like fov, which is generally set to the same value by all players, then you might not even notice it, but if you query the value in a dedicated server which doesn't have that cvar, all hell will break loose, as its value will read as 0. :)

QuakeWorld has userinfo (eg: setinfo mymagicvalue 54) which can be read in ssqc using the infokey(self, "mymagicvalue") builtin. Sadly, NQ does not. Either way, its explicit named data rather than generally visible info. It can be used for certain preferences, but its size is limited.
Post Reply