Attack Chopper Gunnerbar

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

Attack Chopper Gunnerbar

Post by Mats391 »

After reading this suggetion, i wanted to give it a try.
i got it to work just like suggested
Image
Image

Code: Select all

rem -------------------------------------- GunnerBar --------------------------------------

hudBuilder.createPictureNode			ApacheCoPilotHud ApacheBargunner 349 486 128 64
hudBuilder.setPictureNodeTexture 		Ingame\Vehicles\Icons\Hud\Air\Attack\Ah64a\ah64_gunbar.dds
hudBuilder.setNodeColor		 		0 1 0 1

hudBuilder.createCompassNode 			ApacheCoPilotHud ApacheBargunnerView 3 365 499 72 16 1 0
hudBuilder.setCompassNodeTexture 		1 Ingame\Vehicles\Icons\Hud\Air\Attack\Ah1z\Ah1z_gunnerwiew.tga
hudBuilder.setCompassNodeTextureSize		128 16
hudBuilder.setCompassNodeBorder			0 0 0 234
hudBuilder.setCompassNodeValueVariable  	VehicleTurretAngle
hudBuilder.setCompassNodeOffset			-31
hudBuilder.setNodeColor		 		0 1 0 1
but it does only work with the cannon, when switching to hellfire the bar doesnt update and freezes in the middle (default position). I guess this is because the hellfire weapon does not actually move.

i also wanted to add a bar to show the turret elevation. does anyone know if there is a variable for that? VehicleTurretElevation does not exist :(
Image

Mineral: TIL that Wire-guided missiles actually use wire
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: Attack Chopper Gunnerbar

Post by Rhino »

Nice work :D

Possibly Mosz might be able to help you out with your problems :)
Image
Moszeusz6Pl
Retired PR Developer
Posts: 939
Joined: 2010-06-24 13:41

Re: Attack Chopper Gunnerbar

Post by Moszeusz6Pl »

You can check this link, for all possible commands that you can use.

Turret elevation should be PlayerElevation

Image
Inspektura43
Posts: 415
Joined: 2012-06-23 16:00

Re: Attack Chopper Gunnerbar

Post by Inspektura43 »

Yeah I think Moszeusz is the guy working on the huds (and doing great).

Great job btw :P
Easiest way to talk behind someones back.
1.Join PR community
2.Get access to SA forums
3.Talk
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: Attack Chopper Gunnerbar

Post by Mats391 »

'[R-CON wrote:Moszeusz6Pl;1894226']You can check this link, for all possible commands that you can use.

Turret elevation should be PlayerElevation
I tried PlayerElevation, but that gives the total elevation and not relative to the chopper. so unless the chopper stays horizontal all the time it is rarely accurate.

i also noticed another bug: if the chopper is facing south or east of it and the gunner looks west of south, the bar disappears.
Image

Mineral: TIL that Wire-guided missiles actually use wire
richyrich55
Posts: 332
Joined: 2007-07-18 16:04

Re: Attack Chopper Gunnerbar

Post by richyrich55 »

In 1.0, don't the Apache's/attack choppers have aimable rockets? Is it possible to use the same code or whatever but maybe have them stay stationary?
"What's the advantage of these choppers when compared to a squad medic?"

Pirate

"Medics dont have rotors."

rampo93(FIN)

Stemplus
Posts: 333
Joined: 2011-06-25 17:31

Re: Attack Chopper Gunnerbar

Post by Stemplus »

What the hell are you talking about?
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: Attack Chopper Gunnerbar

Post by Mats391 »

richyrich55 wrote:In 1.0, don't the Apache's/attack choppers have aimable rockets? Is it possible to use the same code or whatever but maybe have them stay stationary?
not sure what you mean. the rockets are already aimable, but you only move the camera and not the actual "gun" and thats why the game doesnt recognize it as a change in the Vehicle turret angle. Atleast thats how i think it is :)

