Jump to content
Sign in to follow this  
JCataclisma

[SOLVED] Script to center helicopter gunner's aiming at pilot's view/screen?

Recommended Posts

INFORMATION NOTE:

 

THIS FIRST MESSAGE CONTAINS THE STARTING DOUBTS AND THE WRONG CODE.

Please scroll down a bit to see another message containing the correct applied code.

 

============================================

 

Hello, guys!

I have watched some gameplays in which players entered helicopters like Kajman and Blackfoot, without neither other player or AI on gunner seat, and every time they switched to Manual Fire, the aiming of the gun instantly and automatically "centers" to match the pilot's view.

Unfortunately, I don't have access to any script, PBO or mission files, to try and search what those servers' admins might have used.
I have found a "Talk" piece on Arma 3 Wiki, in which KilzoneKid and AgentRev posted some comments to such specific situation, but I wasn't able to make it work by myself.

https://community.bistudio.com/wiki/Talk:animateSource

 

 

The code below might be the closed I have come so far. I get no errors, and both "hints" are shown on screen, so it runs completely. But I got no aiming movement at all.
I have even tried a suggestion to ad some permanent aiming coordinates on screen, for debug purpouses, and it worked great, but still no movement.
Have also performed some attempts with "eyePos", still no luck at all.

https://community.bistudio.com/wiki/eyePos

 

Any suggestions where could I go from here to make that gun automatically centered?
Cheers!

😎
NOTE:
In the videos I have seen, the stuff is done automatically when activating Manual Fire. Here, I am initially trying it by using a "Zeroing" action that checks whether manual fire is on, prior to try and perform stuff.

 

Spoiler

 

 

Share this post


Link to post
Share on other sites

I have a really simple solution:

Add a laser designator to the pilot camera.

Have the AI gunner target the laser designator.

The AI gunner will point the gun wherever you point the pilot camera.

Use manual fire to fire

Share this post


Link to post
Share on other sites
12 hours ago, Ex3B said:

I have a really simple solution:

Add a laser designator to the pilot camera.

Have the AI gunner target the laser designator.

The AI gunner will point the gun wherever you point the pilot camera.

Use manual fire to fire


That's a really simple and efficient idea. I will put it for another use I got in mind, thank you!

Share this post


Link to post
Share on other sites

Well, it happened that I was in the very right track, following that "talk" link regarding AnimateSource. But I forgot that some lines at the top of my code were blocking the access to the gunship's gunner seats, so the fake agent or unit created was not allowed to perform the moveInGunner, thus the gun would never move.Already got my Facepalm Award for the week.
🤦‍♂️

Here is the code I am using, almost completely like the wiki:
 

			_fakeGunner = createAgent ["B_UAV_AI", [0,0,0], [], 0, "NONE"]; 
			sleep 0.25; 
			_fakeGunner moveInGunner (vehicle player);
			_fakeGunner lockCameraTo [(vehicle player),[0],false];
			_fakeGunner spawn 
				{
					sleep 2;
					deleteVehicle _this;
				};

 

  • Thanks 2

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  

×