Forum

[DarkPlaces] QC drawing graphics onto the screen?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Postby Nash » Fri Nov 02, 2007 5:11 am

Well, all I wanted to do was create a custom HUD and draw some in-game menus for the player inventory.

I'll just attach the stuff to the player's view and make use of DP's EF_NOGUNBOB. This CSQC stuff is way too complicated for me.
User avatar
Nash
 
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia

Postby daemon » Wed Nov 07, 2007 11:41 pm

CSQC isn't too difficult... it's just that the people who know how to use it don't know how to explain it in an orderly manner. (I probably don't either :))

but having said that... where you want to start is in CSQC_UpdateView (hopefully you already have some kind of csqc codebase)

for starters, try messing around in this function by adding some lines after R_RenderScene();

for example:

drawstring('320 240 0', "this is a string", '10 10 0', '1 1 1', 1, 0);

or

drawpic('320 240 0', "image.tga", '32 32 0', '1 1 1', 1, 0);
-daemon [ daemonforge.org ]
User avatar
daemon
 
Posts: 63
Joined: Wed Nov 07, 2007 11:10 pm

Postby Nash » Thu Nov 08, 2007 5:09 am

daemon wrote:(hopefully you already have some kind of csqc codebase)


No, I don't. The only one available to me, from Nexuiz, is heavily convoluted and not suitable for learning from.

Care to post a clean CSQC base for modders?

Also, I think half of the problem would be solved if someone would be kind enough to give ANY kind of explanation on the parameters for most of the important built-in functions for CSQC. Yes I realize the types are named clearly but it doesn't really tell much IMO.
User avatar
Nash
 
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia

Postby daemon » Sat Nov 10, 2007 7:46 pm

trying to get ahold of Dresk to see if I can post what he gave me... not really sure yet if i need to get permission first or credit anyone
-daemon [ daemonforge.org ]
User avatar
daemon
 
Posts: 63
Joined: Wed Nov 07, 2007 11:10 pm

Postby daemon » Sat Nov 10, 2007 10:48 pm

Here's the CSQC codebase that Dresk put together:
http://www.daemonforge.org/files/source/csqc-scratch.zip
-daemon [ daemonforge.org ]
User avatar
daemon
 
Posts: 63
Joined: Wed Nov 07, 2007 11:10 pm

Postby Nash » Sun Nov 11, 2007 1:14 am

Much appreciated. Thank you.

I'm just wondering though, why is this file so hidden? Had it not been for this forum thread, I don't think it would be possible to ever get a hold of that file, heck no one would even know it exists.
User avatar
Nash
 
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia

Postby daemon » Sun Nov 11, 2007 2:10 am

I don't think it did exist at all until somewhat recently.
-daemon [ daemonforge.org ]
User avatar
daemon
 
Posts: 63
Joined: Wed Nov 07, 2007 11:10 pm

Postby xaGe » Sun Nov 11, 2007 4:45 am

Sweet...
User avatar
xaGe
 
Posts: 461
Joined: Wed Mar 01, 2006 8:29 am
Location: Upstate, New York

Postby Sajt » Sun Nov 11, 2007 5:25 am

I'm just looking at it, haven't tried it. In main.qc, the CSQC_Parse_TempEntity() function has a TE_GUNSHOT handler, but doesn't do anything - it just says '//do something cool with TE_GUNSHOT!' This looks like something that will crash unless you comment the TE_GUNSHOT case out, or add code to parse the 3 coords and do something with them. (Since bHandled is true unless the switch hits the default case).
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby daemon » Sun Nov 11, 2007 7:41 pm

You're right. I just tried it and it crashes. That whole lower section of Main.qc is actually not used because of line 50 "#ifdef USE_CSQC_OPTIONALFUNCTIONS", but if you comment that out it will crash when TE_GUNSHOT is called.

I've just commented out those example lines inside CSQC_Parse_TempEntity and reuploaded the zip.
http://www.daemonforge.org/files/source/csqc-scratch.zip
-daemon [ daemonforge.org ]
User avatar
daemon
 
Posts: 63
Joined: Wed Nov 07, 2007 11:10 pm

Postby Nash » Sun Nov 11, 2007 8:22 pm

Thanks for the fix, daemon!
User avatar
Nash
 
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia

Previous

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest