Page 1 of 1
Attack Chopper Gunnerbar
Posted: 2013-05-19 11:05
by Mats391
After reading
this suggetion, i wanted to give it a try.
i got it to work just like suggested
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

Re: Attack Chopper Gunnerbar
Posted: 2013-05-19 11:11
by Rhino
Nice work
Possibly Mosz might be able to help you out with your problems

Re: Attack Chopper Gunnerbar
Posted: 2013-05-19 11:21
by Moszeusz6Pl
You can check
this link, for all possible commands that you can use.
Turret elevation should be PlayerElevation
Re: Attack Chopper Gunnerbar
Posted: 2013-05-19 13:54
by Inspektura43
Yeah I think Moszeusz is the guy working on the huds (and doing great).
Great job btw

Re: Attack Chopper Gunnerbar
Posted: 2013-05-19 16:17
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.
Re: Attack Chopper Gunnerbar
Posted: 2013-05-20 05:19
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?
Re: Attack Chopper Gunnerbar
Posted: 2013-05-20 16:00
by Stemplus
What the hell are you talking about?
Re: Attack Chopper Gunnerbar
Posted: 2013-05-20 20:31
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
Re: Attack Chopper Gunnerbar
Posted: 2013-05-20 20:55
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?
Re: Attack Chopper Gunnerbar
Posted: 2013-05-20 21:23
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.
Re: Attack Chopper Gunnerbar
Posted: 2013-05-21 05:29
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.
Re: Attack Chopper Gunnerbar
Posted: 2013-05-21 09:10
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.
Re: Attack Chopper Gunnerbar
Posted: 2013-05-21 11:04
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.

Re: Attack Chopper Gunnerbar
Posted: 2013-05-21 13:57
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.
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
Re: Attack Chopper Gunnerbar
Posted: 2013-05-25 01:48
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

Re: Attack Chopper Gunnerbar
Posted: 2013-05-25 04:30
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