PS: I use FTEQW, compile with fteqcc as qwprogs.dat and for this game I use ONLY ssqc by now, so CSQC is not the problem, today!
Thanks in advance for any hint!
EDIT: same thoughts for sv_gravity!
Code: Select all
PSEUDOCODE
makevectors(input_angles)
if(groundcheck)
velocity increase
Thanks, this is a great suggestion. In fact I'm trying to use input_movevalues and input_timelength. I'll post all the source code when finished as CC0 because I hate GPL (and that's why I didn't take too much in consideration pmove.qc and I look forward to a -from scratch- solution).ust directly hacking the velocity without considering input_timelength will make your player physics highly dependant upon the rate at which your client sends packets at the server. this is not a good situation. you're better off manipulating input_movevalues instead (and probably sv_maxspeed too)
Code: Select all
cvar_set("sv_gravity","1800");
cvar_set("sv_maxspeed","2000");
Well, as post titile said, I'm using FTEQW, so it'd be great to know a little more of FTE cvarseach engine has its own set of cvars, whether they're client, server, or both.
And for "local" do you mean client console, right?localcmd adds the specified text to the local engine's console command buffer thing (regardless of whether its called from csqc or ssqc).
"Possibly the same machine as the server"? But the server shouldn't be considered "server"?stuffcmd sends it to a connected client (possibly the same machine as the server, but also appears in demos) for it to be executed there instead.
That's the point I cannot understand. How can I BE SURE to talk to server and when, instead, I can be sure to talk to client? I mean, CSQC is a "modern" invention created by you, but, in 1996 how could be possible to refer to server and clients distincly?if you set sv_gravity on the server then yes, that's on the server, not the client.
This probably of ot the most ununderstandable statements I've ever listen in programming. As a completely noob as I am, I've always imagined that, in a client-server architecture, all data are queried by client and stored on server, so that all clients can retrieve same informations.the client doesn't know the value of all the server's cvars. they're on the server - not the client.
I checked here and only 2 functions talk about serverinfo:the server settings the client does know are normally exposed via the serverinfo stuff (using that command on the client will show you the official serverinfo strings, there are a few special extras that are visible only to csqc as somewhat of a hack, check fteextensions.qc for those names).
Code: Select all
void worldspawn()
{
//retrieve gravity from server
local string mygravity = serverkey("sv_gravity");
//apply at the very bottom to clients
cvar_set("sv_gravity",mygravity);
}
cvarlist.toneddu2000 wrote:Well, as post titile said, I'm using FTEQW, so it'd be great to know a little more of FTE cvars
each process has its own console command buffer. if you have the client+server running in a single process then they share consoles. if they're different processes on the same machine then its in no way different from different processes running on computers on the other sides of the world, just different latency/packetloss.And for "local" do you mean client console, right?
stuffcmd(self, sprintf("echo %s\n", self.netname));"Possibly the same machine as the server"? But the server shouldn't be considered "server"?
So if I wrote "self.netname" in stuffcmd, it wouldn't print connected client netname?
in world.qc you will normally find this code:When you say "if you set sv_gravity on the server", do you mean "write sv_gravity in ftesrv.cfg" or "put it via cvar_set in a specific function in ssqc (in this case, it would be great to know which function is, because worldspawn() didn't sort any effect)"?
the client and server are separate and distinct. the client interpolates between a series of snapshots that the server sends to it and thus the client simply doesn't need to have a copy of every single cvar on the server. trust me in this - you don't want to have to sit around waiting for all that data to be transmitted at the start of each map.This probably of ot the most ununderstandable statements I've ever listen in programming. As a completely noob as I am, I've always imagined that, in a client-server architecture, all data are queried by client and stored on server, so that all clients can retrieve same informations.
no, not really.so maybe the correct usage is
...
Right?
Thankscvarlist.
Usually I start a dedicated server on my local machine, to emulate server, and then I create 2 or more clients on same local machine and I connect to 127.0.0.1. I assume server and client(s) are separated processes, right?each process has its own console command buffer. if you have the client+server running in a single process then they share consoles. if they're different processes on the same machine then its in no way different from different processes running on computers on the other sides of the world, just different latency/packetloss.
Ok, I'll try it, thanks!stuffcmd(self, sprintf("echo %s\n", self.netname));
that will always display the player's own name and never anyone else's. it will not appear on a dedicated server, but will appear on a listen server if the client is connected at the time (ie: still won't appear if its done in worldspawn when there's no players that have spawned yet).
Yeah, I tried that early. But in fteqw, server changed it but not clients. I think it's due to different time when they access worldspawn, I guessin world.qc you will normally find this code:
if (self.model == "maps/e1m8.bsp")
cvar_set ("sv_gravity", "100");
else
cvar_set ("sv_gravity", "800");
if you don't find it, then someone has probably moved it elsewhere.
this also prevents config-set values for sv_gravity from being used.
Ok, kinda understood, thanks a lot for the explanationthe client and server are separate and distinct. the client interpolates between a series of snapshots that the server sends to it and thus the client simply doesn't need to have a copy of every single cvar on the server. trust me in this - you don't want to have to sit around waiting for all that data to be transmitted at the start of each map.
csqc might care about some of it. you can use serverinfo for most of that stuff, or stats, or fields, or stuffcmds.
so yes. client and server have their own entirely-separate cvars. often they'll have the same value, and often they'll differ (like the 'name' cvar that controls the name of the player). what you would never want would be for all clients to be forced to use the server's mouse sensitivity etc.
serverinfo+userinfos are a quakeworld thing. quakeworld also has localinfo, but frankly that's obsolete due to cvars being more friendly, its kinda munged in with the serverinfo overriding it and basically breaking things, many quakeworld mods used it as a poor-man's way to perform string manipulation thanks to localcmd's string concatination.
each player has his/her own userinfo string (name, colours, etc). the server has its own userinfo string (hostname, map, etc), each qc module can query any player's userinfo or the serverinfo. only the ssqc can see the localinfo but cannot easily distinguish between serverinfo or localinfo.
Ok thanks, I'll do it!use:
localcmd(sprintf("serverinfo %s \"%s\"\n", keyname, keyvalue));
to change a serverinfo key.