Page 1 of 3 123 LastLast
Results 1 to 10 of 28

Thread: Cartridges ejecting from static Guns

  1. #1
    Sergeant Major
    Join Date
    Apr 26 2003
    Location
    Bellingham, WA, USA
    Posts
    1,563
    Hey

    So i'm working on yet again another static machine gun and i need some major help in getting Cartridges to eject to the right of the gun each time you fire it. I'll been asking around and so far i haven't had any luck.

    I know its possible of course because BAS has already done it with there choppers as everybody already knows.

    I'm personelly not that good at addon script so....can someone please help me?

    ~Bmg

  2. #2
    Master Gunnery Sergeant
    Join Date
    Jan 7 2002
    Location
    New Zealand
    Posts
    1,088
    Hi bmgarcangel
    I'm working on that problem at the moment for the guns on the PT boat. I'm using the drop command. When I get it working properly I'll post it here or on the multigun thread.
    Cheers
    Klink
    We are now fully operational - that is, we are in a constant flap instead of having isolated confused situations.

    D.I.L.L.I.G.A.F.: Rebel Without a Pause

  3. #3
    I tried the drop command but it got abit messy on me (ended up with 1000 empties on the ground) so I switch to animation and settexture.
    Here is what I used on vickers.
    It probably sounds complicated but its not.
    I am no script wiz for sure but it seems to work.

    First put 3 empty shells animated on diff arcs and angles.
    I do this do get random effect and not same shell coming out at same angle all the time.
    start by EH fired command script runs thru once.
    Fire 1 shot get 1 shell, keep finger on trigger and shells keep coming.

    As shells eject from gun they fly for quarter second (can be adjusted) then I hide them and return they to gun.

    Bullets feed into gun in simular but more simple fashion.


    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">; Vickers eject cartridge sqs by Scud
    _vehicle = _this select 0
    _ejectbullet = &#40;random 3&#41;
    _b1 = 0
    _b2 = 0
    _b3 = 0
    ? _ejectbullet &#60;= 1 &#58; goto &#34;B1&#34;
    ? _ejectbullet &#60;= 2 &#58; goto &#34;B2&#34;
    ? _ejectbullet &#60;= 3 &#58; goto &#34;B3&#34;
    #B1
    _vehicle setobjecttexture &#91;1,&#34;&#92;vickers&#92;303.pac&#34;&#93;
    _vehicle animate &#91;&#34;ani_bullet1&#34;,1&#93;;
    _b1 = 1
    goto &#34;ejectBullets&#34;
    #B2
    _vehicle setobjecttexture &#91;2,&#34;&#92;vickers&#92;303.pac&#34;&#93;
    _vehicle animate &#91;&#34;ani_bullet2&#34;,1&#93;;
    _b2 = 1
    goto &#34;ejectBullets&#34;
    #B3
    _vehicle setobjecttexture &#91;3,&#34;&#92;vickers&#92;303.pac&#34;&#93;
    _vehicle animate &#91;&#34;ani_bullet3&#34;,1&#93;;
    _b3 = 1
    goto &#34;ejectBullets&#34;

    #ejectBullets
    ~.25
    ?&#40;_vehicle animationPhase &#34;ani_bullet1&#34; &#41; == 1 &#58; goto &#34;hide1&#34;
    ?&#40;_vehicle animationPhase &#34;ani_bullet2&#34; &#41; == 1 &#58; goto &#34;hide2&#34;
    ?&#40;_vehicle animationPhase &#34;ani_bullet3&#34; &#41; == 1 &#58; goto &#34;hide3&#34;
    exit
    #hide1
    _vehicle setobjecttexture &#91;1,&#34;&#34;&#93;
    _vehicle animate &#91;&#34;ani_bullet1&#34;,0&#93;;
    exit
    #hide2
    _vehicle setobjecttexture &#91;2,&#34;&#34;&#93;
    _vehicle animate &#91;&#34;ani_bullet2&#34;,0&#93;;
    exit
    #hide3
    _vehicle setobjecttexture &#91;3,&#34;&#34;&#93;
    _vehicle animate &#91;&#34;ani_bullet3&#34;,0&#93;;
    exit[/QUOTE]
    Every Day above ground - Is A Good Day

    Old account, now known as CSJ.

  4. #4
    Sergeant Major
    Join Date
    Apr 26 2003
    Location
    Bellingham, WA, USA
    Posts
    1,563
    Author of the Thread
    oh no...now i&#39;m really confused...i have to admit i&#39;m really bad at addon scripts because i&#39;ve never worked with them before so i might need help to get this to work....

    Now first of all, so i create like a couple shell casings and put them like on one side of the gun and then give them a certian name like c1, c2, c3, c4, c5, etc.,etc.,etc........then with the script it will make them eject and go back after a while?

    ~Bmg

  5. #5
    Master Gunnery Sergeant
    Join Date
    Jan 7 2002
    Location
    New Zealand
    Posts
    1,088
    I used a similar method using just hidden selection on several invisible cartridges which worked well. The method scud mentions above is probably the best, as the drop method is too hit and miss getting it to look right. Also for some reason the doip objects don&#39;t show up in front of any other objects that have paa textures. Not sure about pac.

  6. #6
    Sergeant Major
    Join Date
    Apr 26 2003
    Location
    Bellingham, WA, USA
    Posts
    1,563
    Author of the Thread
    Ya i figured

    But the only thing is though guys i just need help to get it to work if you guys can help me with it. Like i said i&#39;ve never done addon scripting and such....

    ~Bmg

  7. #7
    Sergeant Major
    Join Date
    Apr 26 2003
    Location
    Bellingham, WA, USA
    Posts
    1,563
    Author of the Thread
    Ok scud this is what i did. In the vehiclecfg area i messed around with a pk machien gun so i can test this out...i added this anyhow to the config:

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class bgPKmg&#58; M2StaticMGE
    {
    class reflectors {};
    displayName=&#34;PK machine gun &#40;Standing&#41;&#34;;
    picture=&#34;m2&#34;;
    model=&#34;&#92;Vis_mg&#92;pkmg.p3d&#34;;
    cost=15000;
    weapons&#91;&#93;={&#34;mpk&#34;};
    magazines&#91;&#93;={&#34;mpk&#34;};
    side=0;
    camouflage=3;
    gunnerCanSee=31;
    threat&#91;&#93;={1,0.900000,0.100000};
    crew=&#34;SoldierEB&#34;;
    armor=60;
    armorStructural=20.000000;
    icon=&#34;kulomet.paa&#34;;
    class eventhandlers
    {
    fired = _this exec {&#92;Vis_mg&#92;ShellEject.sqs};
    };
    };[/QUOTE]

    At least I added the eventhandler. Now, after that i used that one trigger you gave me and then i put it in the folder and shit.

    Then i went into o2 lite and created three shells inside the gun, then i pressed ctrl + H to hide them and i named each one Bullet1, Bullet2, or Bullet3........then i went in game and nothing is flying out...help&#33;

    ~Bmg

  8. #8
    Post your guns cpp.
    Also have you set up the animation for the bullets 1,2 & 3?
    That is in cpp and axis points in memory lod in O2.

  9. #9
    Sergeant Major
    Join Date
    Apr 26 2003
    Location
    Bellingham, WA, USA
    Posts
    1,563
    Author of the Thread
    This is my CPP. Currently only one gun, the Pkmg, is using the event handler...basically i&#39;m using it to test it out to get it working before i move on to the other guns....

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// some basic defines
    #define TEast 0
    #define TWest 1
    #define TGuerrila 2
    #define TCivilian 3
    #define TSideUnknown 4
    #define TEnemy 5
    #define TFriendly 6
    #define TLogic 7

    #define true 1
    #define false 0

    // type scope
    #define private 0
    #define protected 1
    #define public 2

    #define WeaponNoSlot 0// dummy weapons
    #define WeaponSlotPrimary 1// primary weapons
    #define WeaponSlotSecondary 16// secondary weapons
    #define WeaponSlotItem 256// items
    #define WeaponSlotBinocular 4096// binocular
    #define WeaponHardMounted 65536


    #define CanSeeRadar 1
    #define CanSeeRye 2
    #define CanSeeOptics 4
    #define CanSeeEar 8
    #define CanSeeCompass 16
    #define CanSeeAll 31

    class CfgPatches
    {
    class BGPKmg
    {
    units&#91;&#93; = {BGPKmg,BGM2mg};
    requiredVersion = 1.91;
    };
    };
    class CfgModels
    {
    class Default{};
    class Weapon&#58; Default{};
    class ***pkmga &#58; Weapon
    {
    sections&#91;&#93;= {zasleh};
    };
    class pkmg &#58; Weapon{};
    class m2p &#58; Weapon{};
    class m60m &#58; Weapon{};
    };


    class CfgAmmo
    {
    class Default {};
    class BulletSingle &#58; Default {};
    class m60mAmmo&#58; BulletSingle {
    hit=10;indirectHit=0.1;indirectHitRange=0.1;
    minRange=20;minRangeProbab=0.80;
    midRange=500;midRangeProbab=0.95;
    maxRange=3000;maxRangeProbab=0.05;
    cost=30;
    };
    class mpkAmmo&#58; BulletSingle {
    hit=21;indirectHit=0.08;indirectHitRange=0.1;
    minRange=0.2;
    minRangeProbab=0.80;
    midRange=500;
    midRangeProbab=0.95;
    maxRange=3000;
    maxRangeProbab=0.05;
    cost=200;
    };
    };

    class CfgWeapons
    {
    class Default{};
    class MGun&#58; Default{};
    class MachineGun7_6&#58; MGun{};
    class MachineGun12_7&#58; MachineGun7_6{};
    class Browning&#58; MachineGun12_7{};
    class mpk&#58; Browning
    {
    ammo=mpkAmmo;
    displayName=&#34;PK&#34;;
    displayNameMagazine=&#34;PK&#34;;
    shortNameMagazine=&#34;PK&#34;;
    visibleFire=14;
    audibleFire=24;
    visibleFireTime=2;
    cartridge=&#34;FxCartridge&#34;;
    count=650;
    sound&#91;&#93;={&#34;Weapons&#92;AK74full&#34;,db 10,1};
    *** *** *** *** *** *** *** *** *** soundContinuous=0;
    initSpeed=4900;
    aiRateOfFire=0.001; // delay between shots at given distance
    aiRateOfFireDistance=1000; // at shorter distance delay goes lineary to zero
    };
    class m60m&#58; Browning
    {
    *** ammo=m60mAmmo;
    *** displayName=&#34;M60&#34;;
    *** displayNameMagazine=&#34;M60&#34;;
    *** shortNameMagazine=&#34;M60&#34;;
    *** count=100;
    *** sound&#91;&#93;={&#34;Weapons&#92;M60mgun&#34;,3.1 62278,1};
    *** reloadSound&#91;&#93;={&#34;Weapons2&#92;M60full&# 34;,db10,1};
    *** MagazineReloadTime=6;
    *** *** *** *** *** *** *** *** *** *** soundContinuous=0;
    *** maxLeadSpeed=865;


    aiRateOfFire=0.001; // delay between shots at given distance
    aiRateOfFireDistance=1000; // at shorter distance delay goes lineary to zero
    };

    };

    class CfgVehicles
    {
    class All{};
    class AllVehicles&#58;All{};
    class Land&#58; AllVehicles{};
    class LandVehicle&#58; Land{};
    class Tank&#58; LandVehicle{}; ***
    class APC&#58; Tank{};
    class M113&#58;APC{};
    class M2StaticMG&#58; M113{};
    class M2StaticMGE&#58; M2StaticMG{};
    class bgPKmg&#58; M2StaticMGE
    {
    *** class reflectors {};
    *** displayName=&#34;PK machine gun &#40;Standing&#41;&#34;;
    *** *** *** *** *** *** *** *** *** *** picture=&#34;m2&#34;;
    *** *** *** *** *** *** *** *** *** *** model=&#34;&#92;Vis_mg&#92;pkmg.p3d&#34;;
    *** cost=15000;
    *** weapons&#91;&#93;={&#34;mpk&#34;};
    *** magazines&#91;&#93;={&#34;mpk&#34;};
    *** *** *** *** *** *** side=0;
    *** camouflage=3;
    *** gunnerCanSee=31;
    *** threat&#91;&#93;={1,0.900000,0.100000};
    *** crew=&#34;SoldierEB&#34;;
    *** armor=60;
    *** armorStructural=20.000000;
    *** icon=&#34;kulomet.paa&#34;;
    *** class eventhandlers
    *** *** ***{
    *** *** *** *** *** fired = _this exec {&#92;Vis_mg&#92;ShellEject.sqs};
    *** ***};
    };
    class m2p&#58; M2StaticMG
    {
    *** displayName=&#34;M2 &#40;Gunner Prone&#41;&#34;;
    *** *** *** *** *** *** *** *** *** picture=&#34;im113&#34;;
    *** *** *** *** *** *** *** *** *** model=&#34;&#92;Vis_mg&#92;m2p.p3d&#34;;
    *** cost=15000;
    ***class reflectors {};
    *** weapons&#91;&#93;={&#34;Browning&#34;};
    *** magazines&#91;&#93;={&#34;Browning&#34;,&#34;Brown ing&#34;,&#34;Browning&#34;};
    *** *** *** *** *** side=1;
    *** crew=&#34;HYK_USsolGLWL85&#34;;
    *** armor=60;
    *** armorStructural=20.000000;
    *** icon=&#34;kulomet.paa&#34;;
    *** gunnerAction=&#34;ManActm2pGunner&#34;;
    *** gunnerInAction=&#34;ManActm2pGunner&#34;;
    ***
    class Turret
    {
    gunAxis = &#34;OsaHlavne&#34;;
    turretAxis = &#34;OsaVeze&#34;;
    soundServo&#91;&#93;={Vehicles&#92;gun_elevate2,db-30,1.0};

    gunBeg = &#34;usti hlavne&#34;;
    gunEnd = &#34;konec hlavne&#34;;

    body = &#34;OtocVez&#34;;
    gun = &#34;OtocHlaven&#34;;

    minElev=-30;
    maxElev=+20;
    minTurn=-45;
    maxTurn=+45;
    };
    };
    class m60m&#58; M2StaticMG
    {
    *** displayName=&#34;M60 Machine Gun &#40;Prone&#41;&#34;;
    *** *** *** *** *** *** *** *** *** picture=&#34;im113&#34;;
    *** *** *** *** *** *** *** *** *** model=&#34;&#92;vis_mg&#92;m60m.p3d&#34;;
    *** cost=15000;
    ***class reflectors {};
    *** weapons&#91;&#93;={&#34;m60m&#34;};
    *** magazines&#91;&#93;={&#34;m60m&#34;,&#34;m60m&#34; ,&#34;m60m&#34;,&#34;m60m&#34;};
    *** *** *** *** *** side=1;
    *** crew=&#34;HYK_USsolGLWL85&#34;;
    *** armor=60;
    *** armorStructural=20.000000;
    *** icon=&#34;kulomet.paa&#34;;
    *** gunnerAction=&#34;ManActm60mGunner&#34;;
    *** gunnerInAction=&#34;ManActm60mGunner&#34;;
    *** modelOptics=&#34;optika_M60_MG&#34;;
    ***
    class Turret
    {
    gunAxis = &#34;osahlavne&#34;;
    turretAxis = &#34;osaveze&#34;;
    soundServo&#91;&#93;={Vehicles&#92;gun_elevate2,db-30,1.0};

    gunBeg = &#34;usti hlavne&#34;;
    gunEnd = &#34;konec hlavne&#34;;

    body = &#34;OtocVez&#34;;
    gun = &#34;OtocHlaven&#34;;

    minElev=-30;
    maxElev=+30;
    minTurn=-60;
    maxTurn=+60;
    };
    };

    };

    class CfgNonAIVehicles
    {
    class ProxyWeapon{};
    class Proxytpillbox&#58; ProxyWeapon{};
    class Proxym60m&#58; ProxyWeapon{};
    };

    class CfgVehicleActions
    {
    bgPKmgGunner=&#34;ManActM2Gunner&#34;;
    m2pGunner=&#34;LyingToBinocLying&#34;;
    m60mGunner=&#34;Crouch&#34;;
    };[/QUOTE]




  10. #10
    Sergeant Major
    Join Date
    Apr 26 2003
    Location
    Bellingham, WA, USA
    Posts
    1,563
    Author of the Thread
    @Scud: Honestly mate, i don&#39;t know what to do with the bullet part and stuff about o2 lite....i dont know where to put anything, keep in mind this is new stuff for me&#33;

    ~Bmg

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •