Jump to content
Sign in to follow this  
sebj

Bolt Cocking Hand animation for each shoot [M24 SWS]

Recommended Posts

Hi everybody,

I'm opening this post because following few threads already opened for this case I didn't found any help regarding this question :

Is there a easy way to play hand animation for each shot (as Bolt animation is not a problem with model.cfg configuration) ?

I already saw a way with "fire evenhandler" with scripts commands etc... but if somebody have a more optimized way to do that is should be really great!

My objective is to get the most beautiful animation for a new M24 SWS version for A3 :p.

http://img102.xooimage.com/files/c/2/9/2014-07-16_00003-46b5d57.jpg (488 kB)

http://img107.xooimage.com/files/d/1/f/2014-07-16_00001-46b5d73.jpg (606 kB)

M24 SWS Project : http://armadeus.xooit.org/t77-M24-SWS.htm

Thanks in advance for the help,

In any case if I found a way to do this (I really hope to) the solution will be posted here...

Cya

Share this post


Link to post
Share on other sites

Well, I made a pump action animation after every shot using the fired event handler. It works pretty good, so I would say that you can use this way too. Or do you think that this one is not really optimized?

Share this post


Link to post
Share on other sites

Hi BlackPixxel,

thanks for the help. I would like to avoid this solution because eventhandler is scripting related and could be annoying to configure (from my point of view)...

if there is a way to call a .rtm animation in a model.cfg it should be really great...

On your animation are you just animating the hands? or hands with pump on the gun (because I presume you made a shootgun :))?

Rgds,

Edited by sebj

Share this post


Link to post
Share on other sites

On your animation are you just animating the hands? or hands with pump on the gun (because I presume you made a shootgun :))?

At the moment just the hands. I hope that I can call weapon animations inside an sqf script, otherwise it will be hard to make the animation. How do you plan to make your bolt animation?

The configuration of the script is not that hard, I could show you how I made it (with big help of other forum members;) )

Share this post


Link to post
Share on other sites
At the moment just the hands. I hope that I can call weapon animations inside an sqf script, otherwise it will be hard to make the animation. How do you plan to make your bolt animation?

The configuration of the script is not that hard, I could show you how I made it (with big help of other forum members;) )

I think I can help you. The pump animation should be "relatively simple" as it is a simple translation on one axis.

Everything is done into the model.cfg config (you can see the model.cfg available into A3sample->Weapontest folder present with A3 tools).

Into the model.cfg you'll have to define you "bones" (selections name done into o2).

for example :

1. you'll have to select the pump piece into the object LOD in O2 and name the selection as you want ("pump" should be ok).

2. then Into your memory LOD you'll have to define 2 points as the translation axis and name them as you like ("pump_axis" should be great).

Then simply copy the model.cfg sample provided by BIS.

Change the class names with the same name as your P3D file (this part is really important because it will "link" your p3d model with the animations configured into the model.cfg).

change the bone name "bolt" with "pump".

Into the animation class don't forget to change the one for the bolt with "pump" and the selection= with selection="pump" axis="pump_axis".

into buldozer you should be able to see your animation with right click and then scroling your animation with center button.

Anyway the best example you'll have is into the weapon samples provided by BIS into your arma3tools folder. If you need more help you can PM for a teamviewer if necessary to exchange more details...

It is a little bit long to explain everything but once you'll see the sample I think you'll have the solution.

The last annoying thing will be to synchronise your rtm animation with the model.cfg animation....

Share this post


Link to post
Share on other sites

Thank you for the help!

The problem is that I need to controll the speed of the animation. There should be a delay after the shot. Then the player should pump, but slowly. The animation of the sample file is always instant...

Share this post


Link to post
Share on other sites

I think you should play with ofset and start and end params... that should do it

Share this post


Link to post
Share on other sites

Black,

If it is possible I would like your help too, it should be great if you can send me and extract of the workaround you made for rtm... please :rolleyes:

Did you manage to implement your pump animation?

Share this post


Link to post
Share on other sites

Well, the .rtm does only work for the handanimation.

You just set the animation up as usuall in your weapon config. There you also add the following lines at the bottom (with the propper weapon name):

class CfgFunctions
{
class UTS15
{
	class Fire
	{
		class InitFire
		{
			file = "\uts15\scripts\init.sqf";
			postInit = 1;
		};

	};
};
};

This calls an init.sqf in my mod folder. In this init-file is the eventhandler that calls another .sqf after every shot:

player addEventHandler ["fired", "_this execvm '\uts15\scripts\PumpAction.sqf'"];

And in this .sqf I call the animation if the player is holding the correct weapon and if there is ammo left in the magazine:

MISSION_ROOT = call {
   private "_arr";
   _arr = toArray __FILE__;
   _arr resize (count _arr - 22);
   toString _arr
};


private ["_unit","_weapon","_muzzle","_type","_sh"];
_unit = _this select 0;
_weapon = _this select 1;
_muzzle = currentMuzzle _unit;
_type = _this select 4;
_sh = _this select 6;
_needReload = (_unit ammo _muzzle !=0);
if((_needReload) && (_weapon == "uts15")) then {
sleep 0.2;
_unit playAction "PumpActionStand";
playsound3d [MISSION_ROOT + "sound\pump.wav", _unit];
}

The missionroot-thing is only needed if you want to play a custom soundfile during the animation (see here why: http://killzonekid.com/arma-scripting-tutorials-mission-root/)

That works for my player in Singleplayer. I did not spent any time until now to let it work for AI too, I would have to change something with the eventhandler in the init.sqf, so that it adds the handler not only to the player.

I hope that it will help you!

For the animation of the weapon part: I have not idea what min/ maxvalue, min/maxphase and offset0/offset1 are doing. The explanation in the wiki does not help me.

Could you tell me what I use them for?

Thank you,

BlackPixxel

Edited by BlackPixxel

Share this post


Link to post
Share on other sites

thanks a lot. I'll give a try.

As I told you scripting is calling a lot of functions and I'm afraid of the result if we have a lot of players/IA in this conditions.

for the values here is what I saw (to be confirmed) :

min/ maxvalue : unit of time the the animation is played

min/maxphase : amplitude of the animation (you can limit the movement of your pump between the two points you defined for your axe "pump_axe")

offset0/offset1 : you can control when the animation is launched (range is between 0 and 1 like a percentage). -> this param is really usefull to chain multiple type of animation on one object for example (my bolt is turning then translating...).

Let me know if I'm mistaken because I need to confirm that after work (I need to tune theses params too).

Share this post


Link to post
Share on other sites

Thanks to your help and the friendly guys in the model makers skype group I finally got the weapon animation working. It looks very nice when the hands and the pump are moving after every shot.

But maybe there will be more engine support for animations like that when the Marksmen DLC gets released. I am sure that they will add the KSG-12 Shotgun that we have seen on pre-release screenshots. This would require a new reload system and the pump action which I had to script both.

Share this post


Link to post
Share on other sites

no pb you're welcome. I'll try your script for my configuration too.

I hope to see your adon soon.

Anyway I'll try my chance to get some information from smookie (BI Dev) about some shooting animation (like it is the case for the finger animation that it is pulling the trigger when firing)

Share this post


Link to post
Share on other sites

Hi everybody.

First of all thank you again BlackPixxel for your help regarding the scripts and config to launch custom RTM.

I'm near to finish everything but I'm stuck at the RTM export step from Object builder...

My skeleton animation is working perfectly when I just import it from Mobu into Object builder, but once I try to export the RTM file and reimport it with A3_character_example.p3d the model is messed up.

Here is a video of the problem I'm facing :

I'm sure that the solution is really simple but I didn't found anything. The model.cfg of the Skeleton is in the same folder than the A3_Character.

Thanks again for you help.

Share this post


Link to post
Share on other sites

Hi, now a month passed, and I tried my weapon on a multiplayer server. But the method I showed you does not really work. The fired eventhandler seems to be very unreliable, it disapeared after a few minutes so that there was no pump animation anymore. The other eventhandler for my reloadanimation was still working. At least you can see the animations of other players, even though the script is only executed local on the clients PC, since playActionNow makes the animations visible for everyone.

Did you make any progress regarding the initialisation of the bolt action script? Or does anyone else have an idea how to make this working in multiplayer?

Thanks in advance!

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  

×