Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Making the bolt of a rifle return to battery

  1. #1

    Making the bolt of a rifle return to battery

    I've been having significant trouble making the bolt of a rifle animate back to battery once the casing has been expelled. There's ample time left in the animation but putting a new animation with new minValue and maxValue parameters is not working. I was wondering if anyone could point me in the right direction, or even a possible right direction.


    My inbox is fill and won't be emptied. If your PM is regarding requests to use my work, unfortunately I choose not to grant such permission. My work is for use with CWR2 only.

  2. #2
    You mean fater each shot the Bolt is not returning to the forward postion ?

    have you got a Model.cfg and the corresponding aniamtionsource in .cpp to show ?

    Offset is the big factor sometimes in these along with minval minphase IIRC .

    Is evering ok when reloading magazine ? bolt comes back and then forward on new mag (speculation here i dont know what you firing of course )

    for example using reload source for firing .

    Code:
    class bolt_begin
    			{
    				type="translation";
    				offset0=0;
    				offset1=0.5;
    				axis="bolt_axis";
    				memory=1;
    				minValue=0;
    				maxValue=0.3;
    				minPhase=0;
    				maxPhase=0.3;
    				source="reload";
    				sourceAddress=0;
    				selection="bolt";
    			};
    			class bolt_end
    			{
    				type="translation";
    				offset0=0;
    				offset1=-0.5;
    				axis="bolt_axis";
    				memory=1;
    				minValue=0.5;
    				maxValue=1;
    				minPhase=0.5;
    				maxPhase=1;
    				source="reload";
    				sourceAddress=0;
    				selection="bolt";
    			};
    Last edited by Sealife; Apr 4 2012 at 15:44. Reason: additional info

  3. #3
    The bolt 'teleports' back to the forward position when the animation is done. I do have the animations defined, but the second one isn't behaving as one would expect. I shall check out your animations.

    edit: I guess part of the problem is buldozer doesn't want to set the animation controller higher than is defined in the first animation.
    Last edited by Max Power; Apr 4 2012 at 19:51.

  4. #4
    well 6 month ago i would have said maybe another animation ( reloadmagazine perhaps if you have defined bolt back when empty magaisne or another such as last bullet ? using ISEmpty source ? ) is limiting it ,
    However recently working with bulldozer pointing to HSIM exe , i have found lots of seeming unpredictable differences between Bulldozer and "In Game"
    I have ironed some out by redefining somethings where possible and editing Binpbo cpp ( updating defines), however some anomolies are to be believed to be Impossible as i cannot find the possible .

  5. #5
    Okay, I solved the problem... and it was weird (at least in buldozer). In order to see the full animation in buldozer I had to define an animation for the values of 0 to 1 for the reload source. Then in order to get the bolt to behave properly, I had to define an offset from -0.5 to 0.5 for some reason, despite the animation running from 0 to 1.

    Code:
    class bolt_twist: Rotation
    	  {
    		source = "reload";
    		selection = "bolt";
    		axis = "bolt_axis";
    		angle0 = 0;
    		angle1 = 0;
    	  };
          class bolt_OPEN : Translation
          {
            type = "translation";
            source = "reload";
            begin = "bolt_axis_begin";
            end = "bolt_axis_end";
            selection = "bolt";
            minValue = 0.2;
    		maxValue = 0.6;
    		offset0 = -0.5;
    		offset1 = 0.5;
          };
    	  class bolt_CLOSE : Translation
    	  {
    		type = "translation";
            source = "reload";
            begin = "bolt_axis_begin";
            end = "bolt_axis_end";
    		selection = "bolt";
    		minValue = 0.61;
    		mavValue = 1.0;
    		offset0 = 1;
    		offset1 = 0;
    	  };

  6. #6
    strange isnt it ,
    i think i can without doubt state as a fact that 3monhts of my life have been spent caluclating bulldozers interpretation of what is a negative and a positive movement .

    glad you solve it .

    Hopefully it is not some sill isDiscrete probelm i have too some days , .

  7. #7
    Based on your recommendation, I decided to define the fact it's discrete explicitly and it didn't change the behaviour.

    In case anyone is interested, here is the config I settled on. Note that the boltOffset define will vary depending on what other animations you have acting on the bolt.

    Code:
    	  #define boltOffset -1.15
          class bolt_OPEN : Translation //fast
          {
            type = "translation";
            source = "reload";
    		//sourceAddress = "loop";
            //axis = "bolt_axis";
            begin = "bolt_axis_begin";
            end = "bolt_axis_end";
            selection = "bolt";
            minValue = 0.2;
    		maxValue = 0.30;
    		offset0 = 0 + boltOffset;
    		offset1 = 0.65 + boltOffset;
          };
    	  class bolt_OPEN2 : bolt_OPEN //slow
          {
            selection = "bolt";
            minValue = 0.31;
    		maxValue = 0.5;
    		offset0 = 0.66 + boltOffset;
    		offset1 = 1 + boltOffset;
          };
    	  class bolt_CLOSE : Translation //slow
    	  {
    		type = "translation";
            source = "reload";
            begin = "bolt_axis_begin";
            end = "bolt_axis_end";
    		selection = "bolt";
    		minValue = 0.51;
    		mavValue = 0.80;
    		offset0 = 1;
    		offset1 = 0.66;
    	  };	  
    	  class bolt_CLOSE1 : bolt_CLOSE //fasy
    	  {
    		minValue = 0.81;
    		mavValue = 1.0;
    		offset0 = 0.65;
    		offset1 = 0;
    	  };


    ---------- Post added at 15:46 ---------- Previous post was at 14:41 ----------

    Now I'm running into the problem where, in the hands of the AI, these weapon animations don't animate properly, so I can't really film what I've done.

    The animation seems to only sample at certain intervals. In this case, the bolt appears not to open. In the case of my reload animation, the charging handle appears only to be drawn back half way in one frame.

  8. #8
    I have discovered that the reason for my confusion is these animations are relative, not absolute.

  9. #9
    I have discovered that the reason for my confusion is these animations are relative, not absolute
    Care to explain a little more please ?
    I understand the Terms but not in this Context,usualy this would indicate the animations are moving from a named point rather that just simply moving on a plane from there origin , however you seem to be saying that AI in control is given a less priority when anims are concerned maybe ?

    or maybe im totally out

  10. #10
    Oh, whoops. No, what I meant was that my initial problem was that I was animating them absolutely rather than relatively, which was netting strange results. The AI thing I have no idea about. To go from a to b, I was going from 0 to 1, and to go from b to a, I was going from 1 to 0. That was making some weird behaviour but I noticed that if I massaged it I could get it to behave, so I created a bolt offset to help me zero in on the number. But, in the end, I realized what I was supposed to be doing was animating a to b from 0 to 1 and b to a from 0 to -1.
    Last edited by Max Power; Apr 23 2012 at 23:01.

Page 1 of 2 12 LastLast

Similar Threads

  1. Dead Battery?
    By mmikerhodes in forum TAKE ON HELICOPTERS - TROUBLESHOOTING
    Replies: 3
    Last Post: Dec 17 2011, 11:13
  2. Making Support Units return to original position?
    By soldier2390 in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 2
    Last Post: Sep 13 2011, 18:55
  3. Handgun reloading bug with bolt rifle as main weapon
    By Celery in forum ARMA 2 & OA - TROUBLESHOOTING
    Replies: 1
    Last Post: Jan 4 2011, 18:18
  4. SAM battery
    By b1sh0p in forum ARMA - MISSION EDITING & SCRIPTING
    Replies: 1
    Last Post: Jun 14 2007, 08:12
  5. Battery
    By SpecOp9 in forum ADDONS & MODS: COMPLETE
    Replies: 73
    Last Post: Jan 8 2004, 05:50

Posting Permissions

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