guns configuration

For topics related to the creation of simulation objects (SimObjects). This includes development of aircraft, ground, and maritime vehicles.
Post Reply
Luiscarlossb28
Posts: 6
Joined: Mon Jul 19, 2021 12:31 pm

guns configuration

Post by Luiscarlossb28 »

Good afternoon

I request your help dueto i try to incorporate a gun into an airplane but it does not work , I request your collaboration to resolve this problem.
i send you the information that i have:

this problem is directly with gun

Aircraft.cfg - Archive

[fltsim.0]
title=aiplane C10 v1
sim=airplane C10
model=c10limpio
panel=
sound=
texture=oil
checklists=
ui_manufacturer=Beechcraft
ui_type= C10, Limpio
ui_variation=Beechcraft, Baja Visibilidad
visual_damage=1
atc_heavy=0
atc_id=FAC3046
atc_airline=Beechcraft
atc_flight_number=beech3046
atc_id_color=0000000000
weapon_loadout=Basic Weapons
gun_loadout=





Attachments - archive
<?xml version="1.0" encoding="UTF-8"?>

<SimBase.Document Type="AceXML" version="1,0">

<Attachments.Stations>
<Station PositionOffset="-1.20000, -16.7000, 1.00000" OrientationOffset="0.0, 0.0, 0.0" StationDescription="Weapon Left" /> <!--00-->
<Station PositionOffset="-1.20000, 16.7000, 1.00000" OrientationOffset="0.0, 0.0, 0.0" StationDescription="Weapon Right" /> <!--01-->
<Station PositionOffset="-1.20000, -14.7000, 1.00000" OrientationOffset="0.0, 0.0, 0.0" StationDescription="Weapon Left" /> <!--00-->
<Station PositionOffset="-1.20000, 14.7000, 1.00000" OrientationOffset="0.0, 0.0, 0.0" StationDescription="Weapon Right" /> <!--01-->
<Station PositionOffset="-1.20000, -11.7000, 1.00000" OrientationOffset="0.0, 0.0, 0.0" StationDescription="Weapon Left" /> <!--00-->
<Station PositionOffset="-1.20000, 11.7000, 1.00000" OrientationOffset="0.0, 0.0, 0.0" StationDescription="Weapon Right" /> <!--01-->
</Attachments.Stations>

<Attachments.Loadouts>
<Attachments.Loadout LoadoutTitle="Basic Weapons" LoadoutType="WEAPON">
<Attachment StationIndex="0" ObjectTitle="AIM-120_AMRAAM" Quantity="1" />
<Attachment StationIndex="1" ObjectTitle="AIM-120_AMRAAM" Quantity="1" />
<Attachment StationIndex="2" ObjectTitle="AIM-9M_Sidewinder" Quantity="1" />
<Attachment StationIndex="3" ObjectTitle="AIM-9M_Sidewinder" Quantity="1" />
<Attachment StationIndex="4" ObjectTitle="AIM-9M_Sidewinder" Quantity="1" />
<Attachment StationIndex=" 5" ObjectTitle="GBU-32_JDAM" Quantity="1" PylonTitle="pylon_sidebyside"/>
</Attachments.Loadout>
</Attachments.Loadouts>

</SimBase.Document>





Gunsystem - archive

<?xml version="1.0" encoding="UTF-8"?>

<SimBase.Document Type="AceXML" version="1,0">

<GunSystem.GunDefinitions>
<GunDefinition ObjectTitle="M-61_Vulcan" GunType="Gatling" Ammunition="20 x 102 mm HEI" Stationary="FALSE">
<GunFeatures Caliber="0.787402" RateOfFire="6000" MuzzleVelocity="3450" />
<GunMovement PitchMax="15.0" PitchAccelerationTime="2.0" PitchTurnRate="6.0" HeadingMax="15.0" HeadingAccelerationTime="2.0" HeadingTurnRate="6.0" />
<GunEffect EffectName="fx_F16_M61_Vulcan" GunEffectType="FIRE" />
</GunDefinition>
</GunSystem.GunDefinitions>

<GunSystem.RoundDefinitions>
<RoundDefinition ObjectTitle="20 x 102 mm HEI (ballistic table)" Weight="0.220462" Caliber="0.787402" DragCf="0.1" TracerRatio="4" DamagePoints="1" Lifetime="3">
<RoundEffect EffectName="fx_tracer_m" RoundEffectType="TRACER" />
<RoundEffect EffectName="fx_dirtspray_s" RoundEffectType="IMPACT_LAND" />
<RoundEffect EffectName="fx_wtrspray_s" RoundEffectType="IMPACT_WATER" />
<RoundEffect EffectName="fx_dirtspray_s" RoundEffectType="IMPACT_BUILDING" />
<RoundEffect EffectName="fx_dirtspray_s" RoundEffectType="IMPACT_VEHICLE" />
<RoundEffect EffectName="fx_dirtspray_s" RoundEffectType="IMPACT_VEGETATION" />
<BallisticTable>
<Row Range="0" Velocity="3450" Trajectory=" 0.0" />
<Row Range="500" Velocity="3000" Trajectory=" -10.0" />
<Row Range="1000" Velocity="2500" Trajectory=" -25.0" />
<Row Range="1500" Velocity="2000" Trajectory=" -50.0" />
<Row Range="2500" Velocity="1000" Trajectory="-120.0" />
</BallisticTable>
<EntityTypeString>2.2.225.2.2.8.0</EntityTypeString>
</RoundDefinition>
</GunSystem.RoundDefinitions>

</SimBase.Document>
Clifton Crane
Lockheed Martin
Posts: 1207
Joined: Tue Sep 25, 2012 2:34 pm

Re: guns configuration

Post by Clifton Crane »

Hi Luiscarlossb28,

It looks like you are missing the gun loadout in the attachments.xml file. Also, your aircraft.cfg gun_loadout section will also need to match the title of the gun loadout in attachments.xml file.

Our default F-16C ships with a gun loadout. You can locate it in your SimObjects\Airplanes\F-16C directory. The name of the gun loadout is "Right Internal Mount". You should see this title referenced in both the aircraft.cfg and the attachments.xml.

Regards,
Clifton
Clifton Crane
Prepar3D® Software Engineer Sr.
Luiscarlossb28
Posts: 6
Joined: Mon Jul 19, 2021 12:31 pm

Re: guns configuration

Post by Luiscarlossb28 »

good morning

I continue doing the exercises but the guns and the countermeasures do not work for me. Could you help me, thanks.


aircraft.cfg


[fltsim.0]
title=Mooney Bravo
sim=Mooney_Bravo
model=
panel=
sound=
texture=0
kb_checklists=Mooney_Bravo_Check
kb_reference=Mooney_Bravo_ref
atc_id=N123MS
ui_manufacturer="Mooney"
ui_type="Bravo"
ui_variation="White, Black"
ui_typerole="Single Engine Prop"
ui_createdby="Lockheed Martin"
description="Mooneys are built to go fast. A focus on speed seems natural for a company that at one time offered a plane powered by a Porsche engine. Although the partnership with the Germans didn't last, Mooney's commitment to speed certainly has. In keeping with this idea, Mooney has experimented with a number of "big engine" models. The Bravo is Mooney's fastest with 270 hp all the way to 25,000 ft, the Bravo can attain speeds up to 220 KTAS, making it the fastest single-engine airplane currently produced."
weapon_loadout=Basic Weapons
countermeasure_loadout=Basic Countermeasures
gun_loadout=Basic Gun



Attachments.xml


<?xml version="1.0" encoding="UTF-8"?>

<SimBase.Document Type="AceXML" version="1,0">

<Attachments.Stations>
<Station PositionOffset="-7.20000, -16.7000, -3.50000" OrientationOffset="0.0, 0.0,-90.0" StationDescription="CM Left" /> <!--00-->
<Station PositionOffset="-9.02979, -15.9482, -1.77046" OrientationOffset="0.0, 0.0, 0.0" StationDescription="Pylon 1" /> <!--01-->
<Station ModelAttachPointName="attachpt_internal_l_1" OrientationOffset="0.0,-90.0, 0.0" />
<Station ModelAttachPointName="attachpt_gun" />
<Station ModelAttachPointName="attachpt_internal_r_1" OrientationOffset="0.0, 90.0, 0.0" />
<Station PositionOffset="-9.02979, 15.9482, -1.77046" OrientationOffset="0.0, 0.0, 0.0" StationDescription="Pylon 2" />
<Station PositionOffset="-7.20000, 16.7000, -3.50000" OrientationOffset="0.0, 0.0, 90.0" StationDescription="CM Right" />
</Attachments.Stations>

<Attachments.Loadouts>
<Attachments.Loadout LoadoutTitle="Basic Weapons" LoadoutType="WEAPON">
<Attachment StationIndex=" 1" ObjectTitle="GBU-32_JDAM" Quantity="2" PylonTitle="pylon_sidebyside"/>
<Attachment StationIndex=" 2" ObjectTitle="AIM-120_AMRAAM" Quantity="1" />
<Attachment StationIndex=" 4" ObjectTitle="AIM-120_AMRAAM" Quantity="1" />
<Attachment StationIndex=" 5" ObjectTitle="GBU-32_JDAM" Quantity="2" PylonTitle="pylon_sidebyside"/>
</Attachments.Loadout>
<Attachments.Loadout LoadoutTitle="Basic Countermeasures" LoadoutType="COUNTERMEASURE">
<Attachment StationIndex=" 0" ObjectTitle="Flare" Quantity=" 10" />
<Attachment StationIndex=" 6" ObjectTitle="Flare" Quantity=" 10" />
</Attachments.Loadout>
<Attachments.Loadout LoadoutTitle="Extra Countermeasures" LoadoutType="COUNTERMEASURE">
<Attachment StationIndex=" 0" ObjectTitle="Flare" Quantity=" 20" />
<Attachment StationIndex=" 6" ObjectTitle="Flare" Quantity=" 20" />
</Attachments.Loadout>
<Attachments.Loadout LoadoutTitle="Basic Gun" LoadoutType="GUN">
<Attachment StationIndex=" 3" ObjectTitle="M-61_Vulcan" Quantity="400" />
</Attachments.Loadout>
</Attachments.Loadouts>

<Attachments.Pylons>
<Attachments.Pylon PylonTitle="pylon_sidebyside">
<PylonPoint PositionOffset="0.0, -1.0, -2.10" OrientationOffset="0.0, 0.0, 0.0" />
<PylonPoint PositionOffset="0.0, 1.0, -2.10" OrientationOffset="0.0, 0.0, 0.0" />
</Attachments.Pylon>
</Attachments.Pylons>

<Attachments.WeaponSelectorTypes>
<WeaponSelectType Type="NONE" />
<WeaponSelectType Type="AAM" />
<WeaponSelectType Type="GBU" />
</Attachments.WeaponSelectorTypes>

</SimBase.Document>
Clifton Crane
Lockheed Martin
Posts: 1207
Joined: Tue Sep 25, 2012 2:34 pm

Re: guns configuration

Post by Clifton Crane »

Hi Luiscarlossb28,

Which version of Prepar3D are you using (Academic, Professional, or Professional Plus)? Weapons are only available in the Professional Plus version.

It looks like your gun is on station 3, which is an attach point based station. This would require the model to have the attach point built in. The Mooney Bravo model does not have this attach point.

If you don't have access to the model source, you can use offsets in the Attachments.xml to position the stations. You can see this being done for the first station, CM Left.

You may also want to add the WeaponsGauge to your panel.cfg. This would allow you to see the loadouts, select stations, and enable or disable the different systems. You can use our default F-16 as reference.

Additionally, you may want to try enabling Content Error Reporting in Settings > General. This will create a ContentErrorReport.txt file in your Documents\Prepar3D v5 Files directory which may provide additional information why things are failing to load.

Regards,
Clifton
Clifton Crane
Prepar3D® Software Engineer Sr.
Luiscarlossb28
Posts: 6
Joined: Mon Jul 19, 2021 12:31 pm

Re: guns configuration

Post by Luiscarlossb28 »

Good afternmoon

The version I have is prepare professional pluss 5.3.17


I am doing tests with this plane in order to modify the developments themselves

If you don't have access to the model source -------When you talk about this, what do you mean? or how can i do it



ContentErrors.txt
[error.0]
error=ModelAttachPointName (attachpt_gun) defined in Attachments.xml, but not found on owner model.
vehicle=Mooney Bravo
loadout=Basic Gun

[error.1]
error=ModelAttachPointName (attachpt_internal_l_1) defined in Attachments.xml, but not found on owner model.
vehicle=Mooney Bravo
loadout=Basic Weapons

[error.2]
error=ModelAttachPointName (attachpt_internal_r_1) defined in Attachments.xml, but not found on owner model.
vehicle=Mooney Bravo
loadout=Basic Weapons

Thank you for your cooperation
Clifton Crane
Lockheed Martin
Posts: 1207
Joined: Tue Sep 25, 2012 2:34 pm

Re: guns configuration

Post by Clifton Crane »

Hi Luiscarlossb28,

The model source is the original 3dsMax .max file. We ship a couple examples in the SDK, however all of the SimObject models are compiled to MDL file using XtoMDL. Attachpoints are created in the 3dsMax file, which are then compiled into MDL. You cannot add attachpoints to an MDL file without the original .max file.

As alternative, in your Attachments.xml you can use PositionOffset rather than ModelAttachPointName to position the station if you are unable to edit the model.

Regards,
Clifton
Clifton Crane
Prepar3D® Software Engineer Sr.
Luiscarlossb28
Posts: 6
Joined: Mon Jul 19, 2021 12:31 pm

Re: guns configuration

Post by Luiscarlossb28 »

best regard

I have a gun configured, it works normally, but my model has 2 machine guns, how can I attach another one and have them fire at the same time?
----------------------------------------------------
aircraft.cfg
-----------------------------------------------------
[fltsim.0]
title=ov
sim=uvr
model=limpio
panel=
sound=
texture=jun
checklists=
ui_manufacturer=emb
ui_type=Limpio
ui_variation=Baja Visibilidad
visual_damage=1
description=
atc_heavy=0
atc_id=2565
atc_airline=embr
atc_flight_number=5036
atc_id_color=0000000000
weapon_loadout=Basic Weapons
gun_loadout=Basic Gun
gun_loadout=Basic Gun2
countermeasure_loadout=Basic Countermeasures
-------------------------------------------------------------------------
Attachments
-----------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>

<SimBase.Document Type="AceXML" version="1,0">

<Attachments.Stations>
<Station PositionOffset="-17.20000, -11.8000, -4.20000" OrientationOffset="0.0, 0.0, 0.0" StationDescription="Weapon Left" /> <!--00-->
<Station PositionOffset="-17.20000, 8.8000, -4.20000" OrientationOffset="0.0, 0.0, 0.0" StationDescription="Weapon Right" /> <!--01-->
<Station PositionOffset="-5.00000, 7.0000, -3.00000" OrientationOffset="0.0, 0.0, 0.0" StationDescription="Weapon Right" /> <!--02-->
<Station PositionOffset="-5.00000, -7.0000, -3.00000" OrientationOffset="0.0, 0.0, 0.0" StationDescription="Weapon Right" /> <!--03-->
<Station PositionOffset="3.00000, -2.0000, -2.90000" OrientationOffset="0.0, 0.0, 0.0" StationDescription="Weapon Right" /> <!--04-->
<Station PositionOffset="3.00000, 2.0000, -2.90000" OrientationOffset="0.0, 0.0, 0.0" StationDescription="Weapon Right" /> <!--05-->
<Station PositionOffset="8.00000, -2.0000, -2.90000" OrientationOffset="0.0, 0.0, 0.0" StationDescription="attachpt_gun" /> <!--06-->
<Station PositionOffset="5.00000, -1.0000, -2.90000" OrientationOffset="0.0, 0.0, 0.0" StationDescription="flare" /> <!--07-->
<Station PositionOffset="5.00000, -1.0000, -2.90000" OrientationOffset="0.0, 0.0, 0.0" StationDescription="Chaff" /> <!--08-->
<Station PositionOffset="5.00000, -1.0000, -2.90000" OrientationOffset="0.0, 0.0, 0.0" StationDescription="flare" /> <!--09-->
<Station PositionOffset="5.00000, -1.0000, -2.90000" OrientationOffset="0.0, 0.0, 0.0" StationDescription="Chaff" /> <!--10-->

