Forum

qcexec: Execute qc functions from the console

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

qcexec: Execute qc functions from the console

Postby Baker » Mon Jan 25, 2010 11:43 am

Not new. But I don't hear it mentioned often -- err at all -- and want to draw attention to this this old tutorial.

Qcxec Tutorial --- execute QuakeC from the command line:

http://www.quake-1.com/docs/quakesrc.org/143.html

By the way, if anyone can shed like on great uses for this feature ....
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby mh » Mon Jan 25, 2010 11:58 am

Hmmmm - I'd totally forgotten about that one. It would need to be extended to take function params of course, but otherwise it seems quite a neat little feature to have and if we could get a standardised version of it implemented in all engines we might have something useful for modders to take advantage of.

I'm thinking no more need to use impulses, just bind a key to a "qcexec" command.
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
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby Spike » Mon Jan 25, 2010 12:09 pm

most of the uses for this are superceeded by KRIMZON_SV_PARSECLIENTCOMMAND.
the remaining uses are for server admins only, but it generally doesn't permit remote admins.

it could be used for loading, say, frikbot waypoints, if the frikbot code was modified to use it.

as a tutorial, it demonstrates how to invoke QC code from the engine, and how to register new console commands.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Baker » Mon Jan 25, 2010 12:18 pm

I figured most uses of this would be as a QuakeC testing tool, never thought of the substitution for impulses idea (although I'm not sure that is a good substitute, heh).
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Downsider » Mon Jan 25, 2010 7:09 pm

Just wondering, Quake only allows for one impulse per frame, if I were to use this, could I do multiple? And does it work online?
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby Teiman » Mon Jan 25, 2010 8:04 pm

Downsider wrote:Just wondering, Quake only allows for one impulse per frame, if I were to use this, could I do multiple? And does it work online?


I suppose it works serverside. I don't think it works online.
humm... as a substitute for impulse is sound.. unfortunally, compatibility > all. and since impulse is compatible everywhere, maybe qcexec for that only make sense on total conversions...

I dont know of any user case for this thing.
Teiman
 
Posts: 309
Joined: Sun Jun 03, 2007 9:39 am

Postby mh » Mon Jan 25, 2010 8:26 pm

I think it should work because the command is forwarded to the server, but I haven't tested.
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
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby Team Xlink » Mon Jan 25, 2010 8:26 pm

I have used that tutorial and it is worth it. It makes it very easy to test case specific occurrences in the qc code. Such as a function that says dominating when a player kills 6 other players with his boomstick in 3 seconds. I know it is a very unlikely case but it is an example.

I thought this was considered a standard already in the sense that most engines have it.

It is really useful.
Team Xlink
 
Posts: 368
Joined: Thu Jun 25, 2009 4:45 am
Location: Michigan

Postby Downsider » Mon Jan 25, 2010 9:53 pm

mh wrote:I think it should work because the command is forwarded to the server, but I haven't tested.


I thought that too.. But aren't only certain commands passed? No need for +mlook or "help" to be passed.

Either way the modification to get it to work should be nominal.
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby mh » Mon Jan 25, 2010 9:58 pm

According to the tutorial this one is. There's a Cmd_ForwardToServer in the function itself, and it gets a call from SV_ReadClientMessage. It would need to be forwarded to the server anyway as QC (aside from CSQC of course) only exists on the server.
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
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby Lardarse » Tue Jan 26, 2010 11:35 am

Baker wrote:I figured most uses of this would be as a QuakeC testing tool, never thought of the substitution for impulses idea (although I'm not sure that is a good substitute, heh).

That seems to be the biggest use of it. Would be very useful to have just for that purpose. Especially for testing edge cases...
Roaming status: Testing and documentation
User avatar
Lardarse
 
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest