UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: Scobalula on February 23, 2016, 09:40:51 am

Title: Black Ops 2 Style Weapon Icon
Post by: Scobalula on February 23, 2016, 09:40:51 am
I've been trying this for ages last night and still can't seem to get it (I am new to programming/scripting/coding, etc. in general tho.), in short I am looking to replicate this:

(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FWD339Cr.jpg&hash=f28565f9c4f6de3e2e6318c7548c54b2f34a541f)


(no, not the actual M14 icon some in chat thought I was on about, I can get that with iPak exporter by Tom)

I could just make a trigger in Radiant and work with that but this is way too inefficient and I fear I'll run into getting closer to g_spawn if I start doubling how many ents are used for weapon buys.

I have tried several things, including getting the script_noteworthy of the gun, the weapon name, etc. in _zombiemode_weapons.

My idea is to have it get the script_noteworthy of the weapon or the weapon name defined in add_zombie_weapon() and then based off that have a material witht he same name to display, either through GSC or Menu with DVARs, so for example it would get script_noteworthy of let's say m1911 and then a material would be set up called m1911 and it would set that.

I'm new to scripting like I said so do excuse my ignorance, this could be something so easy and I'm making doggies dinner out of it, I understand for scripters it's probably easier to just give me a direct script and leave it at that but if possible I would appreciate if you do answer this to explain how it's done, etc. all in effort to improve my scripting skills so I don't have to come back that often. :D

Thanks in advance. :)
Title: Re: Black Ops 2 Style Weapon Icon
Post by: Harry Bo21 on February 23, 2016, 12:16:27 pm
this feature was also in BO2

something i wanted to, but i suspect its already set up,, i just dont know how to use it lol ( weapons on the floor display the hud icon )

you could either store weapons in a array, and use that to work out what image to show, or write a big case function

Code Snippet
Plaintext
switch( gun )
{
    case "zombie_colt":
        return "colt_hud_image";
}
Title: Re: Black Ops 2 Style Weapon Icon
Post by: MakeCents on February 23, 2016, 01:21:38 pm
I've been meaning to get around to this but I have been too busy troubleshooting ORBiT. I think it can be done in menu using an existing dvar, like the flamethrower uses. I've added icons to hints for perks, several of them, and started to try my one hud that requires the gun image, and it seemed to work but I didn't have images so it was the default texture for most, then I got distracted. I would look in the weaponinfo menuDef in the hud.menu for something commented out that relates to the weapon icon or something if I remember correctly. Then use that dvar. It might be set when your holding the weapon?


If I'm wrong about that, then it simply becomes a matter of you setting your own dvar, based on the weapon file name. You could simply make your material match the weapon file name with _icon or something on the end. Use gsc to get the current wall weapon with _icon at end and set the client dvar to that, for the itemdef you added to menu. Of course you would need to be using  menu hinstring method for your wall weapons for this to work easily.
Title: Re: Black Ops 2 Style Weapon Icon
Post by: Scobalula on February 23, 2016, 01:45:35 pm
I've been meaning to get around to this but I have been too busy troubleshooting ORBiT. I think it can be done in menu using an existing dvar, like the flamethrower uses. I've added icons to hints for perks, several of them, and started to try my one hud that requires the gun image, and it seemed to work but I didn't have images so it was the default texture for most, then I got distracted. I would look in the weaponinfo menuDef in the hud.menu for something commented out that relates to the weapon icon or something if I remember correctly. Then use that dvar. It might be set when your holding the weapon?


If I'm wrong about that, then it simply becomes a matter of you setting your own dvar, based on the weapon file name. You could simply make your material match the weapon file name with _icon or something on the end. Use gsc to get the current wall weapon with _icon at end and set the client dvar to that, for the itemdef you added to menu. Of course you would need to be using  menu hinstring method for your wall weapons for this to work easily.

I was able to get it to work with some help with Hitman fixing up my sloppy scripting, lol, I got the the weapon wall buys with getentarray, then checked if the player is, looking at the gun and if their distance is not too far away. Then I just got what the script_noteworthy of the trigger their looking at and currently all I've done is print this on screen but I understand enough of menu editing to get it to work in menu with dvars. :D

(https://i.gyazo.com/729096ad7bff64d646ace589a5876a38.gif)

Code Snippet
Plaintext
weapons_icons()
{
weapon_buys = getentarray("weapon_upgrade","targetname");
iprintln("function_started2");

for( i = 0; i < weapon_buys.size; i++ )
{
weapon_buys[i] thread weapon_icons_check();
}

}

weapon_icons_check()
{
players = Get_Players();
iprintln("function_started_22");
for(i = 0; i < players.size; i++)
{
while(1)
{
if(players[i] islookingatent(self) && (distance(players[i].origin, self.origin) < 80))
{
weapon = self.script_noteworthy;


players[i] iPrintLn("Looking at Trigger");
players[i] iPrintLn( weapon );

wait 0.05;
}
else
wait 0.05;
}
}
}

(*for anyone watching this thread wanting to use this script make sure to have trem's hintstring fix gsc included as it has a function that I used above (islookingatent)*)

Only issue I have is that if you're at the other side of the wall, if close enough it is possible to trigger this and display the print, but I can place my weapons and props in map accordingly to get around this, and also if you view at a certain angle it will trigger it also but not the hintstring, last one still need to work on.
Title: Re: Black Ops 2 Style Weapon Icon
Post by: MakeCents on February 23, 2016, 01:52:45 pm

Only issue I have is that if you're at the other side of the wall,

You can use bullettracepassed (http://wiki.modsrepository.com/index.php?title=Call_of_Duty_4:_Scripting_Reference_-_Trace::BulletTracePassed) to get around the seeing from the other side of a wall thing.


Edit: I thought you wanted to set the hud icon to the weapon. If that is what you wanted, then you can just add to trems menu stuff instead of doing all this. And either way, really, you can just edit trems hintstring thing to get the weapon info too. You don't need another looping script.
Title: Re: Black Ops 2 Style Weapon Icon
Post by: Scobalula on February 23, 2016, 02:16:16 pm
You can use bullettracepassed (http://wiki.modsrepository.com/index.php?title=Call_of_Duty_4:_Scripting_Reference_-_Trace::BulletTracePassed) to get around the seeing from the other side of a wall thing.


Edit: I thought you wanted to set the hud icon to the weapon. If that is what you wanted, then you can just add to trems menu stuff instead of doing all this. And either way, really, you can just edit trems hintstring thing to get the weapon info too. You don't need another looping script.

I tried using trem's hintstring fix but for some reason when I used it with the weapons gsc it doesn't show anything at the weapon.  I changed all instances of SetHintString in it to _SetHintString and made sure that localized hintstrings weren't being used.
Title: Re: Black Ops 2 Style Weapon Icon
Post by: MakeCents on February 23, 2016, 02:19:41 pm
I tried using trem's hintstring fix but for some reason when I used it with the weapons gsc it doesn't show anything at the weapon.  I changed all instances of SetHintString in it to _SetHintString and made sure that localized hintstrings weren't being used.

Not sure about that, I use my own, but I would figure it can be used on any trigger_use. Does he have you include a new gsc and did you include it? Is it possible that it is an error on your part, or it just doesn't work. Cause if it was working you could add a few lines to it to set the material to a client dvar, add an itemdef to menu, adjust positioning, and wala, done.
Title: Re: Black Ops 2 Style Weapon Icon
Post by: Scobalula on February 23, 2016, 02:36:54 pm
Not sure about that, I use my own, but I would figure it can be used on any trigger_use. Does he have you include a new gsc and did you include it? Is it possible that it is an error on your part, or it just doesn't work. Cause if it was working you could add a few lines to it to set the material to a client dvar, add an itemdef to menu, adjust positioning, and wala, done.

Tried with a test trigger_use, only shows the hint icon. Menu file and GSC are included in mod and at top of script.

(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fi.imgur.com%2Fljpa4HY.png&hash=835d4ae5fa2186c2104fdaf6006cc47f9ea1efa2)

Code Snippet
Plaintext
hint_test()
{

trigger = getent("test_trigger", "targetname");
trigger _setHintString("Test String");

}
Title: Re: Black Ops 2 Style Weapon Icon
Post by: MakeCents on February 23, 2016, 02:39:42 pm
Tried with a test trigger_use, only shows the hint icon. Menu file and GSC are included in mod and at top of script.

(http://i.imgur.com/ljpa4HY.png)

Code Snippet
Plaintext
hint_test()
{

trigger = getent("test_trigger", "targetname");
trigger _setHintString("Test String");

}

That just shows that nothing is happening with that trigger at all. I assume your only using one trigger with that kvp, so getent isn't the issue. Have you gotten it to work on anything else? I'll have to go find his stuff on the wiki and see. I'm pretty sure that he made it to work with any trigger_use though.

Edit: I just looked at his stuff (http://ugx-mods.com/wiki/index.php?title=Hintstrings_not_updating), and it should work. If you got others to work, then its not menu, but if not, then maybe it is
Title: Re: Black Ops 2 Style Weapon Icon
Post by: Scobalula on February 23, 2016, 02:42:41 pm
That just shows that nothing is happening with that trigger at all. I assume your only using one trigger with that kvp, so getent isn't the issue. Have you gotten it to work on anything else? I'll have to go find his stuff on the wiki and see. I'm pretty sure that he made it to work with any trigger_use though.

Oh I love this game, I rebuild mod and it works. :please:

EDIT: Still doesn't seem to work with the weapons gsc though..
Title: Re: Black Ops 2 Style Weapon Icon
Post by: MakeCents on February 23, 2016, 02:48:49 pm
Oh I love this game, I rebuild mod and it works. :please:

EDIT: Still doesn't seem to work with the weapons gsc though..

His tut specifically recommends it with the weapons gsc, so unless you have other modifications that would some how override this, I don't know, or maybe its positioning of the prefab?

You get that working, then it's pretty easy to add the icons from there.

Edit: But when I get home I will also check that first idea I said again and see if that is the easiest way.

Edit: The build twice issue is usually related to menu files. If you put your menu files in your mod folder. If you put them in raw folder then you don't have that issue.
Title: Re: Black Ops 2 Style Weapon Icon
Post by: Scobalula on February 23, 2016, 04:20:53 pm
His tut specifically recommends it with the weapons gsc, so unless you have other modifications that would some how override this, I don't know, or maybe its positioning of the prefab?

You get that working, then it's pretty easy to add the icons from there.

Edit: But when I get home I will also check that first idea I said again and see if that is the easiest way.

Edit: The build twice issue is usually related to menu files. If you put your menu files in your mod folder. If you put them in raw folder then you don't have that issue.

Just an update: I decided to place 2 other triggers, separate targetnames and hintstrings and added a print to trem's gsc to check what hintstrings are added, those 3 triggers got added and their string was printed, but I got nothing for weapons trigger, so I'm guessing the hintstring isn't being passed to trem's gsc.
Title: Re: Black Ops 2 Style Weapon Icon
Post by: MakeCents on February 23, 2016, 04:27:31 pm
Just an update: I decided to place 2 other triggers, separate targetnames and hintstrings and added a print to trem's gsc to check what hintstrings are added, those 3 triggers got added and their string was printed, but I got nothing for weapons trigger, so I'm guessing the hintstring isn't being passed to trem's gsc.

Show me what you added to weapons gsc, and where you put the iprintln in trems stuff.
Title: Re: Black Ops 2 Style Weapon Icon
Post by: Scobalula on February 23, 2016, 04:56:46 pm
Show me what you added to weapons gsc, and where you put the iprintln in trems stuff.

For weapons gsc I done as was said on the Wiki and replaced every entry (8 of them) of SetHintString with _SetHintString, so I would assume this is where hintstring is set for weapons:

Code Snippet
Plaintext
// For buying weapon upgrades in the environment
init_weapon_upgrade()
{
weapon_spawns = [];
weapon_spawns = GetEntArray( "weapon_upgrade", "targetname" );

for( i = 0; i < weapon_spawns.size; i++ )
{
hint_string = get_weapon_hint( weapon_spawns[i].zombie_weapon_upgrade );

weapon_spawns[i] _sethintstring( hint_string );
weapon_spawns[i] setCursorHint( "HINT_NOICON" );
weapon_spawns[i] UseTriggerRequireLookAt();

weapon_spawns[i] thread weapon_spawn_think();
model = getent( weapon_spawns[i].target, "targetname" );
model hide();
}
}

As for the iprintln in trem's gsc here:

Code Snippet
Plaintext
//|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
//|||| Name : trem_hintstrings.gsc
//|||| Info : Fixes hintstrings that don't update.
//|||| Site : [url=http://www.ugx-mods.com]www.ugx-mods.com[/url]
//|||| Author : [UGX] treminaor
//|||| Notes : v1.4
//|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

#include maps\_utility;

_setHintString(string) //#bestengine2014
{
self thread setHintString_fixed_thread(string); //so that i don't have to write "thread" before all of my trig calls.
iprintln(string); // <------------------ HERE
}

Here is my _zombiemode_weapons.gsc: (stock essentially with only edit being hintstring and edits to strings for weapons)

http://pastebin.com/LJXQZudW (http://pastebin.com/LJXQZudW)
Title: Re: Black Ops 2 Style Weapon Icon
Post by: MakeCents on February 23, 2016, 04:59:28 pm
What is this hint_string at this point? If it is one of those &"Press...." things this method doesn't work.

Code Snippet
Plaintext
weapon_spawns[i] _sethintstring( hint_string ); 


If you add hint_string = "testing this"; above, does it show the hintstring testing this? I'm assuming it is one of those &"hint strings" is why I suggested trying this.

Edit: I looked at the script and those _sethinstring(&"hints") won't work either. It won't parse those for some reason.
Title: Re: Black Ops 2 Style Weapon Icon
Post by: DidUknowiPwn on February 23, 2016, 05:01:19 pm
Just a small tidbit if you try drawing this through menu good luck getting it to stretch properly according to the size.

Not all weapons are in the same size so if you try setting it to 256x128 some weapons are actually like 64x32 so they'll get horribly pixelated and flattened.

You can notice the size in hudiconration in the weapon file.
Title: Re: Black Ops 2 Style Weapon Icon
Post by: MakeCents on February 23, 2016, 05:03:58 pm
Just a small tidbit if you try drawing this through menu good luck getting it to stretch properly according to the size.

Not all weapons are in the same size so if you try setting it to 256x128 some weapons are actually like 64x32 so they'll get horribly pixelated and flattened.

You can notice the size in hudiconration in the weapon file.

I thought of that, and wouldn't that be solved if you started with the same size template and resized the image within the template rather than sizing the image to the template. That way it would size the image to what you told it to no matter what because it would be resizing more than just the image you put in. Like if you put it in a box. The box would always be the same size, but you would make the image inside the box smaller or larger.
Title: Re: Black Ops 2 Style Weapon Icon
Post by: Scobalula on February 23, 2016, 05:22:38 pm
Just a small tidbit if you try drawing this through menu good luck getting it to stretch properly according to the size.

Not all weapons are in the same size so if you try setting it to 256x128 some weapons are actually like 64x32 so they'll get horribly pixelated and flattened.

You can notice the size in hudiconration in the weapon file.

I plan on using these from BO2 or making my own by rendering them in Maya or Blender.

(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fi.imgur.com%2Fy9TwRfU.png&hash=60ebbc36a545753430830ee4680a24e6eba39073)

What is this hint_string at this point? If it is one of those &"Press...." things this method doesn't work.

Code Snippet
Plaintext
weapon_spawns[i] _sethintstring( hint_string ); 


If you add hint_string = "testing this"; above, does it show the hintstring testing this? I'm assuming it is one of those &"hint strings" is why I suggested trying this.

Edit: I looked at the script and those _sethinstring(&"hints") won't work either. It won't parse those for some reason.

I tried this and it didn't work work, no string was printed on screen for it or on the weapon buy, I also tried removing the & from every entry of of sethintstring (including all the weapons) and it still doesn't show, however after it does display the ammo string (I'll edit the ZOMBIE_WEAPONCOSTAMMO later) but not the ammo, etc.

(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FU16FiRt.png&hash=a8bc2e9a9ee401fd5c9e8e643f549d4e43baccdf)
Title: Re: Black Ops 2 Style Weapon Icon
Post by: MakeCents on February 23, 2016, 05:39:05 pm
A couple things.
You can't just remove the &
Some of these have additional vars, cost, ammo_cost, that all needs edited
For it not to print anything or show anything would make me think that for loop isn't running except if it shows the ammo then it is, so it's a bit confusing


Code Snippet
Plaintext

init_weapon_upgrade()
{
    weapon_spawns = [];
    weapon_spawns = GetEntArray( "weapon_upgrade", "targetname" );
 
    for( i = 0; i < weapon_spawns.size; i++ )
    {
        hint_string = get_weapon_hint( weapon_spawns[i].zombie_weapon_upgrade );
        hint_string = "testing weapon strings";
        weapon_spawns[i] _sethintstring( hint_string );
        weapon_spawns[i] setCursorHint( "HINT_NOICON" );
        //weapon_spawns[i] UseTriggerRequireLookAt();
 
        weapon_spawns[i] thread weapon_spawn_think();
        model = getent( weapon_spawns[i].target, "targetname" );
        model hide();
    }
}

That ^ should be what you have in your weapons now.
And this is where you should put the iprints:

Code Snippet
Plaintext

//|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
//|||| Name : trem_hintstrings.gsc
//|||| Info : Fixes hintstrings that don't update.
//|||| Site : [url=http://www.ugx-mods.com]www.ugx-mods.com[/url]
//|||| Author : [UGX] treminaor
//|||| Notes : v1.3
//|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
#include maps\_utility;
 
_setHintString(string) //#bestengine2014
{
self thread setHintString_fixed_thread(string); //so that i don't have to write "thread" before all of my trig calls.
}
setHintString_fixed_thread(string)
{
self notify("new_thread");
self endon("new_thread");
        flag_wait("all_players_connected");//Added so you see the printlin
        wait(2);//Added more so you see the print line
        iprintln("Hint string defined? ", isdefined(string));//added to see if the string is defined
if(!isDefined(string)) return;
tokens = strTok(string, " ");
end = false;
leftstring = "";
rightstring = "";
for(i=0;i<tokens.size;i++)
{
if(tokens[i] == "&&1" || tokens[i] == "F" || tokens[i] == "[{+activate}]" || tokens[i] == "[Use]") //use key will be added by the menufile
{
tokens[i] = "";
end = true;
}
if(end) rightstring = rightstring + tokens[i] + " ";
else leftstring = leftstring + tokens[i] + " ";
}
players = getPlayers();
while(isDefined(self))
{
for(k=0;k<players.size;k++)
if(players[k] islookingatent(self) && (distance(players[k].origin, self.origin) < 75) || players[k] isTouching(self))
{
iprintln("show me the hint string");//added to print when triggered
players[k].leftstring = leftstring;
players[k].rightstring = rightstring;
players[k] thread setHintString_show(self, leftstring, rightstring);
}
wait 0.1;
}
}

If any say 0 then there is an issue without the string being passed. If nothing prints, unless I made a mistake, then its not getting thread at all.
Title: Re: Black Ops 2 Style Weapon Icon
Post by: Scobalula on February 23, 2016, 06:57:48 pm
A couple things.
You can't just remove the &
Some of these have additional vars, cost, ammo_cost, that all needs edited
For it not to print anything or show anything would make me think that for loop isn't running except if it shows the ammo then it is, so it's a bit confusing


Code Snippet
Plaintext

init_weapon_upgrade()
{
    weapon_spawns = [];
    weapon_spawns = GetEntArray( "weapon_upgrade", "targetname" );
 
    for( i = 0; i < weapon_spawns.size; i++ )
    {
        hint_string = get_weapon_hint( weapon_spawns[i].zombie_weapon_upgrade );
        hint_string = "testing weapon strings";
        weapon_spawns[i] _sethintstring( hint_string );
        weapon_spawns[i] setCursorHint( "HINT_NOICON" );
        //weapon_spawns[i] UseTriggerRequireLookAt();
 
        weapon_spawns[i] thread weapon_spawn_think();
        model = getent( weapon_spawns[i].target, "targetname" );
        model hide();
    }
}

That ^ should be what you have in your weapons now.
And this is where you should put the iprints:

Code Snippet
Plaintext

//|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
//|||| Name : trem_hintstrings.gsc
//|||| Info : Fixes hintstrings that don't update.
//|||| Site : [url=http://www.ugx-mods.com]www.ugx-mods.com[/url]
//|||| Author : [UGX] treminaor
//|||| Notes : v1.3
//|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
#include maps\_utility;
 
_setHintString(string) //#bestengine2014
{
self thread setHintString_fixed_thread(string); //so that i don't have to write "thread" before all of my trig calls.
}
setHintString_fixed_thread(string)
{
self notify("new_thread");
self endon("new_thread");
        flag_wait("all_players_connected");//Added so you see the printlin
        wait(2);//Added more so you see the print line
        iprintln("Hint string defined? ", isdefined(string));//added to see if the string is defined
if(!isDefined(string)) return;
tokens = strTok(string, " ");
end = false;
leftstring = "";
rightstring = "";
for(i=0;i<tokens.size;i++)
{
if(tokens[i] == "&&1" || tokens[i] == "F" || tokens[i] == "[{+activate}]" || tokens[i] == "[Use]") //use key will be added by the menufile
{
tokens[i] = "";
end = true;
}
if(end) rightstring = rightstring + tokens[i] + " ";
else leftstring = leftstring + tokens[i] + " ";
}
players = getPlayers();
while(isDefined(self))
{
for(k=0;k<players.size;k++)
if(players[k] islookingatent(self) && (distance(players[k].origin, self.origin) < 75) || players[k] isTouching(self))
{
iprintln("show me the hint string");//added to print when triggered
players[k].leftstring = leftstring;
players[k].rightstring = rightstring;
players[k] thread setHintString_show(self, leftstring, rightstring);
}
wait 0.1;
}
}

If any say 0 then there is an issue without the string being passed. If nothing prints, unless I made a mistake, then its not getting thread at all.

I call hacks.

(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fi.imgur.com%2Fzm7KNvo.jpg&hash=26948acb3f405b6d35cff9dd8bf64833f0efc201)

Seriously though thank you, I really appreciate the help, without it I wouldn't have been able to use trem's hintstring fix and in turn, have easier implementation of the icon. Also was able to set up the hintstrings for ammo, etc. correctly.

I can go from here now in adding the icons, etc. in menu and using dvars to do it, I've marked your original reply as best answer as I feel it better answers the main question.
Title: Re: Black Ops 2 Style Weapon Icon
Post by: Harry Bo21 on February 26, 2016, 10:56:57 pm
I've been meaning to get around to this but I have been too busy troubleshooting ORBiT. I think it can be done in menu using an existing dvar, like the flamethrower uses. I've added icons to hints for perks, several of them, and started to try my one hud that requires the gun image, and it seemed to work but I didn't have images so it was the default texture for most, then I got distracted. I would look in the weaponinfo menuDef in the hud.menu for something commented out that relates to the weapon icon or something if I remember correctly. Then use that dvar. It might be set when your holding the weapon?


If I'm wrong about that, then it simply becomes a matter of you setting your own dvar, based on the weapon file name. You could simply make your material match the weapon file name with _icon or something on the end. Use gsc to get the current wall weapon with _icon at end and set the client dvar to that, for the itemdef you added to menu. Of course you would need to be using  menu hinstring method for your wall weapons for this to work easily.
what was the "existing dvar"? Ive been trying to find this for ages
Title: Re: Black Ops 2 Style Weapon Icon
Post by: Scobalula on February 26, 2016, 11:39:50 pm
Just thought I'd update and say I got it working properly:

(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fi.imgur.com%2F8N8elRd.jpg&hash=c3932a225793af38db0e24edaa30c709a80ade35)

As Make said it's only a one line thing really if you're using trem's hintstring fix, where all the dvars are set I just set another one with the value being trig.script_noteworthy and _icon added at the end. :D
Title: Re: Black Ops 2 Style Weapon Icon
Post by: MakeCents on February 27, 2016, 01:52:38 am
what was the "existing dvar"? Ive been trying to find this for ages

You can use this in menu

Code Snippet
Plaintext
ownerdraw		CG_PLAYER_WEAPON_PRIMARY_ICON

And set the ammoCounterIcon in weapon file

Did a quick test replacing my icons for my perks and it seems to work for current gun. But you wanted it for the gun to pic up, so that may not work.
(https://i.gyazo.com/67e91b1ea96621b93d4bc1ca249b3f62.png)

But setting a dvar like he decided to do would do same thing, but for that weapon, it seems the format is hud_icon_weaponname


Just thought I'd update and say I got it working properly:

(http://i.imgur.com/8N8elRd.jpg)

As Make said it's only a one line thing really if you're using trem's hintstring fix, where all the dvars are set I just set another one with the value being trig.script_noteworthy and _icon added at the end. :D

Looks good btw!