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

Black Ops 2 Style Weapon Icon

HOT
broken avatar :(
Created 8 years ago
by Scobalula
0 Members and 1 Guest are viewing this topic.
10,625 views
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 7 months 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.
Community 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
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.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
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.
Last Edit: February 23, 2016, 05:06:01 pm by MakeCents
broken avatar :(
×
broken avatar :(
OnionmanVere Bo21
Location: ieu dnt wnt 2 no
Date Registered: 27 September 2013
Last active: 1 year ago
Posts
1,864
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Mapper
My Groups
More
Personal Quote
ok
Signature
Aye mate you don't know me so y don't you shut tf up ok buddy :)

×
Scobalula's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Scobalula's Contact & Social Links
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.



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.

broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
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.
Last Edit: February 23, 2016, 05:42:10 pm by MakeCents
broken avatar :(
×
broken avatar :(
OnionmanVere Bo21
Location: ieu dnt wnt 2 no
Date Registered: 27 September 2013
Last active: 1 year ago
Posts
1,864
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Mapper
My Groups
More
Personal Quote
ok
×
Scobalula's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Scobalula's Contact & Social Links
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.



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.
Last Edit: February 23, 2016, 06:59:06 pm by Scobalula
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community 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.
Community 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 Links[email protected]HarryBo21HarryBo000
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
broken avatar :(
×
broken avatar :(
OnionmanVere Bo21
Location: ieu dnt wnt 2 no
Date Registered: 27 September 2013
Last active: 1 year ago
Posts
1,864
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Mapper
My Groups
More
Personal Quote
ok
×
Scobalula's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Scobalula's Contact & Social Links
Just thought I'd update and say I got it working properly:



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
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
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.


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:

(Image removed from quote.)

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!
Last Edit: February 27, 2016, 02:06:45 am by MakeCents

 
Loading ...