simba 0 Posted October 22, 2007 hi all, I'm trying to animate a turret to simulate somehow the recoil on a machinegun, this isn't the main turret but the second one. here are the relevant parts : cfgvehicle : <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class AnimationSources { class recoilPK1 { source = "reload"; weapon = RHS_PK1; }; class changeMagPK1 { source = "reloadMagazine"; weapon = RHS_PK1; }; }; cfgmodel : Quote[/b] ]class recoilBackw { type="translation"; source="recoilPK1"; selection="gatling_1"; axis="gatling_2_axis"; minValue=0; maxValue="0.5"; offset0=0.000000; offset1=0.250000; }; class recoilForw : recoilBackw { minValue=0.5; maxValue="1"; offset0=0.000000; offset1=-0.450000; }; class hideMagPk1 { type="hide"; source="changeMagPK1"; selection="pk1Mag"; hidevalue=0.1; }; If I understand correctly, every time the gun reloads (not the mag but the gun chamber), animation should be played. minvalue and maxvalue parameters represents the timing of the animation, in this case each time the gun reloads "recoilBackw " then "recoilForw" should be played and this in one reload of the chamber. My problem is that everyhing works perfecly except that the minvalue and maxvalue correspond to the magazine state and not the gunreload state, in clear it means that during the first half of the magazine it will play recoilForw and for the other half it's gonna be recoilBackw. So instead of having a gun that quicly recoils forward then backward, I'm gonna have a gun that recoils many times forward then as much backward. An other thing is that the magazine doesn't dissapear at magazine reload, however the animation works perfecly it's just the controller that seems to be unable to do his job. I know this could be done via "fired" eventhandler, but doing this direcly in cfgmodel is always better. An other solution is to simply make to anim that automatically returns to initial state, again I didn't find any way to achieve this. any help is welcome ! simba Share this post Link to post Share on other sites
simba 0 Posted October 22, 2007 not 100% sure about that, but it seems that fired eventhandler doesn't detect ammo from secondary turret. edit : no it works Share this post Link to post Share on other sites