Jump to content
Sign in to follow this  
cdr

2 Muzzles 1 Gun

Recommended Posts

Hi all

First time putting something into Arma, so you'll have to go easy on this 'ere lad.

Having a little bit of an 'issue' with my FW190. Everything was going swimmingly until it came to add weapons. After much searching, I eventually got the muzzleflashes etc working, but then I hit a brick wall.

Trying to get the machine gun to fire from the two barrels that the 190 has on the wings. Adding the "memoryPointGun" line (with the appropriately named Memory Point in the Memory LOD), was great for getting the thing to fire from where I wanted to - but only on one side (the side the Memory Point was placed). I figured that there was no way to do it, until I remembered that the Littlebird has 'two' fire points for its single machine gun. So I gutted that 'bird and found what I thought was the relevant sections and added it to my config. It fires, but alas, from a single point (the centre of the model).

config.cfg

// DEFINE SECTION //////////////
#define private    0
#define protected  1
#define public     2
#define true    1
#define false    0

// CfgPatches //////////////////////////
class CfgPatches
{
   class fw190
       {
       units[] = {fw190};
       weapons[] = {};
       requiredVersion = 1.00;    
   };
};

// CfgVehicles //////////////////////////////
class CfgVehicles
{
   class All {};
   class AllVehicles: All {};
   class Air: AllVehicles {};
   class Plane: Air {};

   class fw190: Plane
   {
       scope=public;
       expansion =1;
       side=1;
       faction = "BIS_US";
       displayName="FW190";
       model="\fw190\fw190";

       accuracy=0.30;
       gearRetracting = true; 
       nameSound="plane";
       maneuvrability=150.0;
       maxSpeed=523;
       armor=30;

       aileronSensitivity = 0.8;         
       elevatorSensitivity = 0.3;        
       noseDownCoef = 0.05;            
       landingAoa = 7*3.1415/180;
       landingSpeed = 180;
       brakeDistance=300;             // vehicle movement precision
       steerAheadSimul=1.0;
       steerAheadPlan=2.0;
       transportSoldier=0;
       crew = US_Soldier_Pilot_EP1;
       driverAction = A10_Pilot;
       castDriverShadow = false;
       insideSoundCoef = 1;
       gunAimDown = 0.030000;
       extCameraPosition[]={0,3,-10};        // 0,5,-30 is standard Air class 

       // Weapon and ammo
       weapons[] = {
               "TwinM134"
       };
       magazines[] = {
               "4000Rnd_762x51_M134"
       };
       gunBeg[] = {
               "muzzle_1", "muzzle_2"
       };
       gunEnd[] = {
               "chamber_1", "chamber_2"
       };

   };
};

// CfgNonAIVehicles /////////////////////
class CfgNonAIVehicles
{
   class ProxyWeapon {};
   class ProxyTwinM134: ProxyWeapon {};

};

model.cfg

class CfgSkeletons
{
   //skelRefClass
   class Plane;

   //skelClass1
   class fw190:Plane
   {

       isDiscrete=1;
       skeletonInherit = "";
       skeletonBones[]=
       {

           "fw190","",
           "vrtule","fw190",
           "b_wheel","fw190",
           "Canopy_glass","",
           "elev","fw190",
           "l_aeler","fw190",
           "r_aeler","fw190",
           "rudder","fw190",
           "gear_1","fw190",
           "l_wheel","gear_1",
           "gear_1_1","gear_1",
           "gear_2","fw190",
           "r_wheel","gear_2",
           "gear_2_2","gear_2",
           "zasleh",""
       };
   };
   //skelClass2

};
class CfgModels
{
   class Default
   {
       sectionsInherit = "";
       sections[] = {};
   };

   //modelRefClass

   //modelClass1
   class fw190:Default
   {

       sectionsInherit = "";
       sections[] = 
       {"vrtule","vrtule staticka","vrtule blur", "zasleh"};
       skeletonName = "fw190";
       class Animations
       {
           class prop
           {
               type = "rotation";
               source = "rotor";
               memory=1;
               sourceAddress="loop";
               minValue=0.00;
               maxValue=1.00;
               angle0= "rad 0";
               angle1= "rad 360";
               selection="vrtule";
               axis="osa vrtule";

           };

           class gear_1
           {
               type = "rotation";
               source="gear";
               selection="gear_1";
               axis="gear_1_axis";
               angle0=1.3;
               angle1=0;
           };

           class gear_1_1
           {
               type = "rotation";
               source="gear";
               selection="gear_1_1";
               axis="gear_1_1_axis";
               angle0=-2.1;
               angle1=0;
           };


           class gear_2
           {
               type = "rotation";
               selection="gear_2";
               axis="gear_2_axis";                
               source="gear";
               angle0=-1.3;
               angle1=0;
           };

           class gear_2_2
           {
               type = "rotation";
               source="gear";
               selection="gear_2_2";
               axis="gear_2_2_axis";
               angle0=2.2;
               angle1=0;

           };

           class b_wheel
           {
               type = "rotation";
               source = "wheel";
               memory=1;
               sourceAddress="loop";
               minValue=0.00;
               maxValue=1.00;
               angle0=0.00;
               angle1=3.141593;
               axis = "b_wheel_axis";
               selection = "b_wheel";
           };
           class l_wheel
           {
               type = "rotation";
               source = "wheel";
               memory=1;
               sourceAddress="loop";
               minValue=0.00;
               maxValue=1.00;
               angle0=0.00;
               angle1=3.141593;
               axis = "l_wheel_axis";
               selection = "l_wheel";
           };
           class r_wheel
           {
               type = "rotation";
               source = "wheel";
               memory=1;
               sourceAddress="loop";
               minValue=0.00;
               maxValue=1.00;
               angle0=0.00;
               angle1=3.141593;
               axis = "r_wheel_axis";
               selection = "r_wheel";
           };
           class elevator
           {
               type = "rotation";
               sourceAddress = "clamp";
               source = "elevator";
               memory = "true";
               minValue = -1;
                       maxValue = 1;
                       angle0 = "rad -20";
                       angle1 = "rad 20"; 
               axis = "elev_axis";
               selection = "elev";
           };
           class r_aileron
           {
               type = "rotation";
               source = "aileron";
               sourceAddress = "clamp";
               memory = "true";
               minValue = -1;
                          maxValue = 1;
                       angle0 = "rad -30";
                       angle1 = "rad 30";
               axis = "r_aeler_axis";
               selection = "r_aeler";
           };
           class l_aileron
           {
               type = "rotation";
               source = "aileron";
               sourceAddress = "clamp";
               memory = "true";
               minValue = -1;
                          maxValue = 1;
                       angle0 = "rad 30";
                       angle1 = "rad -30";
               axis = "l_aeler_axis";
               selection = "l_aeler";
           };
           class rudder
           {
               type = "rotation";
               source = "rudder";
               sourceAddress = "clamp";
               memory = "true";
               minValue = -1;
                       maxValue = 1;
                       angle0 = "rad -20";
                       angle1 = "rad 20";
               axis = "rudder_axis";
               selection = "rudder";
           };
           //animsfw190
       };
   };

};

Now, in the memory lod, I have points called muzzle_1, muzzle_2, chamber_1 , chamber_2 as per the Littlebird config and then the rest of the lods are just the standard ones for getting animations on the gear, prop, control surfaces etc.

th_memlod.jpg

I am as stuck as Steve the Sparrow who flew into the glue factory and ended up inside one of the vats.

Sorry for the long post, and any help would be gratefully appreciated (you'd also keep my barber in business, as I might actually have some hair left).

Share this post


Link to post
Share on other sites

i guess this belongs to the "no turret on airplane" problem. helicopters can have multiple turrets, and therefor multiple defined muzzles/muzzleflashes, airplanes cant. workaround i used is to change the weaponsclass to be rocketbased instead of shellbased. defining my own rockets, with values as the bullets would have and defining the tracer model as rocket. this way i could also add a little missilesmoke which looks pretty cool when firing. Rockets allow 2 firingpositions. using this workaround muzzleflashes won´t work, but they can be easily made as useranimation. maybe also take a look at the_few mod from csj, he has real mg´s firing using a scripted solution, think he spawns a bullet for everyone fired.

Share this post


Link to post
Share on other sites

Thanks for the replies guys - got it squared away with scripts and whatnot.

She's almost done, just need to add some sounds / bomb / tweak some stuff here and there and it'll be good to go. Although it was initially done as a 'proof of concept' type thing (wanted to start off with something small prior to trying to put my Lanc in), I might release it - depends on whether the finished plane is of a high enough standard.

Thought I'd brighten up this thread with some pics;

Render of the 190;

th_peace_at_last.jpg

And some in-game shots;

th_4.jpgth_3.jpg

th_2.jpgth_1.jpg

Share this post


Link to post
Share on other sites

Helicopter class with no turret allows 2 muzzles (ie Littlebird with miniguns), but effect didn't seem to be transferable to any other vehicle class.

The Littlebird has two muzzles defined in the p3d, its not a script trick.

Share this post


Link to post
Share on other sites

Sorry but I couldn't help but laugh at the thread title. :p

Carry on! ;)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×