ItsMods

Full Version: Custom gametype HUD
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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]
I did same way and i had bad result Fuu
ty
Very nice
Can't you do this in a gsc too?
(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
(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
(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
(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
(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.
Good tut iEagle
Pages: 1 2