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

Give hud elements a tint & Monkey not displaying on my hud?

broken avatar :(
Created 10 years ago
by Deleted User
0 Members and 1 Guest are viewing this topic.
3,190 views
broken avatar :(
  • Exofile
  • Deleted Member
×
broken avatar :(
Exofile
This user is deleted :(
I've got 2 script related issues here, so I put both here to make it simpler.

First off, I'm wondering if it's possible for me to give an image displayed on the hud a tint? Basically, my ammo counter is blue currently, the numbers. But when a gun is low on ammo, I'd want it to be red. I already have red images I could use, but I'm wondering if there is a way to just simply give the images a tint, to save space on images used in my mod? Furthermore, how would I have it check for low ammo, and display these images instead?

Here is how I have the dvars set for my ammo counter, that is then drawn in motd_hud.menu
Code Snippet
Plaintext
		clipCount = self GetWeaponAmmoClip(newWeap);
stockCount = self GetWeaponAmmoStock(newWeap);

unitsClip = clipCount % 10;
tensClip = ((clipCount - unitsClip) % 100) / 10;
hundredsClip = (clipCount - (unitsClip + (tensClip * 10))) / 100;

unitsStock = stockCount % 10;
tensStock = ((stockCount - unitsStock) % 100) / 10;
hundredsStock = (stockCount - (unitsStock + (tensStock * 10))) / 100;

// Will comment/remove this line once I get the imagecounter working instead.
// self SetClientDvar("hud_player_ammo_weapon", clipCount + "/" + stockCount);

self SetClientDvar("stock_amount", stockCount);
self SetClientDvar("clip_amount", clipCount);
self SetClientDvar("pos1", "number_"+hundredsClip);
self SetClientDvar("pos2", "number_"+tensClip);
self SetClientDvar("pos3", "number_"+unitsClip);
self SetClientDvar("pos4", "number_"+hundredsStock);
self SetClientDvar("pos5", "number_"+tensStock);
self SetClientDvar("pos6", "number_"+unitsStock);
}
}



Secondly, I can't seem to get Monkey Bombs to properly display on my hud?
I've got an image, converted in assman just like my other elements, "the_giant_monkey".
I'm using Dukip's MOTD hud, modified images and positions etc, to use an ammo counter with images.

Issue is, the images don't display? It shows the normal images, at it's normal position, instead of my images at my positions.

In mod.csv I have
Code Snippet
Plaintext
material,the_giant_monkey
menufile,ui\motd_hud.menu

I have the image in my mod, ticked off in the .iwd list.

Here are the images drawn in motd_hud.menu. It's just as my normal grenades are drawn, only with different images and positions, and dvars.
Code Snippet
Plaintext
		itemDef
{
name "offhandSmokeIcon1"
type ITEM_TYPE_OWNERDRAW
rect (GRENADE_X_START-(GRENADE_X_SPACE*4)) (WEAPINFO_Y-44) 18 18
forecolor 1 1 1 1
exp forecolor A (1/dvarInt("hud_player_ammo_grenade_secondary"))
ownerdraw CG_OFFHAND_WEAPON_ICON_SMOKEFLASH
background "the_giant_monkey" // default texture
visible when(dvarInt("hud_player_ammo_grenade_secondary") > 0)
decoration
}

itemDef
{
name "offhandSmokeIcon2"
type ITEM_TYPE_OWNERDRAW
rect (GRENADE_X_START-(GRENADE_X_SPACE*5)) (WEAPINFO_Y-43) 18 18
forecolor 1 1 1 1
exp forecolor A (2/dvarInt("hud_player_ammo_grenade_secondary"))
ownerdraw CG_OFFHAND_WEAPON_ICON_SMOKEFLASH
background "the_giant_monkey" // default texture
visible when(dvarInt("hud_player_ammo_grenade_secondary") > 1)
decoration
}

itemDef
{
name "offhandSmokeIcon3"
type ITEM_TYPE_OWNERDRAW
rect (GRENADE_X_START-(GRENADE_X_SPACE*6)) (WEAPINFO_Y-42) 18 18
forecolor 1 1 1 1
exp forecolor A (3/dvarInt("hud_player_ammo_grenade_secondary"))
ownerdraw CG_OFFHAND_WEAPON_ICON_SMOKEFLASH
background "the_giant_monkey" // default texture
visible when(dvarInt("hud_player_ammo_grenade_secondary") > 2)
decoration
}

itemDef
{
name "offhandSmokeIcon4"
type ITEM_TYPE_OWNERDRAW
rect (GRENADE_X_START-(GRENADE_X_SPACE*7)) (WEAPINFO_Y-41) 18 18
forecolor 1 1 1 1
exp forecolor A (4/dvarInt("hud_player_ammo_grenade_secondary"))
ownerdraw CG_OFFHAND_WEAPON_ICON_SMOKEFLASH
background "the_giant_monkey" // default texture
visible when(dvarInt("hud_player_ammo_grenade_secondary") > 3)
decoration
}

Any response is much appreciated, as always. Thanks! :)
Last Edit: February 22, 2016, 01:08:47 am by Exofile
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 3 years ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
ownerdraw takes precedence over background.

You can instead make an exp material( dvarString("draw_this_image") ) (remove the ownerdraw & background)
broken avatar :(
  • Exofile
  • Deleted Member
×
broken avatar :(
Exofile
This user is deleted :(
ownerdraw takes precedence over background.

You can instead make an exp material( dvarString("draw_this_image") ) (remove the ownerdraw & background)

So I'd have it like this?:
Code Snippet
Plaintext
		itemDef
{
name "offhandSmokeIcon2"
type ITEM_TYPE_OWNERDRAW
rect (GRENADE_X_START-(GRENADE_X_SPACE*5)) (WEAPINFO_Y-43) 18 18
forecolor 1 1 1 1
exp forecolor A (2/dvarInt("hud_player_ammo_grenade_secondary"))
exp material( dvarString("the_giant_monkey") )
// ownerdraw CG_OFFHAND_WEAPON_ICON_SMOKEFLASH
// background "the_giant_monkey" // default texture
visible when(dvarInt("hud_player_ammo_grenade_secondary") > 1)
decoration
}
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 3 years ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Yeah only have 4 (1 total of the secondary grenades) and just keep overriding the materials based on what secondary you have.

But to be honest it should automatically update already when you get monkeys. Doing give monkeybomb won't update it until you throw (or get it through script) it if you're using my HUD script
broken avatar :(
  • Exofile
  • Deleted Member
×
broken avatar :(
Exofile
This user is deleted :(
Yeah only have 4 (1 total of the secondary grenades) and just keep overriding the materials based on what secondary you have.

But to be honest it should automatically update already when you get monkeys. Doing give monkeybomb won't update it until you throw (or get it through script) it if you're using my HUD script

I had this, and got monkeys properly from the box, but they didn't show up on the hud?
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 3 years ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
I had this, and got monkeys properly from the box, but they didn't show up on the hud?
Check the script you have to manually update the monkeys.
(_zombiemode_weapons I think)
broken avatar :(
  • Exofile
  • Deleted Member
×
broken avatar :(
Exofile
This user is deleted :(
Check the script you have to manually update the monkeys.
(_zombiemode_weapons I think)
Code Snippet
Plaintext
	//DUKIP - For molotov or any other unknown grenade type.
if(maps\_t6_hud::is_grenade_type(weapon_string, false))
self SetClientDvar("hud_player_ammo_grenade_secondary", self GetWeaponAmmoStock(weapon_string));

Your _zombiemode_weapons.gsc had 2 instances where I saw a change. this, and one that returns playertype, which doesn't seem to be the issue of this. Both are included in my _zombiemode_weapons, and here is the alternate grenade part of it. ;)
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
Code Snippet
Plaintext
	//DUKIP - For molotov or any other unknown grenade type.
if(maps\_t6_hud::is_grenade_type(weapon_string, false))
self SetClientDvar("hud_player_ammo_grenade_secondary", self GetWeaponAmmoStock(weapon_string));

Your _zombiemode_weapons.gsc had 2 instances where I saw a change. this, and one that returns playertype, which doesn't seem to be the issue of this. Both are included in my _zombiemode_weapons, and here is the alternate grenade part of it. ;)
ideally should go in the give weapon function or the box take function - as that's where the weapons script gets threaded too

Alternatively in the function that gets threaded ( zombiemode_monkeys.gsc or whatever )

 
Loading ...