Forum

HUD Coding

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

HUD Coding

Postby Stealth Kill » Sun Apr 29, 2007 9:57 am

Hey Can someone help me.
I´m working on a CounterStrike mod for PSP
I have the SOurce code of the quake engine but
i need a HUD like Counterstrike.

which file must I edit?

sbar.c? help please.
Stealth Kill
 
Posts: 83
Joined: Fri Dec 29, 2006 12:34 pm

Postby Sajt » Sun Apr 29, 2007 12:36 pm

Yes. It should be pretty obvious.
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 Stealth Kill » Sun Apr 29, 2007 12:59 pm

only the sbar.c`?

how can I start?
Stealth Kill
 
Posts: 83
Joined: Fri Dec 29, 2006 12:34 pm

Postby Sajt » Sun Apr 29, 2007 1:56 pm

Learn to program... after that it becomes pretty straightforward
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 Stealth Kill » Tue May 01, 2007 10:10 am

I need help


Code: Select all
===============
Sbar_DrawInventory
===============
*/
void Sbar_DrawInventory (void)
{
   int      i;
   char   num[6];
   float   time;
   int      flashon;
   qboolean headsup;
   qboolean hudswap;

   headsup = !(cl_sbar.value || scr_viewsize.value < 100);
   hudswap = cl_hudswap.value; // Get that nasty float out :)

   if (!headsup)
      Sbar_DrawPic (0, -24, sb_ibar);


i can´t compile this what is wrong?
Stealth Kill
 
Posts: 83
Joined: Fri Dec 29, 2006 12:34 pm

Postby frag.machine » Tue May 01, 2007 7:10 pm

Stealth Kill wrote:I need help


Code: Select all
===============
Sbar_DrawInventory
===============
*/
void Sbar_DrawInventory (void)
{
   int      i;
   char   num[6];
   float   time;
   int      flashon;
   qboolean headsup;
   qboolean hudswap;

   headsup = !(cl_sbar.value || scr_viewsize.value < 100);
   hudswap = cl_hudswap.value; // Get that nasty float out :)

   if (!headsup)
      Sbar_DrawPic (0, -24, sb_ibar);


i can´t compile this what is wrong?


It's very hard to tell looking only to code snipets. If you want to make a game you really should consider learning at least some basic programming skills first.
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 Sajt » Tue May 01, 2007 7:45 pm

Have you actually defined the cl_sbar, and cl_hudswap cvars? If so, are they either in sbar.c or externed in sbar.c or externed in a header file included by sbar.c?
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 Stealth Kill » Tue May 01, 2007 8:44 pm

Yes I defined them in to client.H

I´m using the Qrack source to mix it up with the PSP
source code.

I can copy and paste it till

______________
Sbar_DrawInventory
_____________

when I paste the cl_sbar command it can´t find it.
But I have written it into the client.h
Stealth Kill
 
Posts: 83
Joined: Fri Dec 29, 2006 12:34 pm

Postby Sajt » Wed May 02, 2007 5:31 am

What's the compiler error?
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 Stealth Kill » Wed May 02, 2007 12:35 pm

When I only Paste the Draw INventory it says this.


Image


and when I put this
extern cvar_t cl_sbar;
to the client.h

this error

Image
Stealth Kill
 
Posts: 83
Joined: Fri Dec 29, 2006 12:34 pm

Postby Spike » Wed May 02, 2007 3:21 pm

Looks like you're trying to plug quakeworld code into a non-quakeworld engine.
You'll need to remove those extra references (rewrite them to be hardcoded constant values) or define them properly (rather than merely referencing them).
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Stealth Kill » Wed May 02, 2007 4:59 pm

Yes the PSP quake engine don´t use QW.

Are there any PC quake engine Sources without QW?

or can you explaine me what can I do?

Step by Step please :P

I´m new to codeing

is it helpful wenn i upload the sbar.c from qrack and teh sbar.c from
psp quake?
Stealth Kill
 
Posts: 83
Joined: Fri Dec 29, 2006 12:34 pm

Postby r00k » Thu May 03, 2007 9:42 am

cl_sbar is defined in cl_main.c

cvar_t cl_sbar = {"cl_sbar", "0", true};


its used to toggle the old quake sbar or the new "cut out" overlayed sbar...

just remove reference to that (if you only want the old style).

Otherwise you'll have to tweak the placements of the hud icons to where u want them. (I cant think of how CS's hud looks at the moment). You cant just cut/past that sbar code into the PSP project as there is a great deal of support code that goes with much of the new sbar. Just keep diggin and you find the other required functions.
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Postby Stealth Kill » Thu May 03, 2007 3:35 pm

:( :( :( :( :(

My Sbar just tunred Black and I can se a text in the background
time.............


Image

are these files important for the hud too?

screen.c
r_draw.c
video_hardware_screen.cpp
video_hardware_draw.cpp
Stealth Kill
 
Posts: 83
Joined: Fri Dec 29, 2006 12:34 pm

Postby r00k » Fri May 04, 2007 3:35 am

by the time your actually finish this project, you'll be 30 and wont car e about the psp. Do yourself a favor, grab a C programming book and stop cut pasting.
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Next

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest