UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

having issues with creating hud stuff

broken avatar :(
Created 1 year ago
by treyhexagon
0 Members and 1 Guest are viewing this topic.
519 views
broken avatar :(
×
broken avatar :(
Location: uspgh
Date Registered: 12 October 2020
Last active: 1 year ago
Posts
5
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
treyhexagon's Groups
treyhexagon's Contact & Social Links
so i been working on a map for a while and wanted to put in hud elements i got text based huds working fine but am having issues with making hud icons. do i need to create them as textures for referencing and also the function createicon in maps\mp\_hud_util just refuses to work it gives me unknown function and yes i tried both including it by #include maps\mp\_hud_util and calling the function from a function using a var and calling the function on it. ob maps\mp\_hud_util::createicon; also just tried calling the function directly without an object. honestly am stuck with no clue what to do to make it work.
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 9 days ago
Posts
645
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
No code is bug free
Signature
My published cod maps:

Subzero
Djinncaves
Enclosed (a.k.a baconcube)
Bayern
Snowblind
Furtrelock

Black Ops Perks: https://www.ugx-mods.com/forum/scripts/55/call-of-duty-world-at-war-black-ops-perks/22180/
×
gympie6's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
gympie6's Contact & Social LinksTheRevenantSkullTeffrieTeffrieGympie5#5971
so i been working on a map for a while and wanted to put in hud elements i got text based huds working fine but am having issues with making hud icons. do i need to create them as textures for referencing and also the function createicon in maps\mp\_hud_util just refuses to work it gives me unknown function and yes i tried both including it by #include maps\mp\_hud_util and calling the function from a function using a var and calling the function on it. ob maps\mp\_hud_util::createicon; also just tried calling the function directly without an object. honestly am stuck with no clue what to do to make it work.
I cannot remember I have every used this, for zombies I mostly used something simple like this:
Code Snippet
Plaintext
// You need to precache the image
PrecacheShader( "SHADER_NAME_HERE" );

// In .gsc when I create an perk on my hud I do something like this:
hud = create_simple_hud( self );
hud.foreground = true;
hud.sort = 1;
hud.hidewheninmenu = false;
hud.alignX = "left";
hud.alignY = "bottom";
hud.horzAlign = "left";
hud.vertAlign = "bottom";
hud.x = self.perk_hud.size * 30;
hud.y = hud.y - 70;  
hud.alpha = 0;
hud setShader( SHADER_NAME_HERE, 48, 48 );
hud scaleOverTime( .5, 24, 24 );
hud fadeOverTime( .5 );
hud.alpha = 1
I hope it helps
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 5 December 2016
Last active: 4 days ago
Posts
59
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
×
John_Banana's Groups
John_Banana's Contact & Social LinksJohn_BananaYouTube Channel
I added easter egg items to my mod this might be useful if you want to have an item show up in the bottom right corner
 
Code Snippet
cpp
// First, you need to run the function wherever you want (like in another function when a player buys something or picks something up) and you can do that with:

    player item_hud_create("NAME_OF_TEXTURE");

// then just put the rest at the bottom of your script:

item_hud_create(item_texture)
{
        shader = item_texture;
        self.item_hud = create_simple_hud( self );
        self.item_hud.foreground = true;
        self.item_hud.sort = 2;
        self.item_hud.hidewheninmenu = false;
        self.item_hud.alignX = "center";
        self.item_hud.alignY = "bottom";
        self.item_hud.horzAlign = "right";
        self.item_hud.vertAlign = "bottom";
        self.item_hud.x = -230;
        self.item_hud.y = -1;
        self.item_hud.alpha = 1;
        self.item_hudSetShader( shader, 32, 32 );

        self thread item_hud_remove();
}

item_hud_remove()
{
    level waittill_any( "end_game", "PUT_OTHER_NOTIFY_HERE_IF_U_WANT" );
   
    self.item_hud destroy_hud();
    self.item_hud = undefined;

}

Last Edit: March 12, 2023, 12:25:41 am by John_Banana

 
Loading ...