Jump to content
Sign in to follow this  
Alwarren

Custom reload gestures

Recommended Posts

Hi everybody.

I am looking into fixing an issue with my M4's: in short, if I pull them up all the way to the shoulder none of the reload gestures works. I was considering doing my own, but if I am honest, I don't even have the slightest idea how that would work. Can anybody point me into the right direction? Would be very much appreciated.

Thanks!

Share this post


Link to post
Share on other sites

Can you be a bit more specific, do the animations not play at all, or do they go a bit doolally?

Share this post


Link to post
Share on other sites
Can you be a bit more specific, do the animations not play at all, or do they go a bit doolally?

No, I am talking about the reload gesture. I currently have it working just fine (see

) but the problem is there is a gap between the shoulder and the stock. If I move the weapon closer to the shoulder, the guesture doesn't fit anymore (it grabs for empty air not for the mag).

So what I want to try is make a custom gesture specifically tailored to my weapon - not for the weapon itself, but for the hand movement of the solider reloading it. However, I don't really know where to start with that.

Share this post


Link to post
Share on other sites

We can't do any custom reload gestures atm because we need some example to see how is it done and then somehow tweak or create new gestures

Share this post


Link to post
Share on other sites

The custom reload Gesture should ony use Mask of the hands so here is the config part

http://community.bistudio.com/wiki/Arma_3_Weapon_Config_Guidelines#Custom_reload_animations

and here is 02 custom rtm turorial

http://forums.bistudio.com/showthread.php?105058-RTM-Animation-Tutorial-added&p=1712705&viewfull=1#post1712705

I havent Read tute becuase i use Ofp Anim nd thats old!! and long time to explain , however one warning , since second stable alpha if your advised in the tute to put model.cfg in the folder of RTM when Binarising , it may cause problem , i suggest you follow exactly the tute and if when you have biarised, you have an error "no entryconfig.bin.skeleton" then it maybe the model.cfg in the anim folder causing problem

Edited by Thromp

Share this post


Link to post
Share on other sites

Thanks for the help, I'll check that out.

Share this post


Link to post
Share on other sites

I'd imagine said gesture .rtm would have keyframes numbered from 0.000 to 1.000, and that you'd have to attempt to sync various actions in the animation to the model.cfg animations that use the reloadMagazine source by having keyframes with number that roughly match the minValue/maxValue vaues for those stages in the model.cfg (eg. you want the skeleton's hand on your magazine in a keyframe that matches the minvalue of the animation in your model.cfg that slides the magazine out of the magwell, and the hand holding the mag, moved down by and appropriate distance on the keyframe that matches the maxvalue of the mag-drop anim - or at least by the time your anim to hide the magazine kicks in - then the inverse for when the mag is re-inserted) - the timings for various functions on the weapon should then theoretically match what your gesture is doing.

I've got a modified version of the Arma 1 skeleton that I use for handanims, which includes proxies that you can load your weapon models onto to give an idea of where hands need to be at various points during the gesture:

Modified skeleton

Before you Export your new .rtm, just delete the two "proxy::..." selections from the 'named selections' box.

Might be worth loading your handanims onto the skeleton to provide your 0.000 and 1.000 starting and ending positions - naturally you'd want the hands to begin in the 'normal' shooting stance at 0.000 before moving to the magazine to perform the reload, then end up back in the same stance once the reload was complete at 1.000.

Dare say you need a lot more keyframes in between to get the transitions between various hand positions and articulation of the fingers to look nice, but I think syncing the .rtm to the model.cfg will be the major discipline in making a decent reload gesture.

Without an example or some advise from Vespa though it's not clear whether the gesture only uses the hands (like handanim), or whether it's required to animate the whole arms and other bones, but I'd give it a go with just the hands like Thromp suggests, and hope the IK system can handle the rest. It's all a bit of trial and error in this dark art at the moment I think! :D

Edited by da12thMonkey

Share this post


Link to post
Share on other sites

THe mask appears to be same for the Gesture i believe , but confirmation is always good :)

mask = "handsWeapon";

For Syncing See Kiorys example(if you dont have your own yet of course) and tweak the Reload_1 and _2 in his model.cfg to your own anim should be quickest way to get a good timing

Share this post


