Ammo Indicator

Making or wanting help making your own asset? Check in here
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: Ammo Indicator

Post by Mats391 »

[R-DEV]Moszeusz6Pl wrote:Color is controlled by BF2 engine. You could have it controlled by some if statement, which is what I'm going to look into after 1.0.
I tried using PrimaryAmmoRed -Green -Blue but that turns red already when ammo is under 30%, which is too early imo.

Also i wasnt happy with the last indicator. I dont like that it covers 25-1 bullets left with 1 state, i think it should be more accurate towards the end as its easier to count bullets then.
So i made it like this:
Image
Image

Mineral: TIL that Wire-guided missiles actually use wire
AfterDune
Retired PR Developer
Posts: 17094
Joined: 2007-02-08 07:19

Re: Ammo Indicator

Post by AfterDune »

If this is for HMG, it's fine. But if you have less bullets, it gets too accurate.
Image
40mmrain
Posts: 1271
Joined: 2011-08-17 05:23

Re: Ammo Indicator

Post by 40mmrain »

I like red orchestra 2's little ability to pop off your mag and see what's left in it, then reattaching it.

IS it possible to have some kind of key binding that lets you make this appear in your hud just for a moment? As to simulate checking your map.
Moszeusz6Pl
Retired PR Developer
Posts: 939
Joined: 2010-06-24 13:41

Re: Ammo Indicator

Post by Moszeusz6Pl »

Yes it is :D

Image
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: Ammo Indicator

Post by Mats391 »

[R-DEV]AfterDune wrote:If this is for HMG, it's fine. But if you have less bullets, it gets too accurate.
Imo its fine, remember i meant this for open magazines/belts where you can see the bullets. For enclosed mags it should be way less accurate, if its realistic at all.

This is how latest looks with 30round mag (e.g. g36 with transperant mag) and 75round (Mg3)
Image
Image
Image

Mineral: TIL that Wire-guided missiles actually use wire
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: Ammo Indicator

Post by Mats391 »

I tried to make the indicator only show up when changing weapons or pressing a certain button, but had no luck with both. So instead my solutions were either when you press capslock or when you reload. The reloading makes it look abit like checking ammo and since you will (maybe)cancle the reload you will switch weapons anyway :D

Code: Select all

hudBuilder.createSplitNode		IngameHud AmmoIndicatorHud
hudBuilder.setNodeShowVariable		PrimaryAmmoShow
hudBuilder.setNodeLogicShowVariable 	EQUAL GuiIndex 61
rem hudBuilder.setNodeLogicShowVariable    AND MapFullSizeAndSpawnShow 1
hudBuilder.setNodeLogicShowVariable    AND PrimaryReloadTimeShow 1
hudBuilder.setNodeInTime		0
hudBuilder.setNodeOutTime		1.5

rem Frame
hudBuilder.createPictureNode			AmmoIndicatorHud AmmoIndicatorFrame 760 580 16 32
hudBuilder.setPictureNodeTexture 		Ingame\Weapons\Icons\Hud\AmmoIndicator\AmmoIndicatorFrame.dds
hudBuilder.setNodeColor			0.82353 0.82353 0.70196 1

rem Main Bar rough Indicator
hudBuilder.createBarNode 			AmmoIndicatorHud AmmoIndicatorBar1 0 761 581 8 16
hudbuilder.setBarNodeTexture		1 Ingame\Weapons\Icons\Hud\AmmoIndicator\AmmoIndicatorBar1.dds
hudBuilder.setBarNodeTexture 		0 Ingame/GeneralIcons/empty.tga
hudBuilder.setBarNodeSnap			6	
hudBuilder.setBarNodeValueVariable 	PrimaryAmmo
hudBuilder.setNodeColor			0.82353 0.82353 0.70196 1

rem Sub Bar for more precision at end
hudBuilder.createBarNode 			AmmoIndicatorHud AmmoIndicatorBar2 0 761 581 8 16
hudbuilder.setBarNodeTexture		1 Ingame\Weapons\Icons\Hud\AmmoIndicator\AmmoIndicatorBar2.dds
hudBuilder.setBarNodeTexture 		0 Ingame/GeneralIcons/empty.tga
hudBuilder.setBarNodeSnap			2	
hudBuilder.setBarNodeValueVariable 	PrimaryAmmo
hudBuilder.setNodeColor			0.82353 0.82353 0.70196 1
Image

Mineral: TIL that Wire-guided missiles actually use wire
Heavy Death
Posts: 1303
Joined: 2012-10-21 10:51

Re: Ammo Indicator

Post by Heavy Death »

Bluedrake42 wrote:for things like AR, this would be awesome.
HOWEVER. It would also be cool if this ONLY showed when you re-equip your weapon
That way you can check how much ammo is left, but you have to go through the deploy/arm animation first
This would kindof simulate taking out a mag and checking the ammo/weight
Great addition. Make it fade away after a second or two from selecting. if you want to re-chehk, re select the weapon.
Moszeusz6Pl
Retired PR Developer
Posts: 939
Joined: 2010-06-24 13:41

Re: Ammo Indicator

Post by Moszeusz6Pl »

Don't worry about showing this bar only when button is pressed. We already have something planned for this.

Image
ghostfool84
Posts: 503
Joined: 2009-10-17 11:38

Re: Ammo Indicator

Post by ghostfool84 »

Looks like a nice idea and i like the icons. May it be used in Assault Rifles with transparent mag like the G36 too?

