Jump to content
Ranwer135

Attaching items to hands properly - Need Help

Recommended Posts

Hey guys,

 

So I have been looking around the DayZ Standalone files on how they have done their item functionality (e.g. "Canteen bottle moves and rotates with the hand as you drink it"), and I noticed that they have separate .rtm animation files for some of the items? So the point is, how do I get an item to move and rotate with the hand like in DayZ Standalone? I already know that attachTo is an alternative, but it does not allow the attached item to rotate with the host.

 

 

Thanks,

 

 

 

Rawner135

 

 

 

Also: I am reasonably good at animating, so taking hard challenges is not a problem.  :)

Share this post


Link to post
Share on other sites

I noticed that they have separate .rtm animation files for some of the items?

Those are probably handanim files, like we have for holding weapons in Arma.

 

Looking at DayZ for a solution is probably pointless since it's a different engine and they've likely programmed the proxy positions in the character models so there are more objects types that can be held in hands beyond those in the rifle, launcher, binocular or handgun slots

  • Like 1

Share this post


Link to post
Share on other sites

Those are probably handanim files, like we have for holding weapons in Arma.

 

Looking at DayZ for a solution is probably pointless since it's a different engine and they've likely programmed the proxy positions in the character models so there are more objects types that can be held in hands beyond those in the rifle, launcher, binocular or handgun slots

 

Ok, thanks for pointing out for what they are.  :)

 

 

However, I did some searching in the ArmA 3 config viewer, and found these code commands for "CfgMovesMaleSdr":

showItemInHand = 0;
showItemInRightHand = 0;

Is there any kind of info on how to use them, or are they practically useless?  :unsure:

Share this post


Link to post
Share on other sites

Those parameters determine whether binocular/laser-designator/rangefinder type object is shown during the animation - in the left hand or right hand.

https://community.bistudio.com/wiki/CfgMoves_Config_Reference#showItemInHand

https://community.bistudio.com/wiki/CfgMoves_Config_Reference#showItemInRightHand

 

Almost certainly requires the item to have Type = 4096; to occupy the binoc inventory slot, or potentially simulation = "Binocular"; as well.

Share this post


Link to post
Share on other sites

Those parameters determine whether binocular/laser-designator/rangefinder type object is shown during the animation - in the left hand or right hand.

https://community.bistudio.com/wiki/CfgMoves_Config_Reference#showItemInHand

https://community.bistudio.com/wiki/CfgMoves_Config_Reference#showItemInRightHand

Almost certainly requires the item to have Type = 4096; to occupy the binoc inventory slot, or potentially simulation = "Binocular"; as well.

Ah, of course! That would explain why the animations used for binoculars are set to true.

However, so far (in my opinion) DayZ Standalone's engine is no where completely different to ArmA's engine. My best guess is that they have a system to check the simulation or type of the item, which then uses the appropriate animation and/or configuration. But I'll start testing out the binocular class to see if I am able to get a non-scripted item (e.g. 'waterbottle') onto the player's hands. Fingers crossed if this may be the original class they have used to build upon for their other items. :D

Share this post


Link to post
Share on other sites

Okay,

 

 

So I managed to test an item that uses the binocular slot, and so far it works brilliantly in a similar manner to the attachTo command (but moves and rotates with the hand). But as for the Canteen model which was the test item (found in Objects (Small)), its model offset and rotation is a little off. Example photo below:

 

41112103DCE3D5C55084107956118612005B2C0C

 

 

Since the model is binarized by BI, is there any way to set the model's offset and/or rotation through the config or by script?

 

 

 

Many thanks for your help,  :D

 

 

 

Rawner135

Share this post


Link to post
Share on other sites

Could you may make a new model and simply proxy in the canteen into the correct position/orientation?

Share this post


Link to post
Share on other sites

Could you may make a new model and simply proxy in the canteen into the correct position/orientation?

 

I'll try and do that, thanks! (I may want to do a canteen bottle without the cover anyway).  :D

 

 

But still, a lot of the small items the Devs added are practically useful, and it just sounds like a waste of time re-creating them when you practically have these items already available. I just wish they made a sample package so I can adjust their positions. :(

Share this post


Link to post
Share on other sites

 

So I managed to test an item that uses the binocular slot, and so far it works brilliantly in a similar manner to the attachTo command (but moves and rotates with the hand).

 

Hiya mate,

 

I'm interested to know, would you be able to post a couple of config examples of how you achieved this? E.g., what did you add to the animation config, and what to the object config? ShowItemInHand and ItemInRightHand etc.? Thanks ever so much! :D

 

I got it working with the left hand by inheriting from the standard binocular animations, but struggling to move everything over to the right hand :P

Share this post


Link to post
Share on other sites

Throwing around wild ideas, but in theory you could make the canteen a class man unit, totally invisible except the canteen (that could be proxied in and aligned rotated as you want) and then when you use it your script creates the invisible-canteen-man, attaches it to your character, reads its pose and whatnot and copies it and then plays the drinking animation on both. 

7am ideas are the best am I right!? ;D -> off to bed.

  • Like 1

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

×