Link to post
Share on other sites
I'd imagine said gesture .rtm would have keyframes numbered from 0.000 to 1.000, and that you'd have to attempt to sync various actions in the animation to the model.cfg animations that use the reloadMagazine source by having keyframes with number that roughly match the minValue/maxValue vaues for those stages in the model.cfg (eg. you want the skeleton's hand on your magazine in a keyframe that matches the minvalue of the animation in your model.cfg that slides the magazine out of the magwell, and the hand holding the mag, moved down by and appropriate distance on the keyframe that matches the maxvalue of the mag-drop anim - or at least by the time your anim to hide the magazine kicks in - then the inverse for when the mag is re-inserted) - the timings for various functions on the weapon should then theoretically match what your gesture is doing.

Yeah, sounds like what I did for the M4 anims to adjust to the GestureReloadMXSniper - I actually FRAPS'ed the thing, cut out all extraneous data, and counted the frames :) It's doable that way, took almost a day of work but then, the result is matched up pretty nicely.

I've got a modified version of the Arma 1 skeleton that I use for handanims, which includes proxies that you can load your weapon models onto to give an idea of where hands need to be at various points during the gesture:

Modified skeleton

Before you Export your new .rtm, just delete the two "proxy::..." selections from the 'named selections' box.

Woa, that's nice :)

Might be worth loading your handanims onto the skeleton to provide your 0.000 and 1.000 starting and ending positions - naturally you'd want the hands to begin in the 'normal' shooting stance at 0.000 before moving to the magazine to perform the reload, then end up back in the same stance once the reload was complete at 1.000.

Sounds plausible. Althought the keyframes might also be the length of the anim... guess only way to find out is try it.

Without an example or some advise from Vespa though it's not clear whether the gesture only uses the hands (like handanim), or whether it's required to animate the whole arms and other bones, but I'd give it a go with just the hands like Thromp suggests, and hope the IK system can handle the rest. It's all a bit of trial and error in this dark art at the moment I think! :D

Well aren't we used to that in the meantime ;)

BTW, I found this in the CfgGesturesMale:

ReloadMask[] = {
"LeftShoulder", 0,1,
"LeftArm", 1,
"LeftArmRoll", 1,
"LeftForeArm", 1,
"LeftForeArmRole", 1,
"RightShoulder", 0,1,
"RightArm", 1,
"RightArmRoll", 1,
"RightForeArm", 1,
"RightForeArmRole", 1,
"weapon", 1
};

I wonder if this has anything to do with it...?

Edited by Alwarren

Share this post


Link to post
Share on other sites
THe mask appears to be same for the Gesture i believe , but confirmation is always good :)

Seems legit!

I figured it might have a bit more of the parts of the upper torso involved with the IK than handanim since the reloadgestures can do things like tilt the weapon around (the weapon 'attitude' in handanim was pretty fixed to other actions, and the IK worked relative to the weapon bone), and the gestures also seem to get less problematic when a hand moves down close to the hip and behind the unit (trying to do this with handanims in A2/OA used to cause some nasty distortions of the arms). Suppose the gestures just look more 'impressive'; like a more substantial .rtm action. Mask name suggests it's okay though :)

Sounds plausible. Althought the keyframes might also be the length of the anim... guess only way to find out is try it.

Possible, in which case you could just multiply your min/maxvalue by magazineReloadTime to get the timings, though pretty much every .rtm in the game (static or movement) as far back as Arma 1 (Arma 1 .rtm are all unbinarised so you could check those out in O2) had keyframes numbered 0 to 1 and the length on the anim is set by the config for that action - magazineReloadTime is the logical source of the timing source for such reload gestures.

IIRC though the 'speed' at which anims played also depended on the number of frames - been a while since I made a moving anim.

Edited by da12thMonkey

Share this post


Link to post
Share on other sites
Arma 1 .rtm are all unbinarised so you could check those out in O2)

thats good advice if you have Arma1 the reload.rtm is unbinned and will only take one or two slight adjustment in a few frames for your result you might get Finger missing problems but i doubt it :).

Share this post


Link to post
Share on other sites

Sorry for resurrecting this thread, but can someone explain these a bit? Where does that code go into? (http://community.bistudio.com/wiki/A...oad_animations <--- the one shown here) To the config CPP? I have ugly, test reloadanims set up for my rifle add-on. How do I change the reloadaction from the standard "MXReloadgesture" to the one made by me? Where do I put in, which reloads to use when crouched, standing or prone? The rifle is working in the editor, but I am forced to use the MX reload animation for now, and I've been looking around to see any tutorials, or information regarding my issue, but I couldn't find any. Can you help?

Share this post


Link to post
Share on other sites
Sorry for resurrecting this thread, but can someone explain these a bit? Where does that code go into? (http://community.bistudio.com/wiki/A...oad_animations <--- the one shown here) To the config CPP? I have ugly, test reloadanims set up for my rifle add-on. How do I change the reloadaction from the standard "MXReloadgesture" to the one made by me? Where do I put in, which reloads to use when crouched, standing or prone? The rifle is working in the editor, but I am forced to use the MX reload animation for now, and I've been looking around to see any tutorials, or information regarding my issue, but I couldn't find any. Can you help?

You need to add the lnie

reloadAction = "GestureReloadMXSniper";

somewhere in your class, like:

class FHQ_M4A1_BASE : Rifle_Base_F
{
   scope = protected;
   magazines[] = {
       "30Rnd_556x45_STANAG", "FHQ_30Rnd_556x45_Stanag_Tracer_Green", "FHQ_30Rnd_556x45_Stanag_Tracer_IR",
       "FHQ_30Rnd_556x45_Stanag_Tracer_Red","FHQ_30Rnd_556x45_Stanag_Tracer_Yellow"
   };
   class Library
   {
       libTextDesc = "Colt M4A1";
   };
   reloadAction = "GestureReloadMXSniper";
   // ...
};

Obviously, you need to replace GestureReloadMXSniper with something different.

Share this post


Link to post
Share on other sites

I have that in there. What I meant was how do I change the gesture to the one I made? Oh and by the way, thank you for replying, I didn't think I'd receive one this fast! :)

Share this post


Link to post
Share on other sites
I have that in there. What I meant was how do I change the gesture to the one I made?

I *think* there is a CfgGestures where you need to add your own gesture. You might want to check with the config viewer in the editor.

Oh and by the way, thank you for replying, I didn't think I'd receive one this fast! :)

You're welcome :)

Share this post


Link to post
Share on other sites

EDIT: Nevermind. Reading is such a useful skill -_-

Edited by Alwarren

Share this post


Link to post
Share on other sites

Still no luck with my own custom reload gesture. I have the following in my config.cpp:

class CfgMovesBasic
{
    class DefaultDie;
    class ManActions
    {
        FHQ_GestureReloadACR = "FHQ_GestureReloadACR";    
    };
};

class CfgGesturesMale
{
   class Default;
    class States
    {
        class FHQ_GestureReloadACR: Default
        {
            // Uses the MX reload rtm's for now to make sure it's not an error with my anim data
            file="\A3\anims_f\data\Anim\sdr\Gst\GestureReloadMX.rtm"; //file="\FHQ_Remington\ACR\data\anim\acr_reload.rtm";
            looped=0;
            speed=0.400000;
            mask="handsWeapon";
            headBobStrength=0.200000;
            headBobMode=2;
            rightHandIKBeg=1;
            rightHandIKEnd=1;
            leftHandIKCurve[]={0,1,0.050000,0,0.950000,0,1,1};
        };
    };
};

This was done according to this description.

The weapon config contains

   class FHQ_ACR_BASE : Rifle_Base_F
   {
       reloadAction = "FHQ_GestureReloadACR";
       // ...
   };

Still, the reload anim isn't played, reloading is instantaneous. I have no idea what I am doing wrong, if someone knows more I'd love to hear it :)

Share this post


Link to post
Share on other sites

Replying to myself again. This version actually works, the custom reload anim now pops up in game:

class CfgMovesBasic
{
    class DefaultDie;
    class ManActions
    {
        FHQ_GestureReloadACR = "FHQ_GestureReloadACR";    
    };

   class Actions {
       class NoActions : ManActions {
           FHQ_GestureReloadACR[] = {"FHQ_GestureReloadACR", "Gesture"};
       };
   };
};

class CfgGesturesMale
{
   class Default;
    class States
    {
        class FHQ_GestureReloadACR: Default
        {
            file="\FHQ_Remington\ACR\data\anim\acr_reload.rtm";
            looped=0;
            speed=0.400000;
            mask="handsWeapon";
            headBobStrength=0.200000;
            headBobMode=2;
            rightHandIKBeg=1;
            rightHandIKEnd=1;
            leftHandIKCurve[]={0,1,0.050000,0,0.950000,0,1,1};
        };
    };
};

The result actually looks like Carpenter's The Thing, I think I am not animating enough bones to make this appear correctly. The word for animating in O2 that comes to mind is "ARGH!" :)

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  

×