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

Pictures for Ammo count?

HOT
broken avatar :(
Created 11 years ago
by brandontr3
0 Members and 1 Guest are viewing this topic.
7,234 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 9 September 2014
Last active: 5 years ago
Posts
230
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
brandontr3's Groups
brandontr3's Contact & Social Links
I am new to scripting and all I have really done so far was be able to find the values for certain HUD elements and to change them xD. Currently I want my ammo count to be rotated but I looked around to find that you can't do that so I want to use pictures for my ammo, so I could rotate the numbers in the pictures. How would I go to implement these pictures into the ammo count area,like how would I script that in? Also what would I have to name these pictures?  ???
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods 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
I am new to scripting and all I have really done so far was be able to find the values for certain HUD elements and to change them xD. Currently I want my ammo count to be rotated but I looked around to find that you can't do that so I want to use pictures for my ammo, so I could rotate the numbers in the pictures. How would I go to implement these pictures into the ammo count area,like how would I script that in? Also what would I have to name these pictures?  ???

You would use menu itemdefs, or a macro, and set images/material based on dvars set in gsc.

Something like:
! No longer available

In your case you would make a gsc script that incremented the dvar name, to correlate with your material, in a for loop, continuously to give it that rotating affect.
Last Edit: November 12, 2015, 04:10:20 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 9 September 2014
Last active: 5 years ago
Posts
230
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
brandontr3's Groups
brandontr3's Contact & Social Links
1. That looks amazing btw
2. I figured it be in itemdefs, but you be able to help me with what i would have to put in the script?

Double Post Merge: November 12, 2015, 04:15:11 pm
Edit: I used this to edit my ammo color and what not. The image would go in here because ammo right?
Code Snippet
Plaintext
itemDef
{
name "ammo"
type ITEM_TYPE_TEXT
rect 0 (WEAPINFO_Y + 20) 35 40
exp rect X( WEAPON_AMMO_X )
textscale TEXTSIZE_BIG
textfont UI_FONT_OBJECTIVE
textalign ITEM_ALIGN_RIGHT
forecolor 1 1 0 1
exp text (dvarString("hud_player_ammo_weapon"))
visible 1
decoration
}
Last Edit: November 12, 2015, 04:15:11 pm by brandontr3
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods 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
1. That looks amazing btw
2. I figured it be in itemdefs, but you be able to help me with what i would have to put in the script?

Dukip has a script that I used to set up the basic layout, i forget what it is called. I just updated it to setclientdvars. Its in all of his custom huds. You will have to get the ammo count and then break it down into digits for each position. Easily done by division, and then set the client dvar then to that material. You can name your images/materials with numbers and concatenate. Say, number_0, and number_3 for example. This will make it easier. Make sure to compensate for 0's to the left, and set the dvar to something that the item doesn't show when the dvar is that.

Edit: These will be images 0-9, and each position will need handled, not one image for the entire hud
And thanks.
Last Edit: November 12, 2015, 04:20:11 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 9 September 2014
Last active: 5 years ago
Posts
230
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
brandontr3's Groups
brandontr3's Contact & Social Links
Alright so kinda like these frag icons how they are frag 1,frag2, and so on?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods 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
Alright so kinda like these frag icons how they are frag 1,frag2, and so on?

I think so. If I understand you correctly.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 9 September 2014
Last active: 5 years ago
Posts
230
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
brandontr3's Groups
brandontr3's Contact & Social Links
Edit: Im using the frag icon dvar as an example ,So i would change this:
Code Snippet
Plaintext
itemDef
{
name "ammo"
type ITEM_TYPE_TEXT
rect 0 (WEAPINFO_Y + 20) 35 40
exp rect X( WEAPON_AMMO_X )
textscale TEXTSIZE_BIG
textfont UI_FONT_OBJECTIVE
textalign ITEM_ALIGN_RIGHT
forecolor 1 1 0 1
exp text (dvarString("hud_player_ammo_weapon"))
visible 1
decoration
}

to this?:

Code Snippet
Plaintext
itemDef
{
name "ammo"
type ITEM_TYPE_OVERDRAW
rect 0 (WEAPINFO_Y + 20) 35 40
exp rect X( WEAPON_AMMO_X )
forecolor 1 1 0 1
background "number_0" // default texture
visible 1
decoration
}

Double Post Merge: November 12, 2015, 04:36:21 pm
I notice di forgot the ownerdraw line :/
Last Edit: November 12, 2015, 04:36:21 pm by brandontr3
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods 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
Not quite. You want to get the dvar which value could be "number_0" or something like that and set the exp material.

Code Snippet
Plaintext
itemDef
{
name "ammmocounter1"
rect (WEAPINFO_X +50) (WEAPINFO_Y -184) 40 40
forecolor 1 1 1 1
ownerdraw CG_PLAYER_WEAPON_BACKGROUND
exp material (dvarstring(position1));
visible when ( dvarstring(position1) != "number_");
decoration
}
I have a macro that handles this now, but it is easier to explain by breaking it down into itemdefs.

This is a piece of my menu itemdef above. What it does is have a itemdef for each position. Like 100 in the clip is 3 positions, so you would first seperate 100 into 1, 0, and 0, for dvars position1, position2, and postiion3. You would set clientdvars for each position in gsc. Then have a itemdef for each like above in menu.

Edit: for testing, if you want to just try to set an image, you can do it with a string instead of a dvar. Then once you get that working, move on to a dvar. Up to you. And this is a bit advanced, so you may want to do more other scripting before attempting to get this to work. It will come easier later.
Last Edit: November 12, 2015, 04:40:09 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 9 September 2014
Last active: 5 years ago
Posts
230
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
brandontr3's Groups
brandontr3's Contact & Social Links
I understand what you are saying but this is now seeming more complicated as at first i just thought set each number to a position then it wouldnt change if you shot or reloaded. In that itemdef script, visible   when ( dvarstring(position1) != "number_"); takes all of the number_0-9 and does the magic of subtracting bullets when gun is shot and reloading and such?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods 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
I understand what you are saying but this is now seeming more complicated as at first i just thought set each number to a position then it wouldnt change if you shot or reloaded. In that itemdef script, visible   when ( dvarstring(position1) != "number_"); takes all of the number_0-9 and does the magic of subtracting bullets when gun is shot and reloading and such?

Well, it isn't super easy. To break it down as simple as I can:

In gsc
 - You use Dukips script to start.
 - Create and initialize a clientdvar for each position, setclientdvar per player. (If you have 3 positions in clip, make three dvars, and 4 in stock, then 7 total.)
 - After getting the clip and stock ammo, separate the positions and get each integer.
 - Then set each clientdvar you created to the image name you want to represent that integer, for example, "number_9"


In menu
 - It will get the dvar and set the image with an item def for each dvar




In mine, "number_" is set when it is a 0 to the left, set in gsc by checking the total number to the position. I chose that for concatenation purposes, it can be "" if you want, or whatever.
Last Edit: November 12, 2015, 04:59:48 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 9 September 2014
Last active: 5 years ago
Posts
230
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
brandontr3's Groups
brandontr3's Contact & Social Links
Alright :), i see what you mean now, the picture helped alot too xD. Where would dukips script be btw?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods 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
Alright :), i see what you mean now, the picture helped alot too xD. Where would dukips script be btw?