edit: Note to myself: First read the whole thread, then answer 8[
Frontliner
PR:BF2 Contributor
Posts: 1884
Joined: 2012-10-29 09:33

Re: Ammo Indicator

Post by Frontliner »

Mats391 wrote:Imo its fine, remember i meant this for open magazines/belts where you can see the bullets. For enclosed mags it should be way less accurate, if its realistic at all.

This is how latest looks with 30round mag (e.g. g36 with transperant mag) and 75round (Mg3)
Image
Image
I don't like the way the 2nd ammo box shows over half full and goes down to 8/30 and 19/75, it can really throw you off when it's such a mismatch between indication and actual ammo. What instead I would propose is going
30-26 75-61
25-16 60-38
15-6 37-16 (just a quick note in regards to the G36 mag, the rounds start being covered by the magazine socket once you have less than 6, so right there it's not really a made up number).
5-1 15-1

But you can't really control what the displayed numbers are, can you?
VTRaptor: but i only stopped for less than 10 secs and that fucking awesome dude put 2 of them

]CIA[ SwampFox: well my definition of glitching is using an enemy kit to kill the enemy

Just_Dave: i have a list about PR players, and they r categorized by their skill

Para: You sir are an arse and not what the game or our community needs.

AlonTavor: Is that a German trying to make me concentrate?

Heavy Death: join PRTA instead - Teamwork is a must there.
Moszeusz6Pl
Retired PR Developer
Posts: 939
Joined: 2010-06-24 13:41

Re: Ammo Indicator

Post by Moszeusz6Pl »

We only thing we can control is size of one step, we can't make one step smaller and other bigger.

Image
Frontliner
PR:BF2 Contributor
Posts: 1884
Joined: 2012-10-29 09:33

Re: Ammo Indicator

Post by Frontliner »

I guess that means number of rounds/4 then. I was primarily concerned about the indicator for over half full, but I guess that'll do.
VTRaptor: but i only stopped for less than 10 secs and that fucking awesome dude put 2 of them

]CIA[ SwampFox: well my definition of glitching is using an enemy kit to kill the enemy

Just_Dave: i have a list about PR players, and they r categorized by their skill

Para: You sir are an arse and not what the game or our community needs.

AlonTavor: Is that a German trying to make me concentrate?

Heavy Death: join PRTA instead - Teamwork is a must there.
Roque_THE_GAMER
Posts: 520
Joined: 2012-12-10 18:10

Re: Ammo Indicator

Post by Roque_THE_GAMER »

would be more interesting if you press some button and had an animation of you checking the ammunition.
Moszeusz6Pl
Retired PR Developer
Posts: 939
Joined: 2010-06-24 13:41

Re: Ammo Indicator

Post by Moszeusz6Pl »

Animation of checking ammunition is hardcoded.

Image
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: Ammo Indicator

Post by Mats391 »

Bump
Since i was never satisfied with the previous dial of this i went back and did another one.
Image
The numbers shown are the percentages.
In this i tried to get around the step limit the bar node forces onto you. To achieve this i created multiple bar nodes that overlap. In total this uses 6 textures with total size 4kB and 5 bar nodes.
Code:

Code: Select all

hudBuilder.createSplitNode		IngameHud AmmoIndicatorHud
hudBuilder.setNodeShowVariable		PrimaryAmmoShow

rem Frame
hudBuilder.createPictureNode			AmmoIndicatorHud AmmoIndicatorFrame 760 580 10 18
hudBuilder.setPictureNodeTexture 		Ingame\Weapons\Icons\Hud\AmmoIndicator\AmmoIndicatorFrame.dds
hudBuilder.setNodeColor			0.82353 0.82353 0.70196 1

rem Indicator 1 100-87.5 part1 and 12.5-6.25 part1
hudBuilder.createBarNode 			AmmoIndicatorHud AmmoIndicatorBar1_1 0 761 581 8 16
hudbuilder.setBarNodeTexture		1 Ingame\Weapons\Icons\Hud\AmmoIndicator\AmmoIndicatorBar1_1.dds
hudBuilder.setBarNodeTexture 		0 Ingame/GeneralIcons/empty.tga
hudBuilder.setBarNodeSnap			1	
hudBuilder.setBarNodeValueVariable 	PrimaryAmmo
rem hudBuilder.setNodeColor			0.82353 0.82353 0.70196 1

rem Indicator 1 100-87.5 part2 and 12.5-6.25 part2
hudBuilder.createBarNode 			AmmoIndicatorHud AmmoIndicatorBar1_2 0 761 582 8 16
hudbuilder.setBarNodeTexture		1 Ingame\Weapons\Icons\Hud\AmmoIndicator\AmmoIndicatorBar1_2.dds
hudBuilder.setBarNodeTexture 		0 Ingame/GeneralIcons/empty.tga
hudBuilder.setBarNodeSnap			1	
hudBuilder.setBarNodeValueVariable 	PrimaryAmmo
rem hudBuilder.setNodeColor			0.82353 0.82353 0.70196 1

rem Indicator 1 100-87.5 part3
hudBuilder.createBarNode 			AmmoIndicatorHud AmmoIndicatorBar1_3 0 761 583 8 16
hudbuilder.setBarNodeTexture		1 Ingame\Weapons\Icons\Hud\AmmoIndicator\AmmoIndicatorBar1_3.dds
hudBuilder.setBarNodeTexture 		0 Ingame/GeneralIcons/empty.tga
hudBuilder.setBarNodeSnap			1	
hudBuilder.setBarNodeValueVariable 	PrimaryAmmo
hudBuilder.setNodeColor			0.82353 0.82353 0.70196 1

rem Indicator 2 87.5-62.5
hudBuilder.createBarNode 			AmmoIndicatorHud AmmoIndicatorBar2 0 761 583 8 16
hudbuilder.setBarNodeTexture		1 Ingame\Weapons\Icons\Hud\AmmoIndicator\AmmoIndicatorBar2.dds
hudBuilder.setBarNodeTexture 		0 Ingame/GeneralIcons/empty.tga
hudBuilder.setBarNodeSnap			6	
hudBuilder.setBarNodeValueVariable 	PrimaryAmmo
hudBuilder.setNodeColor			0.82353 0.82353 0.70196 1

rem Indicator 3 62.5-37.5
hudBuilder.createBarNode 			AmmoIndicatorHud AmmoIndicatorBar3 0 761 583 8 16
hudbuilder.setBarNodeTexture		1 Ingame\Weapons\Icons\Hud\AmmoIndicator\AmmoIndicatorBar3.dds
hudBuilder.setBarNodeTexture 		0 Ingame/GeneralIcons/empty.tga
hudBuilder.setBarNodeSnap			10	
hudBuilder.setBarNodeValueVariable 	PrimaryAmmo
hudBuilder.setNodeColor			0.82353 0.82353 0.70196 1

rem Indicator 4 37.5-12.5
hudBuilder.createBarNode 			AmmoIndicatorHud AmmoIndicatorBar4 0 761 583 8 16
hudbuilder.setBarNodeTexture		1 Ingame\Weapons\Icons\Hud\AmmoIndicator\AmmoIndicatorBar4.dds
hudBuilder.setBarNodeTexture 		0 Ingame/GeneralIcons/empty.tga
hudBuilder.setBarNodeSnap			14	
hudBuilder.setBarNodeValueVariable 	PrimaryAmmo
hudBuilder.setNodeColor			0.82353 0.82353 0.70196 1
Image

Mineral: TIL that Wire-guided missiles actually use wire
AfterDune
Retired PR Developer
Posts: 17094
Joined: 2007-02-08 07:19

Re: Ammo Indicator

Post by AfterDune »

I like it :) .

But is it my monitor, or is it quite hard to distinguish the two colors of the mag?
And what does it look like if the last image is an empty mag, with just a red border?
Image
UTurista
PR:BF2 Developer
Posts: 985
Joined: 2011-06-14 14:13

Re: Ammo Indicator

Post by UTurista »

Mats391 wrote:Bump
Since i was never satisfied with the previous dial of this i went back and did another one.
Image
The numbers shown are the percentages.
Nice but I would say 3 levels would be enough,
  • Mag "Feels Heavy" -[100 - 80]
  • Mag used -[79 - 21]
  • Mag "Feels light" -[20 - 0]
Image


Dont question the wikipedia! Just because it reports different things on different languages does not make it unreliable source!
Rabbit
Posts: 7818
Joined: 2006-12-17 15:14

Re: Ammo Indicator

Post by Rabbit »

Hmmm, I have to say I think its a bit to much color wise. As an idea, point of reference, the US mil uses a verbal color system for status and amounts when in combat, which might be something to take into account.

Green- full functioning, total amount still held
Yellow- About 60%-40% functioning, 60%-40% still held
Red- Less and 40%-1% functioning, Less and 40%-1% held
Black- Inoperable, Nothing still held.
Image

AfSoccer "I just don't see the natural talent."
Image
Rudd
Retired PR Developer
Posts: 21225
Joined: 2007-08-15 14:32

Re: Ammo Indicator

Post by Rudd »

O_turista_portugues wrote:Nice but I would say 3 levels would be enough,
  • Mag "Feels Heavy" -[100 - 80]
  • Mag used -[79 - 21]
  • Mag "Feels light" -[20 - 0]
I'd go with this, also addresses the colour issue since Used and Light would be red, and feels heavy wouldn't even need a colour

good work Mats, well done :)
Image
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: Ammo Indicator

Post by Mats391 »

[quote=""'[R-DEV"]AfterDune;1969753']I like it :) .

But is it my monitor, or is it quite hard to distinguish the two colors of the mag?
And what does it look like if the last image is an empty mag, with just a red border?[/quote]

There is only one colour for the mag, the second one is the forum background as the mag gets more transperant. Here it is with screens taken from ingame + red frame for empty mag:
Image

[quote="O_turista_portugues""]Nice but I would say 3 levels would be enough,
  • Mag "Feels Heavy" -[100 - 80]
  • Mag used -[79 - 21]
  • Mag "Feels light" -[20 - 0]
[/quote]
I created this one with open magazines/belts/boxes in mind and i think with those you get a bit more accuracy. I will make one with less levels.
Image

Mineral: TIL that Wire-guided missiles actually use wire
Post Reply

Return to “PR:BF2 Community Modding”