Jump to content
Sign in to follow this  
TheRedBaron

weapon animation?

Recommended Posts

ok, Im making a gattling gun and I want the four barrels to rotate when i turn it on. Im just not quit sure how to do this in my config. The model has the two point axis called barrels_axis and the barrels are called...well barrels. I want to have an action to start the barrels rotating and an action to stop the barrels from rotating,or if possible to rotate the barrels while firing. Here is the config ,I have the barrels set up to rotate on startup and just keep rotating because i dont know how to do the other things i mentioned. They arent rotating though.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches

{

class Terroristgat

{

units[]={Terroristgat};

weapons[]={gat};

requiredVersion=1.00000;

};

};

class CfgModels

{

class Default{};

class Weapon: Default{};

class gat : Weapon{};

};

class CfgRecoils

{

gatRecoil[]={0.002,0.002,0.005,0.005,0,0};

};

class CfgAmmo

{

class default {};

class BulletSingle: default {};

class gat: BulletSingle

{

hit=7;

indirectHit=1;

indirectHitRange=0.050000;

minRange=1;

minRangeProbab=0.100000;

midRange=50;

midRangeProbab=0.900000;

maxRangeProbab=0.050000;

cartridge="FxCartridgeSmall";

};

};

class CfgWeapons

{

class Default {};

class MGun: Default {};

class Riffle: MGun {};

class m60 : Riffle {};

class gat: m60

{

access=2;

autoReload=0;

model="\gat\gat.p3d";

displayName="gattling gun";

displayNameMagazine="gattling mag";

magazines[]={"gat"};

dexterity=1.5;

shortNameMagazine="gat";

MagazineType=32;

count=500;

initSpeed=500;

reloadTime=.010000;

magazineReloadTime=10;

picture="\gat\mp5k.pac";

drySound[]={"\gat\none.wav",0.003162,1};

modes[]={"FullAuto"};

animated=1;

          class FullAuto

{

            ammo=gat;

            multiplier=1;

            burst=1;

            displayName="gattling gun";

            dispersion=0.015000;

            soundContinuous=0;

            reloadTime=0.010000;

            ffCount=1;

            recoil=gatRecoil;

            autoFire=true;

            aiRateOfFire=1.000000;

            aiRateOfFireDistance=50;

            useAction=0;

            useActionTitle="";

reloadMagazineSound[]={"\gat\reload.wav",0.000316,1};

sound[]={"\gat\fire.wav",0.131623,0.95000};

};

class Animations

{

class ani_barrels

{

type="rotation";

animperiod=10000;

angle0=0;

angle1="-20000 * 3.141592654";

multiplyer=20;

axis="barrels_axis";

selection="barrels";

};

};

class eventhandlers

{

init="(_this select 0) animate [""ani_barrels"", 1]";

};

};

};

class CfgVehicles

{

class All{};

class AllVehicles:All{};

class Land:AllVehicles{};

class Man:Land{};

class Soldier:Man{};

class SoldierGB:Soldier{};

class Terroristgat: SoldierGB

{

access=2

displayName="Terroristgat";

weapons[]={"Throw","Put","gat"};

magazines[]={"gat","gat","gat"};

};

};

class CfgNonAIVehicles

{

class ProxyWeapon {};

class ProxyTerroristgat : ProxyWeapon {};

};

Share this post


Link to post
Share on other sites

I would start by running a sqs file from the Fired EH

that way the animation will start when the gun is fired.

]<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class EventHandlers

{

fired = "[_this select 0] exec  ""\vickers\vickersshot.sqs"";[_this select 0] exec  ""\vickers\vickersfeed.sqs"" ";

};

};

In this case the barrel doesn't turn but the bullts feeding into the gun and ejecting from the gun are animated.

vickers.jpg

I would also move this over to Breathe/Addon Config and Scripting. Might get better response.

Share this post


Link to post
Share on other sites

Thanks for the help scud, could a mode move this to Breathe/Addon Config and Scripting.

Share this post


Link to post
Share on other sites

maybe depbo the bas choppers and check out how they did their minigun barrel rotation... that should lend some clues

Share this post


Link to post
Share on other sites

well i figured it out by looking at the anaconda(revolver) from the crime city weapons pack but the barrels turn very slowly and i dont know how to speed them up rock.gif

Incase you want to know you just make an axis in the memory lod, define your rotating part in o2 and name it cylinder( i think other names will work but havent tested), then in your weapon config add in

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

revolving="cylinder";

revolvingAxis="axis";

Share this post


Link to post
Share on other sites

I think its just by shortening the animperiod

try "animperiod=5000;" it should double the speed

Share this post


Link to post
Share on other sites

Nope didnt work, I think its because its not an animation class. Maybe something like revolvingSpeed or something.

Share this post


Link to post
Share on other sites

it is all about animating static gut wich is vehicle class

animating hand gun would be real task tounge_o.gif

Share this post


Link to post
Share on other sites
maybe depbo the bas choppers and check out how they did their minigun barrel rotation... that should lend some clues

lol

I look at there scripts and they just confuse me biggrin_o.gif

Any baron, good luck on your gattling gun crazy_o.gif

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  

×