Forum

HUD drawing in QuakeC?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

HUD drawing in QuakeC?

Postby Willem » Thu Feb 14, 2008 8:52 pm

I'm getting the impression from my searching that the answer is NO, but is there a way to customize the HUD in vanilla Quake 1 via QuakeC?

Even the ability to put up some text strings each frame would be enough.
Willem
 
Posts: 73
Joined: Wed Jan 23, 2008 10:58 am

Postby Spike » Thu Feb 14, 2008 11:46 pm

Vanilla Quake 1... not clean ways.
You can centerprint a string with just the right number of leading newlines that it appears just above the hud - but that requires knowing their screen resolution. Or you can spam console prints at them, but that only shows on the top four lines on the console (and destroys any other notifications you might send).

There are other perfectly viable methods, just not in vanilla quake 1.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Urre » Fri Feb 15, 2008 8:58 am

As Spike said, centerprint is your method of choice. Look in the tutorial section of this site, and you should soon find a couple about QC menus, which do exactly this. Remember to not spam the centerprints too often if you want it to be playable in multiplayer
I was once a Quake modder
User avatar
Urre
 
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon

Postby leileilol » Sat Feb 16, 2008 3:22 pm

Centerprint can look good if you got a good conchars font for it
Image

Problem is getting working menus, overlapping cursors, etc etc
i should not be here
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am


Postby Willem » Sat Feb 16, 2008 6:40 pm

I tried burping but it didn't produce those same results. What is that, a bunch of centerprint'ing or something else?
Willem
 
Posts: 73
Joined: Wed Jan 23, 2008 10:58 am

Postby frag.machine » Sat Feb 16, 2008 6:48 pm

I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Postby Willem » Sat Feb 16, 2008 7:37 pm

Is that vanilla Quake 1? If so, how please. :)
Willem
 
Posts: 73
Joined: Wed Jan 23, 2008 10:58 am

Postby Dr. Shadowborg » Sun Feb 17, 2008 12:37 am

Willem wrote:I tried burping but it didn't produce those same results. What is that, a bunch of centerprint'ing or something else?


Yes it's centerprint, but not a whole buttload of them.

Look in the Frikbot X source:
http://www.inside3d.com/frikbot/fbx/

If you absolutely must have something more simplified, I suppose I could be persuaded to cough up my code.
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1110
Joined: Sat Oct 16, 2004 3:34 pm

Postby Urre » Sun Feb 17, 2008 7:54 am

Like I said earlier, there are tutorials on this site which do what you want.
I was once a Quake modder
User avatar
Urre
 
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon

Postby Willem » Sun Feb 17, 2008 10:24 am

Yeah, thanks all! Got the message.
Willem
 
Posts: 73
Joined: Wed Jan 23, 2008 10:58 am

Postby Dr. Shadowborg » Sun Feb 17, 2008 4:37 pm

Urre wrote:Like I said earlier, there are tutorials on this site which do what you want.


Bad, bad Urre. Not only is that tutorial incomplete (what pray tell refreshes the menu list when you move out of the trigger? It's not nice to make it so that the player does something unknown when he tries to change weapons) it doesn't cover the vastly more useful multi-string centerprint. (Such as the one in FBX's source, which incidentally comes with a menu system by merit of the waypoint editor)

/me resolves to make a new tutorial to address this issue very soon
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1110
Joined: Sat Oct 16, 2004 3:34 pm

Postby frag.machine » Sun Feb 17, 2008 5:52 pm

Willem wrote:Is that vanilla Quake 1? If so, how please. :)


Actually is pretty simple. Open up defs.qc and add the following line just below the regular centerprint() builtin definition:
Code: Select all
void(entity client, string s) centerprint = #73;   // sprint, but in middle
void(entity client, string s1, string s2, string s3, string s4, string s5, string s6, string s7) centerprint7 = #73;


And BANG, you can do things like you see in the previous screenshot:
Code: Select all
void () actorShowMenu =
{
      centerprint7 (self.owner.enemy, self.owner.killtarget, self.owner.netname, "\n[", self.owner.targetname, "]\n\n", self.owner.message, "");
};
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Postby Urre » Sun Feb 17, 2008 6:13 pm

Borg: I'm pretty sure Willem can edit it to do what he wants, if it's incomplete. I recall doing so when I used that tutorial, didn't even use the trigger part.
I was once a Quake modder
User avatar
Urre
 
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon

Postby Willem » Sun Feb 17, 2008 7:24 pm

Sure, I can jigger up centerprint to put stuff in the middle of the screen but I was looking for something more than that. It evidently doesn't exist. Ahh well.
Willem
 
Posts: 73
Joined: Wed Jan 23, 2008 10:58 am

Next

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest