HUD


(Schubi) #1

I’d like to change the position of the compass in ET, but unfortunately I can’t find the file, where the HUD is defined! Does anybody know, where to search?


(nUllSkillZ) #2

Hi,

I’ve searched the source for “compass”.
It seems that the source for compass is in “cg_draw.c”.


(sniser) #3

:banana:


(pgh) #4

hax!!11


(Schubi) #5

Hmmm,… I see. So it is not possible to change the HUD, without making a server and clientside mod… Or is there any other way to change the hud only with a clientside mod?

@sniser Nice pic! I also like to remove the face in the left lower corner in the original hud… it takes to much space…


(Fusen) #6

lol how many awards can you get in your mod sniser? o.0


BUY AIR ONE VAPORIZER


(nUllSkillZ) #7

If the source for the compass/HUD is only located in the file “cg_draw.c” then you will get a client side mod by changing this file.


(pgh) #8

If you play ETPro tho, you can change the layout of the HUD as it comes with several predefined layouts. Use the either:

cg_althud or b_althud 0-5

Cant remember which but its one. More than likely the b_. As they said, the other way to get it in to say etmain is a quickhack of the cg_draw.c, compile and add.


(mgt) #9

the compass contains of two elements: the compass icon (that silver circle around it) and the auto-map (the small command map), which means both positions have to be changed.

to change the position of the whole thing, i’d advice to go the following way:

  1. open file: cg_local.h
    define two new pre-processor macros (wherever you want):
#define COMPASS_XPOS <xpos>
#define COMPASS_YPOS <ypos>

replace and with the coordinates where you want the compass to be. standard values are 520 and 20.

  1. open file: cg_draw.c
    line: 3476 f. / command: CG_DrawNewCompass
    in these two lines the variables basex and basey are assigned
    change these lines to:
basex = COMPASS_XPOS - 16;
basey = COMPASS_YPOS - 16;
  1. open file: cg_commandmap.c
    line: 1048 f. / command: CG_DrawAutoMap
    in these lines the vars x and y are assigned, change them to:
x = COMPASS_XPOS;
y = COMPASS_YPOS;

re-compile the cgame dll and there you go :cool:

hope i helped

btw … what’s a “quickhack”?


(HerrK) #10

For help by the HUD-System ask bani!
ET Pro have many HUD changes and variants for player…

But i think he have in the moment (ET TV & ET for Mac) not so much time for others… :disgust:

@ sniser:
Hehe…fat heads! :smiley:

(NdK) :wink:


(pgh) #11

He just doesn’t love us anymore :frowning:


(Schubi) #12

Ok, I did a graphical shoot of what I’m thinking, take a look HERE. I like the HUD in RtCW, so I tried to make it a little bit in that way. Does anyone want to help, to realize this? :slight_smile:


(nUllSkillZ) #13

I would like to help. But I’m only a nOOb-programmer. I f thats OK for you.


(mgt) #14

short instruction for the compass (again):

cg_draw.c / line 3476

basex = COMPASS_XPOS - COMPASS_ICONSIZEINC / 2;
basey = COMPASS_YPOS - COMPASS_ICONSIZEINC / 2;
basew = COMPASS_SIZEW + COMPASS_ICONSIZEINC;
baseh = COMPASS_SIZEH + COMPASS_ICONSIZEINC;

cg_commandmap.c / line 1048

x = COMPASS_XPOS;
y = COMPASS_YPOS;
w = COMPASS_SIZEW;
h = COMPASS_SIZEH;

and finally cg_local.h

#define COMPASS_XPOS 280
#define COMPASS_YPOS 405
#define COMPASS_SIZEW 60
#define COMPASS_SIZEH 60
#define COMPASS_AUTOMAPZOOM 4.0
#define COMPASS_ICONSIZEINC 24.8

in order to change the position/size of the compass, just modify the values in the cg_local.h.