• 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial Custom gametype HUD
#1
I'm sure you guys have all seen the score HUD in wager matches, you can do the same with every gametype, also with custom ones. That way you don't have to edit hud.menu and you can play the normal gamemodes as well.

for this tut my gametype will be "mod"

create 2 new textfiles:
mp_mod\ui_mp\hud_mod.menu
mp_mod\ui_mp\hud_mod.txt

put the following in the txt file:
Code:
{
    loadMenu { "ui_mp/hud_mod.menu" }
}

then create your score-hud in the hud_mod.menu file, here's an example:
Code:
// CONSOLE HUD - MP

#include "ui/menudef.h"
#include "ui_mp/hud_gametypes.inc"
#include "ui_mp/hud_wager_summary.inc"
        
{
    // game messages
    menuDef
    {
        name            "mod_gamemessages"
        rect            0 0 0 0 HORIZONTAL_ALIGN_USER_RIGHT VERTICAL_ALIGN_USER_TOP
        fullScreen        0
        visible            1
        visibilityBits    bits( !BIT_IN_KILLCAM !BIT_DEMO_ALL_GAME_HUD_HIDDEN )
        
        itemDef
        {
            rect                0 0 0 0
            exp                    rect Y( 5 );
            exp                    rect X( -5 );
            type                ITEM_TYPE_GAME_MESSAGE_WINDOW
            gamemsgwindowindex    0
            gamemsgwindowmode    MODE_BOTTOMUP_ALIGN_BOTTOM
            textfont            UI_FONT_DEFAULT
            textstyle            ITEM_TEXTSTYLE_SHADOWED
            textalign            ITEM_ALIGN_RIGHT
            textscale            TEXTSIZE_SMALL
            visible                1
            visibilityBits        bits( !BIT_UI_ACTIVE BIT_HUD_OBITUARIES )
        }    
    }

    menuDef
    {
        name            "scorebars_team_scores"
        rect            BOTTOM_RECT_X BOTTOM_RECT_Y 640 480 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN
        exp                rect Y( BOTTOM_RECT_Y - (ONLINEGAME * ONLINEGAME_OFFSET) );
        fullScreen        0
        visible         1
        visibilityBits    bits( BIT_HUD_VISIBLE !BIT_IN_KILLCAM !BIT_UI_ACTIVE !BIT_SPECTATING_CLIENT HUD_VISIBILITY SHOULD_DISPLAY_SCOREBAR )
        itemDef
        {
            style            WINDOW_STYLE_SHADER
            type            ITEM_TYPE_IMAGE
            rect            BG_START_X BG_START_Y (187*SPLITSCREEN_MULTIPLIER) (46*SPLITSCREEN_MULTIPLIER) WAGER_SUMMARY_ALIGN
            exp                material( "hud_frame_faction_fade" );
            forecolor        1 1 1 0.5
            visible         1
            decoration
        }
        itemDef
        {
            style            WINDOW_STYLE_SHADER
            type            ITEM_TYPE_IMAGE
            rect            (BAR_START_X-(69*SPLITSCREEN_MULTIPLIER)) (BG_START_Y-(14*SPLITSCREEN_MULTIPLIER)) (240*SPLITSCREEN_MULTIPLIER) (59*SPLITSCREEN_MULTIPLIER) WAGER_SUMMARY_ALIGN
            exp                material( "hud_frame_faction_lines" );
            forecolor        1 1 1 0.4
            visible         1
            decoration
        }
        itemDef
        {
            style            WINDOW_STYLE_SHADER
            type            ITEM_TYPE_IMAGE
            rect            FACTION_BG_X_START FACTION_BG_Y_START FACTION_BG_WIDTH FACTION_BG_HEIGHT WAGER_SUMMARY_ALIGN
            exp                material( "hud_faction_back_light" );
            forecolor        1 1 1 0.25
            visible         1
            decoration
        }
        itemDef
        {
            style            WINDOW_STYLE_SHADER
            type            ITEM_TYPE_IMAGE
            rect            FACTION_BG_X_START FACTION_BG_Y_START FACTION_BG_WIDTH FACTION_BG_HEIGHT WAGER_SUMMARY_ALIGN
            exp                material( "hud_faction_backing" );
            forecolor        1 1 1 0.2
            visible         1
            decoration
        }
        itemDef
        {
            style            WINDOW_STYLE_SHADER
            type            ITEM_TYPE_IMAGE
            rect            (FACTION_BG_X_START+(FACTION_BG_WIDTH/2)-FACTION_ICON_WIDTH/2) (FACTION_BG_Y_START+(FACTION_BG_HEIGHT/2)-FACTION_ICON_HEIGHT/2) FACTION_ICON_WIDTH FACTION_ICON_HEIGHT WAGER_SUMMARY_ALIGN
            exp                material( "cyaozm_icon_axis" );
            visible            when( team( name ) == "TEAM_AXIS" );
            forecolor        1 1 1 1
            decoration
        }
        itemDef
        {
            style            WINDOW_STYLE_SHADER
            type            ITEM_TYPE_IMAGE
            rect            (FACTION_BG_X_START+(FACTION_BG_WIDTH/2)-FACTION_ICON_WIDTH/2) (FACTION_BG_Y_START+(FACTION_BG_HEIGHT/2)-FACTION_ICON_HEIGHT/2) FACTION_ICON_WIDTH FACTION_ICON_HEIGHT WAGER_SUMMARY_ALIGN
            exp                material( "cyaozm_icon_allies" );
            visible            when( team( name ) == "TEAM_ALLIES" );
            forecolor        1 1 1 1
            decoration
        }
        itemDef    
        {
            type            ITEM_TYPE_TEXT
            rect            (BAR_START_X+FACTION_BG_WIDTH/2) -22 1 BAR_HEIGHT_TOP WAGER_SUMMARY_ALIGN
            dvar            "ui_zom_allies_alive"
            textstyle        ITEM_TEXTSTYLE_SHADOWED    
            textalign        ITEM_ALIGN_MIDDLE_LEFT
            textfont        UI_FONT_EXTRABIG
            textscale        TEXTSIZE_LARGE
            forecolor        1 1 1 0.65    
            visible            1
            decoration
        }
        itemDef    
        {
            type            ITEM_TYPE_TEXT
            rect            (BAR_START_X+FACTION_BG_WIDTH/2) -42 1 BAR_HEIGHT_TOP WAGER_SUMMARY_ALIGN
            dvar            "ui_zom_money" \
            textstyle        ITEM_TEXTSTYLE_SHADOWED    
            textalign        ITEM_ALIGN_MIDDLE_LEFT
            textfont        UI_FONT_EXTRABIG
            textscale        TEXTSIZE_LARGE
            forecolor        1 1 1 0.65    
            visible            when( team( name ) == "TEAM_ALLIES" );
            decoration
        }
        itemDef    
        {
            type            ITEM_TYPE_TEXT
            rect            (BAR_START_X+FACTION_BG_WIDTH/2) -42 1 BAR_HEIGHT_TOP WAGER_SUMMARY_ALIGN
            dvar            "ui_zom_health"
            textstyle        ITEM_TEXTSTYLE_SHADOWED    
            textalign        ITEM_ALIGN_MIDDLE_LEFT
            textfont        UI_FONT_EXTRABIG
            textscale        TEXTSIZE_LARGE
            forecolor        1 1 1 0.65    
            visible            when( team( name ) == "TEAM_AXIS" );
            decoration
        }
    }
}

the first menuDef: "mod_gamemessages" should always be in your file, this is the killfeed. After that you can make whatever you want.

Now add the files to your mod.csv

Code:
menufile,ui_mp/hud_mod.menu
menufile,ui_mp/hud_mod.txt

and when you start your gametype you will have a custom hud for that specific gametype Smile Ohh and don't forget to change the gametype name, so in this tutorial its "mod" and it should be renamed to your gametypename .. for every file like for tdm it would be: hud_tdm.txt etc

little screenie of the example above:
[Image: 36F9489FE5BC763BA59988D12D1B68AA6CA7631D]
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

[-] The following 9 users say Thank You to iAegle for this post:
  • Arteq, Bandarigoda123, Cyborgking, d0h!, Nekochan, Romuald27, surtek, Trojan, Yamato
  Reply
#2
I did same way and i had bad result Fuu
ty
C++/Obj-C developer. Neko engine wip
Steam: Click
  Reply
#3
Very nice
[Image: b_160_400_1_ffffff_c5c5c5_ffffff_000000_0_1_0.png]
Join our official zom_x7 server!
  Reply
#4
Can't you do this in a gsc too?
YouTube 1: Azumikkel - Modding
YouTube 2: DerpShark - Gaming Entertainment
Website: Jensby.me
Contact: im[at]jensby.me
  Reply
