Jump to content
TedHo

[Functions] UnitCapture/UnitPlay for Infantry Units in ArmA 3

Recommended Posts

@johnnyboy , @Rich_R , I got it to work in the video he used [dude1, 120, 35, true, 2] spawn HLF_fnc_infUnitCapture; , which conflicts to the example files where it has [dude1, 60, 20, true, 2] spawn HLF_fnc_infUnitCapture; , so you would need to change both 60, 20 to 120 , 35 for it to work, the only issue I have is that the firing isn't working, this could be due to the modded gun, I am yet to do more testing but I will get back to you and Rich_R I was curios if you came across this problem?

  • Like 1

Share this post


Link to post
Share on other sites

Great news! Are you using the same gun to record the actions and play them?

 

when I used the system, didn't have any issues with the firing.

Share this post


Link to post
Share on other sites
16 hours ago, Rich_R said:

Great news! Are you using the same gun to record the actions and play them?

 

when I used the system, didn't have any issues with the firing.

Yeah they are the same and the same with the AI I control when watching the Animations, it seems to work fine with Vanilla ARMA Rifles, however when I use Modded Rifles it seems to capture fine but doesn't like it when I play the Animation.

  • Like 1

Share this post


Link to post
Share on other sites

Hot on the heels of @Chris Along getting it to work, I tried again using a strictly vanilla arma and still have the twitching when crouched. The units do it a little when prone as well, but not as noticeable.

 

 

I used both [dude1, 120, 35, true, 2] spawn HLF_fnc_infUnitCapture; and [dude1, 60, 20, true, 2] spawn HLF_fnc_infUnitCapture; but it twitched the same way both times.

 

May still use it and edit my videos around the kneeling twitch :(

 

Share this post


Link to post
Share on other sites

This may sound crazy, but try using disableAI "ANIM" on the units before playing back.  The video looks like the AI caused animaitons are competing with playback forced animations..  My hope is that disableAI "ANIM" prevents AI induced animations from happening at same time playMove/switchMove being executed on units.  Just a theory...   Good luck.

Share this post


Link to post
Share on other sites

Just to Clarify about the shooting issue I had and maybe some others had, I tried a Variety of guns, Vanilla, RHS etc and it is hit or miss wether or not it works, I will get back to this thread with some more insight, including @JohnnyBoy 's suggestion.

Share this post


Link to post
Share on other sites

@Rich_R disableAI "ANIM" does stop the twitching at the start as you can see in the video, the initial jump that the character does it just because I moved before I started recording, as you can see when he starts moving and stops there is no weird sliding or twitch, however the shooting still is not working for me consistently, even though the code looks fine and the characters are literal duplicates, just with different Variable names and code.

 

https://www.youtube.com/watch?v=D2AZGPf1ii8&feature=youtu.be

Share this post


Link to post
Share on other sites

I have the disable AI “anim” in the characters init.....hmmmm

 

Are the shooting issues with the RHS rifles still?

Share this post


Link to post
Share on other sites

@Rich_R I Tested some guns from different mods, they all seem to be fine however the Vanilla one bugs out if you make too violent movements and the RHS USAF one is really hit or miss, The Bugging out at the begging stopped when I put  disable AI “anim” in all AI and the Capture Trigger.

 

 

 

Share this post


Link to post
Share on other sites

@Chris Along You really had the disableAI "ANIM" command in everything !:eh:

 

Sucks about the weapons

Share this post


Link to post
Share on other sites
20 minutes ago, Rich_R said:

@Chris Along You really had the disableAI "ANIM" command in everything !:eh:

 

Sucks about the weapons

No just the AI and the Capture command, seemed to work so idk.

Share this post


Link to post
Share on other sites
40 minutes ago, Rich_R said:

@Chris Along You really had the disableAI "ANIM" command in everything !:eh:

 

Sucks about the weapons

 

19 minutes ago, Chris Along said:

No just the AI and the Capture command, seemed to work so idk.

Update on my last post, I removed DisableAI "ANIM" on the Record Trigger and it still works fine for me, so all I can do now if give you what I use.

Record Trigger = rec = [player1, 60, 20, true, 2] spawn HLF_fnc_infunitcapture;

Play Trigger = nul = [player1] execVM "play.sqf";

Player 1 = this disableAI "ANIM";

GCAM = this setcaptive true; this disableAI "ANIM";

 

Capture = _unit = _this select 0;
[_unit, 120, 35, true, 2] spawn HLF_fnc_infUnitCapture;

 

Play = _unit = _this select 0;
{_unit disableAI _x;} forEach ["ANIM","MOVE","FSM","TARGET","AUTOTARGET"];
[_unit, HLF_moveData] spawn BIS_fnc_UnitPlay;
[_unit, HLF_fireData, true] spawn HLF_fnc_infUnitPlayFiring;
[_unit, HLF_animData, true] spawn HLF_fnc_infUnitPlayAnim;

 

Probably the same as yours but it's all I can think of to help you, also RHS weapons have started to work now for some reason.

  • Like 1

Share this post


Link to post
Share on other sites

Guys, thanks for persevering and posting your findings.  I'm sure I and others will benefit from this.

  • Like 1

Share this post


Link to post
Share on other sites
15 hours ago, Chris Along said:

 

GCAM = this setcaptive true; this disableAI "ANIM";

 

 

Congrats on the weapons working and thanks for the code!

 

Where did you place the gcam line? Cant think this is my issue however, the last video was purely vanilla.

Share this post


Link to post
Share on other sites
4 hours ago, Rich_R said:

 

Congrats on the weapons working and thanks for the code!

 

Where did you place the gcam line? Cant think this is my issue however, the last video was purely vanilla.

Sorry should of made it more clear, that was the second AI i was controlling to film the AI in the video and the AI I would of used to film the ones doing the Actions, essentially I use this guy without any capture data just to film

and the Vanilla and the RHS : USAF guns seem hit or miss as hell.

  • Like 1

Share this post


Link to post
Share on other sites

Hi Chaps,
In need of some help unfortunately. 
 I've run into a spot of bother trying to have 2 units move at the same time. I followed the tutorial as per the video at the bottom.

 but I'm not getting the right results. 

The first bot seems to more or less work with the odd animation quirk. 

The second bot doesn't even move from where I've left him and it throws this error.

'...= _this select 1;

_totalFrames = )count |#|_capturedAnimData);

 

_startedTime = time...'FileFunction\fn_inUnitPlayAnim.sqf [HLF_fnc_infUnitPlayAnim], line 353\missions\unitCaptureTest.provingGrounds_PMC\play2.sqf' line 3 Error Undefined variable in expression; _capturedanimdata

 

 

I've had a look through the play2.sqf file in other example missions that work fine so I'm unsure where I have gone wrong.

Any help is appreciated chaps.

Max


 

Share this post


Link to post
Share on other sites
16 hours ago, flying-noodles said:

Hi Chaps,
In need of some help unfortunately. 
 I've run into a spot of bother trying to have 2 units move at the same time. I followed the tutorial as per the video at the bottom.

 but I'm not getting the right results. 

The first bot seems to more or less work with the odd animation quirk. 

The second bot doesn't even move from where I've left him and it throws this error.

'...= _this select 1;

_totalFrames = )count |#|_capturedAnimData);

 

_startedTime = time...'FileFunction\fn_inUnitPlayAnim.sqf [HLF_fnc_infUnitPlayAnim], line 353\missions\unitCaptureTest.provingGrounds_PMC\play2.sqf' line 3 Error Undefined variable in expression; _capturedanimdata

 

 

I've had a look through the play2.sqf file in other example missions that work fine so I'm unsure where I have gone wrong.

Any help is appreciated chaps.

Max


 

Hey man looking to help, however looking at only errors makes that a little hard, first things first, have you tried the video below, also, is there anyway you could upload the mission file so I or others could take a look (To google drive or dropbox)

 

 

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

×