View Full Version : Need help on locking visual for Cobra mounted Sidewinder [Images Included]
Why?!
07-13-2005, 04:38 PM
Having gotten fed up with helicopter to helicopter fights taking so long I decided to throw some air to air missiles on the Cobra. For the better part of yesterday I was coding it in, figuring out new things about the BF2 engine as I went such as the HUD.
http://img259.imageshack.us/img259/160/bf2stinger029dv.jpg
The missiles themselves work 100%. They will see a target, lock onto them, and guide themselves in for a kill.
http://img259.imageshack.us/img259/7403/bf2sidewinder030ax.jpg
Before, I directly used the HUD from an F18, so when you switched to the sidewinders, you would lose all your helicopter instruments and start using the F18 instruments. After going through a lot of guesswork I created a custom HUD locking system for the Cobra.
http://img259.imageshack.us/img259/6646/bf2stinger016ja.jpg
And here comes the problem, as I said before the missiles themselves work very well. However, the HUD does not show the missiles locking on, nor does it play the locking noises. The code for the HUD and missiles is more or less a direct copy from the original F18 code. I have gone over both codes over and over to see if I had accidently changed anything and have found nothing aside from naming differences where necessary.
Also it has nothing to do with the HUD changes I made, because when the HUD was the F18s there was still no locking on or noises. In both pictures the missile is locked and ready to fire.
Old HUD
http://img316.imageshack.us/img316/4095/bf2roflmissiles34oa.jpg
New HUD
http://img347.imageshack.us/img347/2140/bf2sidewinder046ld.jpg
Why?!
07-13-2005, 04:43 PM
And of course here is the source code for it all. These are all excerpts because the files are extremely large. I have shown only what I have edited/added.
Bolded are additions/changes.
ahe_ah1z.tweak
rem -------------------------------------
ObjectTemplate.addTemplate S_ahe_ah1z_Ambient
ObjectTemplate.addTemplate S_ahe_ah1z_AmbientDamaged
ObjectTemplate.addTemplate ahe_ah1z_Camera_pilot
ObjectTemplate.setPosition 0/0.827/2.22
ObjectTemplate.setRotation 0/4/0
ObjectTemplate.addTemplate ahe_ah1z_EntryPoint
ObjectTemplate.setPosition 0/-0.481644/2.60231
ObjectTemplate.addTemplate AHE_AH1Z_HydraLauncher
ObjectTemplate.addTemplate ah1z_SidewinderLauncher
ObjectTemplate.addTemplate ahe_ah1z_mainrotor
ObjectTemplate.setPosition 0/1.49584/0
ObjectTemplate.setRotation -90/0/0
ObjectTemplate.addTemplate ahe_ah1z_tailrotor
ObjectTemplate.setPosition 0.54069/1.44036/-9.03099
ObjectTemplate.addTemplate HeatObject
ObjectTemplate.setPosition 0/0.74307/-2.38056
ObjectTemplate.addTemplate AHE_AH1Z_FlareLauncher
ObjectTemplate.addTemplate ahe_ah1z_Rotorhead
ObjectTemplate.setPosition 0/-20/0
ObjectTemplate.addTemplate ahe_ah1z_BodyWing
ObjectTemplate.setRotation 0/0/-90
ObjectTemplate.addTemplate ahe_ah1z_Rudder
ObjectTemplate.setPosition 0/0/-8.5
ObjectTemplate.setRotation 0/0/-90
ObjectTemplate.addTemplate ahe_ah1z_WingL
ObjectTemplate.setPosition -1/0/1
ObjectTemplate.setRotation 0/0/-10
ObjectTemplate.addTemplate ahe_ah1z_WingR
ObjectTemplate.setPosition 1/0/1
ObjectTemplate.setRotation 0/0/10
ObjectTemplate.addTemplate AHE_AH1Z_TailEngine
ObjectTemplate.setPosition 0/0/-8.87184
ObjectTemplate.setRotation -90/0/0
ObjectTemplate.addTemplate agm114_hellfiredummy
ObjectTemplate.setPosition 1.29/-0.32/0.3
ObjectTemplate.setRotation 0/-3.4/0
ObjectTemplate.addTemplate agm114_hellfiredummy
ObjectTemplate.setPosition -1.29/-0.32/0.3
ObjectTemplate.setRotation 0/-3.4/0
ObjectTemplate.addTemplate agm114_hellfiredummy
ObjectTemplate.setPosition 1.297/-0.63/0.3
ObjectTemplate.setRotation 0/-3.4/0
ObjectTemplate.addTemplate agm114_hellfiredummy
ObjectTemplate.setPosition -1.297/-0.63/0.3
ObjectTemplate.setRotation 0/-3.4/0
ObjectTemplate.addTemplate agm114_hellfiredummy
ObjectTemplate.setPosition 1.638/-0.32/0.3
ObjectTemplate.setRotation 0/-3.4/0
ObjectTemplate.addTemplate agm114_hellfiredummy
ObjectTemplate.setPosition -1.638/-0.32/0.3
ObjectTemplate.setRotation 0/-3.4/0
ObjectTemplate.addTemplate agm114_hellfiredummy
ObjectTemplate.setPosition 1.638/-0.62/0.3
ObjectTemplate.setRotation 0/-3.4/0
ObjectTemplate.addTemplate agm114_hellfiredummy
ObjectTemplate.setPosition -1.638/-0.62/0.3
ObjectTemplate.setRotation 0/-3.4/0
ObjectTemplate.addTemplate ahe_ah1z_EntryPoint2
ObjectTemplate.setPosition 0/1.40171/-0.806523
rem -------------------------------------
Here is the weapon addition I have made
rem ************************************************** *************************************
ObjectTemplate.create GenericFireArm ah1z_SidewinderLauncher
ObjectTemplate.modifiedByUser why
ObjectTemplate.createdInEditor 0
rem ---BeginComp:WeaponHud ---
ObjectTemplate.createComponent WeaponHud
ObjectTemplate.weaponHud.weaponIcon Ingame\Weapons\Icons\Hud\bomb.tga
ObjectTemplate.weaponHud.selectIcon Ingame\Weapons\Icons\Hud\Selection\sidewinder_miss ile.tga
ObjectTemplate.weaponHud.hudName "Aim-9M SIDEWINDER"
ObjectTemplate.weaponHud.guiIndex 128
ObjectTemplate.weaponHud.hasFireRate 0
ObjectTemplate.weaponHud.addShowOnCamMode 2
ObjectTemplate.weaponHud.displaySelectOnActivation 1
ObjectTemplate.weaponHud.firstLockSound HUD_Air_to_Air_Heatseeker_Track
ObjectTemplate.weaponHud.secondLockSound HUD_Air_to_Air_Heatseeker_Lock
rem ---EndComp ---
rem ---BeginComp:MultiFireComp ---
ObjectTemplate.createComponent MultiFireComp
ObjectTemplate.fire.roundsPerMinute 120
ObjectTemplate.fire.fireInput PIFire
ObjectTemplate.fire.addFireRate 0
ObjectTemplate.fire.useDummyProjectiles 1
ObjectTemplate.fire.addBarrelName aim9m_sidewinderdummy
rem ---EndComp ---
rem ---BeginComp:DefaultAmmoComp ---
ObjectTemplate.createComponent DefaultAmmoComp
ObjectTemplate.ammo.nrOfMags 1
ObjectTemplate.ammo.magSize 2
ObjectTemplate.ammo.autoReload 1
ObjectTemplate.ammo.reloadWithoutPlayer 1
rem ---EndComp ---
rem ---BeginComp:HelpHud ---
ObjectTemplate.createComponent HelpHud
ObjectTemplate.HelpHud.lowAmmoHelpSoundKey "HUD_HELP_VEHICLE_JET_LOWAMMO_flyOverFriendlyAirFie ld"
ObjectTemplate.HelpHud.lowAmmoHelpStringKey "HUD_HELP_VEHICLE_JET_LOWAMMO_flyOverFriendlyAirFie ld"
rem ---EndComp ---
rem ---BeginComp:SimpleDeviationComp ---
ObjectTemplate.createComponent SimpleDeviationComp
rem ---EndComp ---
rem ---BeginComp:DefaultSoundComp ---
ObjectTemplate.createComponent DefaultSoundComp
rem ---EndComp ---
rem ---BeginComp:DefaultAnimationComp ---
ObjectTemplate.createComponent DefaultAnimationComp
rem ---EndComp ---
rem ---BeginComp:DefaultZoomComp ---
ObjectTemplate.createComponent DefaultZoomComp
ObjectTemplate.zoom.addZoomFactor 0
rem ---EndComp ---
rem ---BeginComp:MultiFireArmTargetComp ---
ObjectTemplate.createComponent MultiFireArmTargetComp
ObjectTemplate.target.maxDistance 375
ObjectTemplate.target.targetSystem TSHeatSeeking
ObjectTemplate.target.lockDelay 1
ObjectTemplate.target.lockAngle 8
rem ---EndComp ---
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Mesh
ObjectTemplate.aiTemplate F18_sidewinder_AI
rem -------------------------------------
ObjectTemplate.addTemplate S_ah1z_SidewinderLauncher_Fire1P
ObjectTemplate.addTemplate S_ah1z_SidewinderLauncher_Fire1P_Outdoor
ObjectTemplate.addTemplate S_ah1z_SidewinderLauncher_Fire3P
ObjectTemplate.addTemplate S_ah1z_SidewinderLauncher_BoltClick
ObjectTemplate.addTemplate S_ah1z_SidewinderLauncher_TriggerClick
ObjectTemplate.addTemplate S_ah1z_SidewinderLauncher_SwitchFireRate
ObjectTemplate.addTemplate S_ah1z_SidewinderLauncher_Reload1P
ObjectTemplate.addTemplate S_ah1z_SidewinderLauncher_Reload3P
ObjectTemplate.addTemplate S_ah1z_SidewinderLauncher_Deploy1P
ObjectTemplate.addTemplate S_ah1z_SidewinderLauncher_Deploy3P
ObjectTemplate.addTemplate S_ah1z_SidewinderLauncher_Zoom
ObjectTemplate.addTemplate aim9m_sidewinderdummy
ObjectTemplate.setPosition -1.64/0.03/0.3
ObjectTemplate.setRotation 0/-3.4/0
ObjectTemplate.addTemplate aim9m_sidewinderdummy
ObjectTemplate.setPosition 1.65/0.03/0.3
ObjectTemplate.setRotation 0/-3.4/0
rem -------------------------------------
ObjectTemplate.projectileTemplate aim9m_sidewinder
ObjectTemplate.velocity 0
ObjectTemplate.itemIndex 2
ObjectTemplate.activeSafe Sound S_ah1z_SidewinderLauncher_Fire1P
ObjectTemplate.modifiedByUser ljo
ObjectTemplate.soundFilename "objects/vehicles/land/aav_tunguska/sounds/mono/missile_fire.wav"
ObjectTemplate.loopCount 0
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 1
ObjectTemplate.volume 1
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1
ObjectTemplate.pitchEnvelope 0/1/0.9/1.1/1/1/0/0.97/1.03/
ObjectTemplate.volumeEnvelope 0/1/0/1/1/1/0/0.9/1/
ObjectTemplate.activeSafe Sound S_ah1z_SidewinderLauncher_Fire1P_Outdoor
ObjectTemplate.modifiedByUser ljo
ObjectTemplate.activeSafe Sound S_ah1z_SidewinderLauncher_Fire3P
ObjectTemplate.modifiedByUser ljo
ObjectTemplate.soundFilename "objects/vehicles/land/aav_tunguska/sounds/mono/missile_fire.wav"
ObjectTemplate.loopCount 0
ObjectTemplate.is3dSound 1
ObjectTemplate.stopType 1
ObjectTemplate.volume 1
ObjectTemplate.pitch 1
ObjectTemplate.reverbLevel 1
ObjectTemplate.minDistance 4
ObjectTemplate.halfVolumeDistance 7
ObjectTemplate.activeSafe Sound S_ah1z_SidewinderLauncher_BoltClick
ObjectTemplate.modifiedByUser ljo
ObjectTemplate.activeSafe Sound S_ah1z_SidewinderLauncher_TriggerClick
ObjectTemplate.modifiedByUser ljo
ObjectTemplate.activeSafe Sound S_ah1z_SidewinderLauncher_SwitchFireRate
ObjectTemplate.modifiedByUser ljo
ObjectTemplate.activeSafe Sound S_ah1z_SidewinderLauncher_Reload1P
ObjectTemplate.modifiedByUser ljo
ObjectTemplate.activeSafe Sound S_ah1z_SidewinderLauncher_Reload3P
ObjectTemplate.modifiedByUser ljo
ObjectTemplate.activeSafe Sound S_ah1z_SidewinderLauncher_Deploy1P
ObjectTemplate.modifiedByUser ljo
ObjectTemplate.soundFilename "common/sound/weapon_toggle_vehicle.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.3
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 0
ObjectTemplate.activeSafe Sound S_ah1z_SidewinderLauncher_Deploy3P
ObjectTemplate.modifiedByUser ljo
ObjectTemplate.activeSafe Sound S_ah1z_SidewinderLauncher_Zoom
ObjectTemplate.modifiedByUser ljo
And here is the HUD file
HudElementsAh1zPilot.con
hudBuilder.createSplitNode VehicleHuds Ah1zPilotHud
hudBuilder.setNodeLogicShowVariable EQUAL GuiIndex 24
hudBuilder.setNodeLogicShowVariable OR GuiIndex 128
hudBuilder.addNodeBlendEffect 7 2
rem ------ Compass ------
hudBuilder.createCompassNode Ah1zPilotHud Ah1zCompass 3 340 100 128 32 1 0
hudBuilder.setCompassNodeTexture 1 Ingame\Vehicles\Icons\Hud\Air\Attack\Ah1z\Ah1z_com pas.tga
hudBuilder.setCompassNodeTextureSize 256 32
hudBuilder.setCompassNodeBorder 0 0 0 76
hudBuilder.setCompassNodeValueVariable VehicleAngle
hudBuilder.setCompassNodeOffset 19
hudBuilder.setNodeColor 0 0.8 0 1
hudBuilder.createPictureNode Ah1zPilotHud Ah1zCompassArrow 393 131 16 16
hudBuilder.setPictureNodeTexture Ingame\Vehicles\Icons\Hud\Air\Attack\Ah1z\Ah1z_com pasarrow.tga
hudBuilder.setNodeColor 0 0.8 0 1
rem ------ HorizonBar ------
hudBuilder.createPictureNode Ah1zPilotHud Ah1zMissileHorizon 272 172 256 8
hudBuilder.setPictureNodeTexture Ingame\Vehicles\Icons\Hud\Air\Attack\F15\Navigatio n\horizon.tga
hudBuilder.setNodeColor 0 0.8 0 1
hudBuilder.setNodePosVariable 1 AngleOfAttack
hudBuilder.setPictureNodeRotateVariable VehicleBanking
hudBuilder.setPictureNodeCenterPoint 0 0
rem ------ Crosshair ------
hudBuilder.createPictureNode Ah1zPilotHud Ah1zCrosshair 384 284 32 32
hudBuilder.setPictureNodeTexture Ingame\Vehicles\Icons\Hud\Air\Attack\Ah1z\Ah1z_cro sshair.tga
hudBuilder.setNodeColor 0 0.8 0 1
rem -------------------------------------- Hit Indication----------------------------------------------------
hudBuilder.createPictureNode Ah1zPilotHud Ah1zPilotHitIndication 384 284 32 32
hudBuilder.setPictureNodeTexture Ingame/CrossHair/vsp_HitIndicator.tga
hudBuilder.setNodeColor 0 0.8 0 1
hudBuilder.setNodeAlphaVariable HitIndicatorIconAlpha
hudBuilder.setNodeShowVariable HitIndicatorIconShow
rem ------ Hover ------
hudBuilder.createHoverNode Ah1zPilotHud Ah1zHover 280 100 240 360
hudBuilder.setHoverInMiddlePos 385 280
hudBuilder.setHoverMaxValue 0.5
hudBuilder.setHoverWidthLength 20 20
hudBuilder.createPictureNode Ah1zPilotHud Ah1zHoverPic 385 279 32 32
hudBuilder.setNodePosVariable 0 Ah1zHoverHoverNodeXPos
hudBuilder.setNodePosVariable 1 Ah1zHoverHoverNodeYPos
hudBuilder.setPictureNodeTexture Ingame\Vehicles\Icons\Hud\Air\Attack\Ah1z\Ah1z_hov erpos.tga
hudBuilder.setNodeColor 0 0.8 0 1
hudBuilder.setNodeShowVariable Ah1zHoverHoverNodeShow
rem ------ ClimbBar ------
hudBuilder.createPictureNode Ah1zPilotHud Ah1zClimbBar 520 110 32 256
hudBuilder.setPictureNodeTexture Ingame\Vehicles\Icons\Hud\Air\Attack\Ah1z\Ah1z_cli mbbar.tga
hudBuilder.setNodeColor 0 0.8 0 1
hudBuilder.createCompassNode Ah1zPilotHud Ah1zClimbBarArrow 0 520 191 16 148 0 1
hudBuilder.setCompassNodeTexture 1 Ingame\Vehicles\Icons\Hud\Air\Attack\Ah1z\Ah1z_cli mdarrow.tga
hudBuilder.setCompassNodeTextureSize 16 256
hudBuilder.setCompassNodeBorder 0 240 0 0
hudBuilder.setCompassNodeValueVariable VehicleElevationSpeedAngle
hudBuilder.setCompassNodeOffset -70
hudBuilder.setCompassNodeSnapOffset 4 4 0 0
hudBuilder.setNodeColor 0 0.8 0 1
rem ------ Torque ------
hudBuilder.createPictureNode Ah1zPilotHud Ah1zTorqueBar 252 189 32 256
hudBuilder.setPictureNodeTexture Ingame\Vehicles\Icons\Hud\Air\Attack\Ah1z\Ah1z_tor que.tga
hudBuilder.setNodeColor 0 0.8 0 1
hudBuilder.createBarNode Ah1zPilotHud Ah1zTorque 0 262 198 5 141
hudbuilder.setBarNodeTexture 1 Ingame/GeneralIcons/full.tga
hudbuilder.setBarNodeTexture 2 Ingame/GeneralIcons/empty.tga
hudBuilder.setBarNodeValueVariable Torque
hudBuilder.setNodeColor 0 0.8 0 1
hudBuilder.createTextNode Ah1zPilotHud Ah1zTorquePercentValue 251 263 40 10
hudBuilder.setTextNodeStyle Fonts/vehicleHudFont_6.dif 1
hudBuilder.setTextNodeStringVariable TorqueString
hudBuilder.setNodeColor 0 0.8 0 1
hudBuilder.createPictureNode Ah1zPilotHud Ah1zTorquePercent 290 261 16 16
hudBuilder.setPictureNodeTexture Ingame\Vehicles\Icons\Hud\Air\Attack\Ah1z\Ah1z_pro cent.tga
hudBuilder.setNodeColor 0 0.8 0 1
rem ------ Speed/Alt ------
hudBuilder.createTextNode Ah1zPilotHud Ah1zSpeedValue 230 372 40 10
hudBuilder.setTextNodeStyle Fonts/vehicleHudFont_6.dif 1
hudBuilder.setTextNodeStringVariable SpeedString
hudBuilder.setNodeColor 0 0.8 0 1
hudBuilder.createTextNode Ah1zPilotHud Ah1zAltitudeValue 506 372 40 10
hudBuilder.setTextNodeStyle Fonts/vehicleHudFont_6.dif 0
hudBuilder.setTextNodeStringVariable AltitudeString
hudBuilder.setNodeColor 0 0.8 0 1
rem ------ Gunner ------
hudBuilder.createPictureNode Ah1zPilotHud Ah1zGunnerBar 362 380 128 32
hudBuilder.setPictureNodeTexture Ingame\Vehicles\Icons\Hud\Air\Attack\Ah1z\Ah1z_gun nerbar.tga
hudBuilder.setNodeColor 0 0.8 0 1
hudBuilder.createCompassNode Ah1zPilotHud Ah1zGunnerBarView 3 335 384 123 16 1 0
hudBuilder.setCompassNodeTexture 1 Ingame\Vehicles\Icons\Hud\Air\Attack\Ah1z\Ah1z_gun nerwiew.tga
hudBuilder.setCompassNodeTextureSize 128 16
hudBuilder.setCompassNodeBorder 0 0 0 22
hudBuilder.setCompassNodeValueVariable GunnerAngle
hudBuilder.setCompassNodeOffset -61
rem hudBuilder.setCompassNodeSnapOffset 0 0 8 8
hudBuilder.setNodeColor 0 0.8 0 1
hudBuilder.createSplitNode Ah1zPilotHud Ah1zHeatHud
hudBuilder.setNodeLogicShowVariable EQUAL GuiIndex 128
hudBuilder.createObjectMarkerNode Ah1zHeatHud Ah1zMarker 224 139 352 321
hudBuilder.setObjectMarkerNodeTexture 0 Ingame\Vehicles\Icons\Hud\Air\Attack\F15\HeatSeeki ng\lockBoxFriendly.tga
hudBuilder.setObjectMarkerNodeTexture 1 Ingame\Vehicles\Icons\Hud\Air\Attack\F15\HeatSeeki ng\lockBox.tga
hudBuilder.setObjectMarkerNodeTexture 2 Ingame\Vehicles\Icons\Hud\Air\Attack\F15\HeatSeeki ng\lockBoxLocked.tga
hudBuilder.setObjectMarkerNodeTexture 3 Ingame\Vehicles\Icons\Hud\Land\Tunguska\rangeLine. tga
hudBuilder.setObjectMarkerNodeTextureSize 0 32 32
hudBuilder.setObjectMarkerNodeTextureSize 1 32 32
hudBuilder.setObjectMarkerNodeTextureSize 2 64 64
hudBuilder.setObjectMarkerNodeTextureSize 3 16 256
hudBuilder.setObjectMarkerNodeObjects 4
hudBuilder.setObjectMarkerNodeWeapon 1
hudBuilder.setNodeColor 0 0.8 0 1
hudBuilder.createPictureNode Ah1zHeatHud Ah1zMissileCircle 272 172 256 256
hudBuilder.setPictureNodeTexture Ingame\Vehicles\Icons\Hud\Air\Attack\F15\HeatSeeki ng\missileCrosshairalt.tga
hudBuilder.setNodeColor 0 0.8 0 1
Seigman
07-13-2005, 05:11 PM
As I don't have a comp to run the game yet, this is just a calculated guess from my side, so please exuse me if it's way off:
When you create the ObjectMarkerNode for the Ah1z hud, add this line to it:
hudBuilder.setObjectMarkerNodeLockOnType 1
making it look like this:
hudBuilder.createObjectMarkerNode Ah1zHeatHud Ah1zMarker 224 139 352 321
hudBuilder.setObjectMarkerNodeTexture 0 Ingame\Vehicles\Icons\Hud\Air\Attack\F15\HeatSeeki ng\lockBoxFriendly.tga
hudBuilder.setObjectMarkerNodeTexture 1 Ingame\Vehicles\Icons\Hud\Air\Attack\F15\HeatSeeki ng\lockBox.tga
hudBuilder.setObjectMarkerNodeTexture 2 Ingame\Vehicles\Icons\Hud\Air\Attack\F15\HeatSeeki ng\lockBoxLocked.tga
hudBuilder.setObjectMarkerNodeTexture 3 Ingame\Vehicles\Icons\Hud\Land\Tunguska\rangeLine. tga
hudBuilder.setObjectMarkerNodeTextureSize 0 32 32
hudBuilder.setObjectMarkerNodeTextureSize 1 32 32
hudBuilder.setObjectMarkerNodeTextureSize 2 64 64
hudBuilder.setObjectMarkerNodeTextureSize 3 16 256
hudBuilder.setObjectMarkerNodeLockOnType 1
hudBuilder.setObjectMarkerNodeObjects 4
hudBuilder.setObjectMarkerNodeWeapon 1
hudBuilder.setNodeColor 0 0.8 0 1
Why?!
07-13-2005, 05:26 PM
Thanks but that only seemed to get rid of the lock boxes entirely. Again the missiles themselves locked and fired, but the HUD showed no indication.
That line seems to have some obscure meaning because interestingly enough it only appears on the bomb HUDs, which are not guided. [Edit] This command means that the HUD designates ground targets instead of air targets.
I also fixed a minor weapon select bug by changing "ObjectTemplate.itemIndex 1" to "ObjectTemplate.itemIndex 2"
The change has been made in my previous post.
Seigman
07-13-2005, 05:30 PM
Try changing the guiIndex on the sidewinder firearm to the same that you've set the VehicleHud EQUAL to. It's done like that on the F18. The OR guiIndex is used on the heathud...
SylentSnipe
07-13-2005, 05:35 PM
So could you make this a simple install or put the files that you edited up for download?
Why?!
07-13-2005, 06:01 PM
Try changing the guiIndex on the sidewinder firearm to the same that you've set the VehicleHud EQUAL to. It's done like that on the F18. The OR guiIndex is used on the heathud...
I am pretty sure I tried that awhile ago, and that caused the hud to be the missile hud by default. Which is bad, because then you have the missile HUD for the default rockets. The reason that I created a new GUI index was so because the missile is a secondary. You switch between either rocket hud, or the missile hud.
But that is not stopping me from trying this anyway.
[Edit] Just tried this it worked, or rather did not work, exactly as I described it.
[Double Edit] But that gives me an idea I should have tried before...
So could you make this a simple install or put the files that you edited up for download?
I could release the mod files, but I would have to find a place to put them.
I have them set up as a separate mod. (Thanks rexman for releasing that jet mod, showed me how to setup a seperate mod and shortcut). And I have never made an installer before. Rexman also used a batch file to copy the necessary files that were required for a separate functioning mod (something I never quite figured out).
In all honesty I will probably just give out the text files I modded and then the user has to put them somewhere manually. I am only hoping the mod tools will allow for much easier distribution of mods like in 1942. Until then all of my mods or whatever I do will still have a do it yourself aspect to them.
Why?!
07-13-2005, 06:42 PM
http://img57.imageshack.us/img57/1958/bf2finalmissile019dk.jpg
http://img57.imageshack.us/img57/9347/bf2finalmissile025bh.jpg
Fixed it!
The solution to this was a hardcoded thing. After some switching around of the weapons and then finally combining them, I found out that all missiles must be set to secondary fire.
Airplanes have 2 combinations of possible weapons, either machinegun and missile or machinegun and bomb. My Cobra also had 2 combinations, but there was only one weapon for each combination. You either had the rockets selected, or the missiles selected.
In order to have the locking work the missile has to be secondary fire, so now there is only one combination of weapons that you can use. The hydra rockets are primary fire and sidewinder missiles are secondary fire. It is unfortunate that this is hard coded into the game. I wanted a way to switch the targeting computer on and off, and not be able to use both at the same time.
imported_annerajb
07-13-2005, 08:36 PM
now when you can an install file would be cool.
Why?!
07-13-2005, 08:51 PM
*Warning* This is not a self extracting zip, the zip contains 4 zips inside that each contain their respective files. Basic modding knowledge is required. If you are overwriting the vanilla files, make sure to BACK THEM UP.
Here are the files that are in my mod.
Rather than sort out the necessary files, I decided to just put my entire mod up for download. It changes several minor things that were made just for fun/testing. The changes are:
AA Sidewinder missiles added to Cobra, with custom AA graphic.
SP Operation Clean Sweep now has F/A-18 instead of F-15E.
F/A-18 is now equipped with 2 AG Maverick missiles instead of bombs.
All AA missiles kill any aircraft in 1 hit.
Nice work guys looks great
Darksniper75
07-14-2005, 07:41 PM
Nicely done, sad the editor still aint here
Djuice
07-15-2005, 12:17 PM
nicely done, but the way you did you code does not work with ground vehicles, fro example, MBTs, ive tried many times to add an addition weapon to the tank, to simulate various ammo type that a TANK could fire, but i havent been able to successfully add a third weapon onto the tank, and still using the same barrel to fire it.
imported_annerajb
07-15-2005, 01:05 PM
has you experienced any lag in the game when using your mod because i make a mod for laser guide missiles and it created lag.
Why?!
07-15-2005, 03:13 PM
nicely done, but the way you did you code does not work with ground vehicles, fro example, MBTs, ive tried many times to add an addition weapon to the tank, to simulate various ammo type that a TANK could fire, but i havent been able to successfully add a third weapon onto the tank, and still using the same barrel to fire it.
Strange, perhaps it is something you overlooked. For fun I changed the LAV-25 around a bit. Primary fire was still the machine cannon, Default Secondary fire launches a Maverick AGM missile through the left missile pod. You can then cycle weapons to the right missile pod which is a stinger launcher. I love missiles :laugh:
Make sure that the default secondary has an itemindex of 1 and the alternate secondary an itemindex of 2. Also, make sure to set them both to PIAltFire.
Perhaps the problem lies in the barrel. I am not sure what you mean by this, because if you are literally using the same barrel then that could be the problem. There is not enough information for me to really make an accurate guess, but I will try to do this myself.
Attached is the code for the two missiles I just added to the LAV-25. Just overwrite these files with the existing ones. I also included the file for Operation Clean Sweep. I accidentaly left that out when I packed the last zip. Which brings me to this.
has you experienced any lag in the game when using your mod because i make a mod for laser guide missiles and it created lag.
I created a "new" laser guided missile for the F-18 in the above zip. It was unavailible for use because I forgot to include the Operation Clean Sweep SP files. However we might be talking about different things. The laser guided missiles in vanilla work in a similar way to the TV missiles on the Cobra. The missiles I made are laserguided, but they are locked and launched in a much more traditional method. You can try for yourself in this mod to see if what I did has any relevence to your problem. Load up Clean Sweep in Singleplayer and fly around. Switch to the bombs, which now have an identical HUD to the ordinary missile HUD. Find a tank, lock on, and launch a missile. Even if it does take all the skill out of bombing, it is immensely satisfying. :D
Djuice
07-15-2005, 03:24 PM
it could be the fact that the main cannon is in the first slot, (bottom left hand side of the hud) and that the Coaxial 7.62mm MG is not coded into the tanks .tweak file.
Ill give it another go... maybe i reckon the sucess rate would be 1% or less..
Removing the coaxial 7.62mm from the tweak file cause a CTD upon desktop upon loading the map.
Why?!
07-15-2005, 03:38 PM
To change weapons the cannon will have to be rebinded to the secondary fire. This will also cause some changes to be made with the coaxial gun in another file, which would mean you have to change it, which would mean you would have to change the other tanks. On second thought, maybe you should just create a separate coaxial gun with the exact same properties of the original.
I just looked it up, and I noticed that the cannon barrel is not first defined on the tweak file. This confused me for a bit until I remembered there were other files besides tweak files. What you are going to have to do is in the rotationalbundle USTNK_M1A2_Barrel_Base add a new template for USTNK_M1A2_BarrelHEAP or whatever you want to call it. That is really all that needs to be done. Then you should be able to just copy the original guns code and rename it to whatever you just defined the new gun as.
You will need to make sure that the guns are set to secondary fire, otherwise they will not be able to switch. Also as I mentioned before you will need to create another separate coaxial gun so that you can change it to the primary weapon.
Djuice
07-15-2005, 03:45 PM
hrmmm, ill take a look, and thxs for the advice.
Djuice
07-15-2005, 03:51 PM
I did, what you said, and i get a CTD upon loading objects.
-=EDITED=-
errgggghh
okay i did things alot slower now, changing the coaxial gun to item id 1 and the main cannon to 2.
Effect, changing the coaxial gun to ID 1, didnt succeed, it still uses the second slot on the tank.
Changing the main cannon to id 2, removes the weapon information section on the tanks hud, and both the coaxial and main cannon fire with the alt-fire key. Need to press "F" weapon switching to fire either one of them.
adding a new ObjectTemplate.addTemplate RUTNK_T90_cannon
cause the game to CTD upon loading a map.
upon copying the existing main cannon information, and pasting and renaming it to something else, the primary (original) barrel cannon would use the newer projectile based information instead of the original one...
This is causing me a big headache...
So if anyone can get this to work, i would be greatly appreciated.
=edited= again :(
Okay i got the coaxial gun into primary fire, and main cannon into secondary fire, now i need to figure out how to get the ObjectTemplate.addTemplate RUTNK_T90_cannon into the tweak file without it causing a CTD upon loading.
Why?!
07-15-2005, 06:35 PM
You cannot add a template to the cannon itself. If you want to put another weapon inside the Barrel open the .CON and look for this
ObjectTemplate.create RotationalBundle RUTNK_T90_Barrel_Base
ObjectTemplate.collisionPart 2
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType 3
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.geometryPart 2
ObjectTemplate.addTemplate RUTNK_T90_Barrel
Right under the RUTNK_T90_Barrel is where you want to add the next generic firearm. If I understand you correctly, you have been trying to add a weapon to a weapon, which as far I know impossible.
Also, I may have accidentaly mislead you. Itemindex simply shows which weapons go in which order when they are secondary. For example, an F-15 has two secondary weapons. The missiles and bombs. Itemindex tells that the game that the missiles are default (itemindex 1) and that the bombs are the next weapon in line (itemindex 2). The way to set whether something is primary or secondary in the first place is to edit or add this line.
ObjectTemplate.fire.fireInput PIFire
Or this line.
ObjectTemplate.fire.fireInput PIAltFire
For debugging purposes run the game in a window, it will give you a clue as to why it is not working. Add/Edit this in the shortcut for the game.
+fullscreen 0
Let me know if I missed something.
DAWG_FB
07-15-2005, 10:50 PM
hey Why?!?! i sent u a PM. if u could contact me that would be great.
Djuice
07-16-2005, 02:04 AM
yay, i got it to work thanks to you, now the only problem is the sounds, i copy pasted the sound section from the original section, but the sound does not play.. am i missing something?
DAWG_FB
07-16-2005, 03:34 AM
yay, i got it to work thanks to you, now the only problem is the sounds, i copy pasted the sound section from the original section, but the sound does not play.. am i missing something?
ROFL, are you seriously thinking that copying and pasting will make everything work? u gotta be kidding. good luck to that. :laugh:
Djuice
07-16-2005, 05:32 AM
ahhh my bad, i overlooked that place where i have rename the sounds :D
CXZAR
07-16-2005, 05:42 AM
ROFL, are you seriously thinking that copying and pasting will make everything work? u gotta be kidding. good luck to that. :laugh:
you can explain him how to do it, instead of taking that attitude, dont u think? i mean, if you know how...
Hedgemus
07-17-2005, 07:39 PM
Hey Why, awesome work.
You say you wish to be able to switch between rockets and AA missiles right? Can you set up a fake gun to occupy the primary fire slot on both sets of weapons? The gun wouldn't fire or reload so you would only have one working weapon on each weapon set. That way you can use rockets with the original Cobra hud, then swtich to AA missiles and bring up the Missile hud.
-=]MH[=-Maverick-[CL]
07-28-2005, 01:16 AM
You guys are freakn geniouses.... i would never even attempt something like that.. Nice work.
FunkyMonkey
07-28-2005, 05:47 AM
I wanted a way to switch the targeting computer on and off, and not be able to use both at the same time.
Cant you
Make sure that the default secondary has an itemindex of 1 and the alternate secondary an itemindex of 2. Also, make sure to set them both to PIAltFire.
that way you can just put nothing in the itemindex 2, as a way to "switch off" the missiles, sort of like hedgemus said, but still having your rockets as primary fire.
_Hazard_
07-28-2005, 06:38 AM
this thread makes me feel dum
Why?!
07-28-2005, 12:28 PM
Interesting that two of my old threads have resurfaced.
When I combined the two weapons, I knew I was going to lose having the targeting switchable.
At the time I was going to try what other people had been saying, to make a dummy weapon. I never really got around to it and started doing other things. The thing with coupling it with a dummy weapon is that it will still have to be secondary fire. I wanted it to originally be primary but as I found out in the thread that does not seem possible.
What previous posters have been saying should work. Unless one of these crazy hardcoded bits of mysterious destruction show up again, like in my jeeps project.
*Warning* This is not a self extracting zip, the zip contains 4 zips inside that each contain their respective files. Basic modding knowledge is required. If you are overwriting the vanilla files, make sure to BACK THEM UP.
Here are the files that are in my mod.
Rather than sort out the necessary files, I decided to just put my entire mod up for download. It changes several minor things that were made just for fun/testing. The changes are:
AA Sidewinder missiles added to Cobra, with custom AA graphic.
SP Operation Clean Sweep now has F/A-18 instead of F-15E.
F/A-18 is now equipped with 2 AG Maverick missiles instead of bombs.
All AA missiles kill any aircraft in 1 hit.
How Can you set the missiles too kill any aircraft in 1 hit with out changing damage or armour?
Kelinfox
03-22-2006, 05:36 AM
Ok yesI guess I'm somewhat of a noob, but still I amquite tired of trying to kill other helo's ive downloaded the mod and stuff and I have WinRAR if you need that but I don't know how to get it into the game, if anyone could help me with that I'd appreciate it.
Ok yesI guess I'm somewhat of a noob, but still I amquite tired of trying to kill other helo's ive downloaded the mod and stuff and I have WinRAR if you need that but I don't know how to get it into the game, if anyone could help me with that I'd appreciate it.
Well, i guess the server was down coz i couldn't download it. But i have it right now and its a Nice mod:rock: . BTW Just extract the downloaded file then extract the battlefield_server.zip. (BTW make a backup of youre own battlefield_server.zip) Copy the files one by one and put them into the battlefield_server.zip (at the directory of BF2) at the same location where you've found the files. Do this the same with the Menu_client, Menu_server, Common_client, Common_server.zip (remember to backup them just incase u've done something wrong.)
Kelinfox
03-22-2006, 02:36 PM
Thanks a lot man. Ok looks like I still can't do it you'd think i'd be ok but,it says I have the 4 new files on WinRAR then where would I extract them too, and if it helps its got the sipper little icon on thefolder.
PBAsydney
03-22-2006, 02:40 PM
Nice to see people bumping such old threads...
Kelinfox
03-22-2006, 11:01 PM
OK lookslike I got this modding stuff down but nowthe mod will either crash when Istart it or just simply not work.Help?
Why?!
04-02-2006, 02:51 PM
Oh my, massive bump.
This is completely outdated. I do not even know if BF2s first patch was out when I started doing this. It might not work simply because it is so old and hardcoded changes to the engine might have unexpected effects on the mod.
As to Bart's question above, I modified that damage table. Of course at the time I had to do it without a nice simple table like in the editor. But these days you can go into the editor and load the material mode. Just change the values for AA missiles VS Air Armor to something high enough to gurantee a 1 hit kill and thats it.
Skwurl
04-10-2006, 06:25 PM
Oh this is sweet.
Question, how did you make your own HUD? Are you actually using a graphic editor are are just copying and pasting aircraft HUDS into the chopper HUD?
Also, Do you think it would be possible to allow the pilot to fire the main cannon? That would be ulitmate destruction.
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.