#5
(10-30-2011, 22:15)AZUMIKKEL Wrote: Can't you do this in a gsc too?

No azu, this isn't mw2 were everyone spams their gsc files with hud elements
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

  Reply
#6
(10-30-2011, 22:31)iAegle Wrote:
(10-30-2011, 22:15)AZUMIKKEL Wrote: Can't you do this in a gsc too?

No azu, this isn't mw2 were everyone spams their gsc files with hud elements

Thats why mw2 is better, Blush . HUDs full of shitty rainbow texts, Big Grin
[Image: veovuq.png]
  Reply
#7
(10-30-2011, 22:32)Yamato Wrote:
(10-30-2011, 22:31)iAegle Wrote:
(10-30-2011, 22:15)AZUMIKKEL Wrote: Can't you do this in a gsc too?

No azu, this isn't mw2 were everyone spams their gsc files with hud elements

Thats why mw2 is better, Blush . HUDs full of shitty rainbow texts, Big Grin

No, OMA is the reason why mw2 is better
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

[-] The following 2 users say Thank You to iAegle for this post:
  • Arteq, Yamato
  Reply
#8
(10-30-2011, 22:31)iAegle Wrote:
(10-30-2011, 22:15)AZUMIKKEL Wrote: Can't you do this in a gsc too?

No azu, this isn't mw2 were everyone spams their gsc files with hud elements

Don't care how hard you try to insult my use of hud elements, you can still do this with gsc Troll
YouTube 1: Azumikkel - Modding
YouTube 2: DerpShark - Gaming Entertainment
Website: Jensby.me
Contact: im[at]jensby.me
  Reply
#9
(10-30-2011, 22:40)AZUMIKKEL Wrote:
(10-30-2011, 22:31)iAegle Wrote:
(10-30-2011, 22:15)AZUMIKKEL Wrote: Can't you do this in a gsc too?

No azu, this isn't mw2 were everyone spams their gsc files with hud elements

Don't care how hard you try to insult my use of hud elements, you can still do this with gsc Troll

hud elements have shitty mouse controls and you can't use all the keys for hud actions.
[Image: MaEIQ.png]
  Reply
#10
Good tut iEagle
[Image: lQDUjba.jpg]
[-] The following 1 user says Thank You to OrangePL for this post:
  • Nekochan
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Black Ops 2 Custom background? jotape99 10 5,936 10-29-2013, 07:22
Last Post: xInfinity.
  Custom xanims DidUknowiPwn 8 3,301 08-28-2013, 08:17
Last Post: RaZ
  Help Make ac130 shoot custom bullets Ra3shed 0 1,219 07-23-2013, 13:02
Last Post: Ra3shed
Wink [Release] Shop system for Infected gametype Nekochan 125 36,360 07-05-2013, 18:09
Last Post: mohammadnanaa
Video Custom Facepaints? Cuddlyedits 5 1,724 07-01-2013, 14:58
Last Post: iPaddie
  Help dedicated servers and custom dvars mattyman 0 1,213 06-22-2013, 07:33
Last Post: mattyman
Information [Tutorial] Adding DLC Maps as Custom Maps. Nekochan 151 58,023 05-25-2013, 01:05
Last Post: Nero Z zero
  QS Mod by GeKKo v 6.5 with Custom Maps GeKKoFL0X 35 18,127 05-21-2013, 19:30
Last Post: [HARD] Tony.
  [Request] custom gun mod ColorCorrects 2 1,547 05-18-2013, 22:19
Last Post: mitchhacker
  Help Gametype WAR FaiR_PLaY 1 851 05-07-2013, 20:40
Last Post: DidUknowiPwn

Forum Jump:


Users browsing this thread: 1 Guest(s)