Inside3D!
     

qcexec: Execute qc functions from the console

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming
View previous topic :: View next topic  
Author Message
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Mon Jan 25, 2010 11:43 am    Post subject: qcexec: Execute qc functions from the console Reply with quote

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 ....
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
mh



Joined: 12 Jan 2008
Posts: 909

PostPosted: Mon Jan 25, 2010 11:58 am    Post subject: Reply with quote

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.
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines
Back to top
View user's profile Send private message Visit poster's website
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Mon Jan 25, 2010 12:09 pm    Post subject: Reply with quote

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.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Mon Jan 25, 2010 12:18 pm    Post subject: Reply with quote

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).
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Mon Jan 25, 2010 7:09 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
Teiman



Joined: 03 Jun 2007
Posts: 309

PostPosted: Mon Jan 25, 2010 8:04 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
mh



Joined: 12 Jan 2008
Posts: 909

PostPosted: Mon Jan 25, 2010 8:26 pm    Post subject: Reply with quote

I think it should work because the command is forwarded to the server, but I haven't tested.
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines
Back to top
View user's profile Send private message Visit poster's website
Team Xlink



Joined: 25 Jun 2009
Posts: 320

PostPosted: Mon Jan 25, 2010 8:26 pm    Post subject: Reply with quote

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.
_________________
Anonymous wrote:
if it works, it works. if it doesn't, HAHAHA!
Back to top
View user's profile Send private message
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Mon Jan 25, 2010 9:53 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
mh



Joined: 12 Jan 2008
Posts: 909

PostPosted: Mon Jan 25, 2010 9:58 pm    Post subject: Reply with quote

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.
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines
Back to top
View user's profile Send private message Visit poster's website
Lardarse



Joined: 05 Nov 2005
Posts: 243
Location: Bristol, UK

PostPosted: Tue Jan 26, 2010 11:35 am    Post subject: Reply with quote

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...
_________________
<ekiM> Son, you're writing data structures your CPU can't cache.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group