In one of his hud dls. In the dl section...
Here is one that I think has it.
http://ugx-mods.com/forum/index.php/topic,5502.0.html
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 9 September 2014
Last active: 5 years ago
Posts
230
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
brandontr3's Groups
brandontr3's Contact & Social Links
Ohhh i thought you meant like he gave it as a self download lol

Double Post Merge: November 12, 2015, 05:08:42 pm
Edit: _dukip_hud.gsc right?
Last Edit: November 12, 2015, 05:08:42 pm by brandontr3
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods 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
Ohhh i thought you meant like he gave it as a self download lol

Double Post Merge: November 12, 2015, 05:08:42 pm
Edit: _dukip_hud.gsc right?

I used and modified the update_weapon_hud() function. I originally used the T6 stuff though, not the link I sent you the first time.
Found here:
http://ugx-mods.com/forum/index.php/topic,7068.0.html
Last Edit: November 12, 2015, 05:36:01 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 9 September 2014
Last active: 5 years ago
Posts
230
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
brandontr3's Groups
brandontr3's Contact & Social Links
Thats actually what im customizing right now :). The t6 one is the one i changed all the perk icons and positions and ammo and stuff to. Thats the one im trying to get this to work on lol

Double Post Merge: November 12, 2015, 05:59:38 pm
Wait so there are 9 materials (number_0-9), there is going to be seven positions called which requires only 7 itemdefs. How would the nine images ibeing called in the visible when line fit only seven itemdefs? (i might miss some stuff here and there and i might be wrong but this is causing me to learn from it :) )
Last Edit: November 12, 2015, 05:59:38 pm by brandontr3

 
Loading ...