</Attachments.Stations>

<Attachments.Loadouts>
<Attachments.Loadout LoadoutTitle="Basic Weapons" LoadoutType="WEAPON">
<Attachment StationIndex="0" ObjectTitle="Python-5" Quantity="1" PylonTitle="pylon_medium_underwing" />
<Attachment StationIndex="1" ObjectTitle="Python-5" Quantity="1" PylonTitle="pylon_medium_underwing" />
<Attachment StationIndex="2" ObjectTitle="Derby" Quantity="1" />
<Attachment StationIndex="3" ObjectTitle="Derby" Quantity="1" />
<Attachment StationIndex="4" ObjectTitle="GBU-12_Paveway" Quantity="1" />
<Attachment StationIndex="5" ObjectTitle="GBU-12_Paveway" Quantity="1" />
</Attachments.Loadout>
<Attachments.Loadout LoadoutTitle="Basic Gun" LoadoutType="GUN">
<Attachment StationIndex=" 6" ObjectTitle="M-61_Vulcan" Quantity="511" />

</Attachments.Loadout>
<Attachments.Loadout LoadoutTitle="Basic Countermeasures" LoadoutType="COUNTERMEASURE">
<Attachment StationIndex="7" ObjectTitle="Defensive Flare" Quantity=" 15" />
<Attachment StationIndex="8" ObjectTitle="Chaff" Quantity=" 15" />
<Attachment StationIndex="9" ObjectTitle="Chaff" Quantity=" 15" />
<Attachment StationIndex="10" ObjectTitle="Defensive Flare" Quantity=" 15" />
</Attachments.Loadout>
</Attachments.Loadouts>




<Attachments.Pylons>
<Attachments.Pylon PylonTitle="pylon_heavy_underwing">
<PylonPoint ModelAttachPointName="attachpt_0"></PylonPoint>
</Attachments.Pylon>

<Attachments.Pylon PylonTitle="pylon_heavy_underwing">
<PylonPoint ModelAttachPointName="attachpt_0"></PylonPoint>
</Attachments.Pylon>

<Attachments.Pylon PylonTitle="pylon_medium_underwing">
<PylonPoint ModelAttachPointName="attachpt_0"></PylonPoint>
</Attachments.Pylon>

<Attachments.Pylon PylonTitle="pylon_medium_underwing">
<PylonPoint ModelAttachPointName="attachpt_0"></PylonPoint>
</Attachments.Pylon>

</Attachments.Pylons>
</SimBase.Document>

-------------------------------------------------------------------------------------------
GunSystem
------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>

<SimBase.Document Type="AceXML" version="1,0">

<GunSystem.GunDefinitions>
<GunDefinition ObjectTitle="M-61_Vulcan" GunType="Gatling" Ammunition="20 x 102 mm HEI" Stationary="FALSE">
<GunFeatures Caliber="0.787402" RateOfFire="6000" MuzzleVelocity="3450" />
<GunMovement PitchMax="15.0" PitchAccelerationTime="2.0" PitchTurnRate="6.0" HeadingMax="15.0" HeadingAccelerationTime="2.0" HeadingTurnRate="6.0" />
<GunEffect EffectName="fx_F16_M61_Vulcan" GunEffectType="FIRE" />
</GunDefinition>
</GunSystem.GunDefinitions>

<GunSystem.RoundDefinitions>
<RoundDefinition ObjectTitle="20 x 102 mm HEI" Weight="0.220462" Caliber="0.787402" DragCf="0.1" TracerRatio="4" DamagePoints="1" Lifetime="10">
<RoundEffect EffectName="fx_dirtspray_s" RoundEffectType="IMPACT_LAND" />
<RoundEffect EffectName="fx_wtrspray_s" RoundEffectType="IMPACT_WATER" />
<RoundEffect EffectName="fx_tracer_m" RoundEffectType="TRACER" />
<EntityTypeString>2.2.225.2.2</EntityTypeString>
</RoundDefinition>
</GunSystem.RoundDefinitions>

</SimBase.Document>
Post Reply