Also i gave up on an elevation bar, doesnt seem possible :(
but i managed to fix the disappearing bar

Code: Select all

rem -------------------------------------- GunnerBar --------------------------------------

hudBuilder.createPictureNode			ApacheCoPilotHud ApacheBargunner 349 486 128 64
hudBuilder.setPictureNodeTexture 		Ingame\Vehicles\Icons\Hud\Air\Attack\Ah64a\ah64_gunbar.dds
hudBuilder.setNodeColor		 		0 1 0 1

hudBuilder.createCompassNode 			ApacheCoPilotHud ApacheBargunnerView 3 365 499 72 16 1 0
hudBuilder.setCompassNodeTexture 		1 Ingame\Vehicles\Icons\Hud\Air\Attack\Ah1z\Ah1z_gunnerwiew.tga
hudBuilder.setCompassNodeTextureSize		128 16
hudBuilder.setCompassNodeBorder			0 0 0 234
hudBuilder.setCompassNodeValueVariable  	VehicleTurretAngle
hudBuilder.setCompassNodeOffset			-31
hudBuilder.setNodeColor		 		0 1 0 1

hudBuilder.createCompassNode 			ApacheCoPilotHud ApacheBargunnerViewAlt 3 365 499 72 16 1 0
hudBuilder.setCompassNodeTexture 		1 Ingame\Vehicles\Icons\Hud\Air\Attack\Ah1z\Ah1z_gunnerwiew.tga
hudBuilder.setCompassNodeTextureSize		128 16
hudBuilder.setCompassNodeBorder			0 0 0 234
hudBuilder.setCompassNodeValueVariable  	VehicleTurretAngle
hudBuilder.setCompassNodeOffset			-138
hudBuilder.setNodeColor		 		0 1 0 1
Image

Mineral: TIL that Wire-guided missiles actually use wire
lucky.BOY
Posts: 1438
Joined: 2010-03-03 13:25

Re: Attack Chopper Gunnerbar

Post by lucky.BOY »

dont know how coding these things works, but if you can get vehicle elevation, and absolute gunner/camera elevation, cant you just substract them to get relative elevation of camera to vehicle?
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: Attack Chopper Gunnerbar

Post by Mats391 »

lucky.BOY wrote:dont know how coding these things works, but if you can get vehicle elevation, and absolute gunner/camera elevation, cant you just substract them to get relative elevation of camera to vehicle?
afaik you cant calculate anything. the only way to do this is having 2bars that overlap eachother and thus subtract.
Image

Mineral: TIL that Wire-guided missiles actually use wire
Moszeusz6Pl
Retired PR Developer
Posts: 939
Joined: 2010-06-24 13:41

Re: Attack Chopper Gunnerbar

Post by Moszeusz6Pl »

Did you tried using VehicleElevation? About gunnerbar it works fine for pilot, so should work for gunner to. I will more into it when I will recode gunships.

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

Re: Attack Chopper Gunnerbar

Post by Mats391 »

[R-CON]Moszeusz6Pl wrote:Did you tried using VehicleElevation? About gunnerbar it works fine for pilot, so should work for gunner to. I will more into it when I will recode gunships.
Doesnt seem like VehicleElevation work as copilot at all. :S
if you are talking about just copying the gunnerbar from pilot, i tried that and the GunnerView variable doesnt update either as copilot.
Image

Mineral: TIL that Wire-guided missiles actually use wire
Moszeusz6Pl
Retired PR Developer
Posts: 939
Joined: 2010-06-24 13:41

Re: Attack Chopper Gunnerbar

Post by Moszeusz6Pl »

Oh, I was thinking that you are using same variable as pilot do. It would require to hack some variables. Or used method I invented yesterday, and didn't test it yet. :D

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

Re: Attack Chopper Gunnerbar

Post by Mats391 »

[R-CON]Moszeusz6Pl wrote:Oh, I was thinking that you are using same variable as pilot do. It would require to hack some variables. Or used method I invented yesterday, and didn't test it yet. :D
it works with VehicleTurretAngle w/o any hack, just need a second compass for the problem i described above. im curios about your method tho :)
edit: also just noticed that VehicleElevation does work as gunner. in my first test i must have screwed something up. but it only shows the elevation of vehicle not of the gun
Last edited by Mats391 on 2013-05-21 16:12, edited 2 times in total.
Image

Mineral: TIL that Wire-guided missiles actually use wire
richyrich55
Posts: 332
Joined: 2007-07-18 16:04

Re: Attack Chopper Gunnerbar

Post by richyrich55 »

Stemplus wrote:What the hell are you talking about?
Mats391 wrote:not sure what you mean. the rockets are already aimable, but you only move the camera and not the actual "gun" and thats why the game doesnt recognize it as a change in the Vehicle turret angle. Atleast thats how i think it is :)

https://www.realitymod.com/forum/f18-pr ... -pods.html

;)
"What's the advantage of these choppers when compared to a squad medic?"

Pirate

"Medics dont have rotors."

rampo93(FIN)

Inspektura43
Posts: 415
Joined: 2012-06-23 16:00

Re: Attack Chopper Gunnerbar

Post by Inspektura43 »

I've seen a blackshark in NAW 7.0 mod in which you can lower the cannon of the helicopter by holding SHIFT
Easiest way to talk behind someones back.
1.Join PR community
2.Get access to SA forums
3.Talk
Post Reply

Return to “PR:BF2 Community Modding”