Inside3D!
     

HUD Coding
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
Stealth Kill



Joined: 29 Dec 2006
Posts: 83

PostPosted: Sun Apr 29, 2007 9:57 am    Post subject: HUD Coding Reply with quote

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



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Sun Apr 29, 2007 12:36 pm    Post subject: Reply with quote

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



Joined: 29 Dec 2006
Posts: 83

PostPosted: Sun Apr 29, 2007 12:59 pm    Post subject: Reply with quote

only the sbar.c`?

how can I start?
Back to top
View user's profile Send private message
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Sun Apr 29, 2007 1:56 pm    Post subject: Reply with quote

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



Joined: 29 Dec 2006
Posts: 83

PostPosted: Tue May 01, 2007 10:10 am    Post subject: Reply with quote

I need help


Code:

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



Joined: 25 Nov 2006
Posts: 728

PostPosted: Tue May 01, 2007 7:10 pm    Post subject: Reply with quote

Stealth Kill wrote:
I need help


Code:

===============
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.
_________________
frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/
Back to top
View user's profile Send private message Visit poster's website
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Tue May 01, 2007 7:45 pm    Post subject: Reply with quote

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



Joined: 29 Dec 2006
Posts: 83

PostPosted: Tue May 01, 2007 8:44 pm    Post subject: Reply with quote

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



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Wed May 02, 2007 5:31 am    Post subject: Reply with quote

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



Joined: 29 Dec 2006
Posts: 83

PostPosted: Wed May 02, 2007 12:35 pm    Post subject: Reply with quote

When I only Paste the Draw INventory it says this.





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

this error

Back to top
View user's profile Send private message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Wed May 02, 2007 3:21 pm    Post subject: Reply with quote

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



Joined: 29 Dec 2006
Posts: 83

PostPosted: Wed May 02, 2007 4:59 pm    Post subject: Reply with quote

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 Razz

I´m new to codeing

is it helpful wenn i upload the sbar.c from qrack and teh sbar.c from
psp quake?
Back to top
View user's profile Send private message
r00k



Joined: 13 Nov 2004
Posts: 483

PostPosted: Thu May 03, 2007 9:42 am    Post subject: Reply with quote

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



Joined: 29 Dec 2006
Posts: 83

PostPosted: Thu May 03, 2007 3:35 pm    Post subject: Reply with quote

Sad Sad Sad Sad Sad

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




are these files important for the hud too?

screen.c
r_draw.c
video_hardware_screen.cpp
video_hardware_draw.cpp
Back to top
View user's profile Send private message
r00k



Joined: 13 Nov 2004
Posts: 483

PostPosted: Fri May 04, 2007 3:35 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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