View previous topic :: View next topic |
Author |
Message |
Stealth Kill
Joined: 29 Dec 2006 Posts: 83
|
Posted: Sun Apr 29, 2007 9:57 am Post subject: HUD Coding |
|
|
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 |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Sun Apr 29, 2007 12:36 pm Post subject: |
|
|
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 |
|
 |
Stealth Kill
Joined: 29 Dec 2006 Posts: 83
|
Posted: Sun Apr 29, 2007 12:59 pm Post subject: |
|
|
only the sbar.c`?
how can I start? |
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Sun Apr 29, 2007 1:56 pm Post subject: |
|
|
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 |
|
 |
Stealth Kill
Joined: 29 Dec 2006 Posts: 83
|
Posted: Tue May 01, 2007 10:10 am Post subject: |
|
|
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 |
|
 |
frag.machine

Joined: 25 Nov 2006 Posts: 728
|
Posted: Tue May 01, 2007 7:10 pm Post subject: |
|
|
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 |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Tue May 01, 2007 7:45 pm Post subject: |
|
|
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 |
|
 |
Stealth Kill
Joined: 29 Dec 2006 Posts: 83
|
Posted: Tue May 01, 2007 8:44 pm Post subject: |
|
|
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 |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Wed May 02, 2007 5:31 am Post subject: |
|
|
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 |
|
 |
Stealth Kill
Joined: 29 Dec 2006 Posts: 83
|
Posted: Wed May 02, 2007 12:35 pm Post subject: |
|
|
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 |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Wed May 02, 2007 3:21 pm Post subject: |
|
|
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 |
|
 |
Stealth Kill
Joined: 29 Dec 2006 Posts: 83
|
Posted: Wed May 02, 2007 4:59 pm Post subject: |
|
|
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
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 |
|
 |
r00k
Joined: 13 Nov 2004 Posts: 483
|
Posted: Thu May 03, 2007 9:42 am Post subject: |
|
|
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 |
|
 |
Stealth Kill
Joined: 29 Dec 2006 Posts: 83
|
Posted: Thu May 03, 2007 3:35 pm Post subject: |
|
|
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 |
|
 |
r00k
Joined: 13 Nov 2004 Posts: 483
|
Posted: Fri May 04, 2007 3:35 am Post subject: |
|
|
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 |
|
 |
|