Jump to content
jagdtiger74

Arma 3 Skeet Trap Shooting

Recommended Posts

Hi everyone,

 

I was wondering if anybody knows if there is the possibility to create some Trap/Skeet shooting within Arma 3?

 

I saw this video on youtube:

 

https://youtu.be/I-1YxFeLzKs

 

Unfortunately there is no description on how the clay was set up.

 

I also found this link here in the forums, but it is for Arma 2

 

https://forums.bistudio.com/topic/104692-d3z-shotguns/?hl=double+barrel+shotgun

 

Now I have to admit that I have no idea about modding so I guess I can not be off any help at all, but perhaps someone here knows if something like that can be achieved in Arma 3.

 

Cheers Jagdtiger/Jan

Share this post


Link to post
Share on other sites

Make a text doc in your main folder called launch_skeet.sqf

go ingame and place a portable generator called sk1 or sk2 or sk3


private ["_machine"];
_machine = _this select 0;

if (!(isnil "_machine")) then 
{	
	private ["_disc", "_discPos"];
	_discPos = [_machine, 0.6, 180] call BIS_fnc_relPos;
	_disc = "Skeet_Clay_F" createVehicle [(_discPos select 0), (_discPos select 1), 0.7];
	_disc setPos [(_discPos select 0), (_discPos select 1), 0.7];
	
	private ["_vel", "_ehCode"];
	_vel = [[0, -1, 0], (direction _machine + random 4 - random 4)] call BIS_fnc_rotateVector2D;
	_disc setVelocity [(-(_vel select 0) * 9), ((_vel select 1) * 9), 10 + (random 2)];
	
	_ehCode = 
	{
		private ["_disc", "_killer"];
		_disc = _this select 0;
		_killer = _this select 1;
		
		//Only score a hit while the skeet is airborne.
		if (((position _disc) select 0) > 0.1) then 
		{
			if ((_disc distance _killer) <= 30) then 
			{
				hint "3 POINT HIT";
				// add a variable named playerId_score for each player in the mission. as I couldn't get addScore to work.
				private ["_code"];
				_code = compile format["%1_score = %1_score + 3;", _killer];
				call _code;
				
			} 
			else 
			{
				hint "2 POINT HIT";
				// add a variable named playerId_score for each player in the mission. as I couldn't get addScore to work.
				private ["_code"];
				_code = compile format["%1_score = %1_score + 2;", _killer];
				call _code;
			};
		};
		
		deleteVehicle _disc;
	};
	
	_disc addEventHandler ["killed", _ehCode];
	
	sleep 1;
	
	//Make sure the skeet flies a bit longer than normal physics would cause.
	_vel = velocity _disc;
	
	private ["_i"];
	_i = 0;
	
	while {(((position _disc) select 2) > 0.1) && (alive _disc)} do 
	{
		_disc setVelocity [(_vel select 0) / (1 + (_i / 10)), (_vel select 1) / (1 + (_i / 10)), (_vel select 2) / (1 + _i)];
		_i = _i + 0.1;
		sleep 0.1;
	};	
};

true

 

  • Like 1

Share this post


Link to post
Share on other sites

I get this error when hitting a clay

 

107410_20170710085939_1.png

 

can you help

Share this post


Link to post
Share on other sites

Yup, unfortunately, I believe that it is a mistake from Bohemia since the script does not directly include Skeet_clay.3pd, it might be a fail in the vanilla config.

But it works fine tho right?

Share this post


Link to post
Share on other sites

Can you help me with making a addaction for a laptop.....

 

i got sk1 sk2 sk3

 

and i wot like to be aple to shoot them all from one position

Share this post


Link to post
Share on other sites

Hey, Thanks for the Code for this. Trying to do what @loopdk is doing as well. Not the best at this but working on it. I tried a few ways but none of them worked. I will show the way I attempted and if anyone knows where I went wrong please inform me. (Ps. Using a Slighly edited code that removes the pint system completely as I don't need it in my mission.)

 

Attempt one.

Inside of sk1 (Portable Genorator)

Skeet1 addAction["PULL",sk1 exec "launch_skeet.sqf"];

 

Skeet1 is the Name of the Radio Object that iam using.

Trying to remotely remote execute the command from a pull action on the radio object. :rofl: (Like this was gonna work)

Results . "PULL" Action appears but does nothing when accessed.

 

Attempt two.

Another way around 

Inside of Skeet1 (Radio Handset)

this addAction["PULL",sk1 exec "launch_skeet.sqf"];

 

sk1 being the Portable Generator

Trying to remotely execute the Command from a pull Action on the radio.

Results. "PULL" Action appears but does nothing when accessed.

 

This is the code that has the Middle removed (Scoring System)

private ["_machine"];
_machine = _this select 0;

if (!(isnil "_machine")) then 
{	
	private ["_disc", "_discPos"];
	_discPos = [_machine, 0.6, 180] call BIS_fnc_relPos;
	_disc = "Skeet_Clay_F" createVehicle [(_discPos select 0), (_discPos select 1), 0.7];
	_disc setPos [(_discPos select 0), (_discPos select 1), 0.7];
	
	private ["_vel", "_ehCode"];
	_vel = [[0, -1, 0], (direction _machine + random 4 - random 4)] call BIS_fnc_rotateVector2D;
	_disc setVelocity [(-(_vel select 0) * 9), ((_vel select 1) * 9), 10 + (random 2)];
	
	_ehCode = 
	{
		private ["_disc", "_killer"];
		_disc = _this select 0;
		_killer = _this select 1;
		
		//Only score a hit while the skeet is airborne.
		if (((position _disc) select 0) > 0.1) then 
		{
			if ((_disc distance _killer) <= 1000) then 
			{
				hint "Hit";
			};
		};
		
		deleteVehicle _disc;
	};
	
	_disc addEventHandler ["killed", _ehCode];
	
	sleep 1;
	
	//Make sure the skeet flies a bit longer than normal physics would cause.
	_vel = velocity _disc;
	
	private ["_i"];
	_i = 0;
	
	while {(((position _disc) select 2) > 0.1) && (alive _disc)} do 
	{
		_disc setVelocity [(_vel select 0) / (1 + (_i / 10)), (_vel select 1) / (1 + (_i / 10)), (_vel select 2) / (1 + _i)];
		_i = _i + 0.1;
		sleep 0.1;
	};	
};

true

If anyone knows the correct way to remotely executing scripts or wants to help get this working please msg back. Thanks, Mac

@Chris-Hanson@loopdk@jagdtiger74

Share this post


Link to post
Share on other sites

I will post the way my team amte didt it. works perfectly

Share this post


Link to post
Share on other sites
6 hours ago, loopdk said:

I will post the way my team amte didt it. works perfectly

 

Great Thanks, Cant wait :)

Share this post


Link to post
Share on other sites

Hey Everyone!

What may gone wrong if I experience the following error messages described below: 😩

 

Pic1

Pic2

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

×