Jump to content
L.Trale

Help with Dog Script

Recommended Posts

Hello, I've been using this script for a while and back in the Alpha/Beta it worked properly. 

attack = false;
"Alsatian_Sandblack_F" createUnit [getPos player, group player];
dog = nearestobject [getpos player,"animal"];
dog setVariable ["BIS_fnc_animalBehaviour_disable", true];
[dog] join grpNull;
null=[] spawn { while {alive dog} do 
{waituntil {!attack};
sleep 2;
dog domove getpos player}};

The dog doesn't follow the player anymore like it used to. After doing some research, I found this: 

dog setVariable ["BIS_fnc_animalBehaviour_disable", true];

This is supposed to override the default AI of the dog. This to is not working.

 

I've tried to disable the dogs animations and FSM but no luck, still the same problem.

I've also tried using createAgent instead of createUnit.

Share this post


Link to post
Share on other sites

Gone through hoops to fix this aswell, to no avail.

Animal animations are bugged right now, should be resolved with incoming 1.50 patch.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for the heads up. In the meantime, you can use this to stop the looping animal animations:

_animal disableAI "ANIM";

Share this post


Link to post
Share on other sites

hi there,

 

any news about dogs in Arma 3?

 

I liked them very much in Arma 2 and in RL of course.

Would be very great to have them ingame, for K9 Missions, Zeds and Enemies hunting, patrolling, guarding, protecting, or just be a good friend ;-)

 

thanks,

 

cheers

  • Like 1

Share this post


Link to post
Share on other sites

hi there,

 

any news about dogs in Arma 3?

 

I liked them very much in Arma 2 and in RL of course.

Would be very great to have them ingame, for K9 Missions, Zeds and Enemies hunting, patrolling, guarding, protecting, or just be a good friend ;-)

 

thanks,

 

cheers

^^^THIS

Share this post


Link to post
Share on other sites

Wrote this a while ago so excuse the shit code, but thought it might help if anyone's making a dog script/mod.

Has load dog in veh,

exit veh with chute if +100m off ground,

put vest on dog (works but vest doesn't move when dog sits/stretches etc)

control dog (terrible cam view),

and when dog is controlled can see explosives within 200m

Again, this was a while ago and was for testing so is buggy.

	
	_dog = group player createUnit
	[
		"Alsatian_Random_F",
		[getpos player select 0,(getpos player select 1)+3,(getpos player select 2)+0.2],
		[], 0, "FORM"
	];

	veh = vehicle player;
	_dogClose = nearestObject [player, "Alsatian_Base_F"];
	
	if (_dogClose in units player) then
	{
		dogVeh = _dogClose
	};

	_dMine1 = dogVeh nearObjects ["timebombcore",200];
	_dMine2 = dogVeh nearObjects ["minebase",200];
	dMine = _dMine1 + _dMine2;

		act1 = player addAction ["<t color=""#00ff33"">" + ("Dog Menu") + "</t>",
	{
		if (!alive dogVeh) then
		{ player removeAction act1;
		hint "You're dog has died";}
		else {

			
			player removeAction act2;
			player removeAction act3;
			player removeAction act5;
			player removeAction act6;
			player removeAction act7;
			player removeAction act8;
			act2 = player addAction ["		Control Dog",
		{
																
					player removeAction act2;
					player removeAction act5;
					player removeAction act8;
					dogVeh switchCamera "GROUP";
					_dMote = player remoteControl dogVeh;
					if (count dMine > 0) then	
			{
						["minetrgt", "onEachFrame",
				{
					{
						
						
					drawIcon3D	[
								"\a3\ui_f\data\map\Markers\NATO\n_unknown.paa",
								[0.99,0,0,1],
								[(visiblePosition _x select 0),
								(visiblePosition _x select 1),
								((visiblePosition _x select 2)+0.5)],
								0.5,
								0.5,
								0,
								"Explosives",
								2,
								0.03,
								"PuristaMedium"
								];
										
					} forEach dMine;
				}
						]call BIS_fnc_addStackedEventHandler;
			}
					else {hint "No explosives nearby"};
					
				act3 = player addAction ["		Control Player",
				{
					player switchCamera "INTERNAL"; 
					player removeAction act3;
					if (count dMine > 0) then
			{ 
			
					act4 = player addAction ["		Remove Targets",
					{
						["minetrgt", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
						player removeAction act4;
					},"",0.01,false,false];																
			};
				},"",0.03,false,false];
		},"",0.03,false,false];
		
			act5 = player addAction ["		Put Vest On Dog",
		{
			player removeAction act2;
			player removeAction act5;
			player removeAction act8;
			bags = 
			[
				"Vest_V_TacVest_blk",
				"Vest_V_TacVest_khk",
				"Vest_V_TacVest_brn",
				"Vest_V_TacVest_camo",
				"Vest_V_TacVest_oli",
				"Vest_V_TacVest_blk_POLICE",
				""
			];
			pack = cursorTarget;
			if (typeOf(pack) in bags) then { 
			pack enableSimulation true;
			pack hideObject true;
			pack attachTo [dogVeh,[0,-0.4,0.415],"aimpoint",0,"",false];
			pack setDir 180;
			sleep 1;
			pack enableSimulation true;
			pack hideObject false;
			pack enableCollisionWith dogVeh}
			else {hintc "You need to be looking at a tactical vest for this to work"};
																
																
		},"",0.02,false,false];
			
			if((vehicle player isKindOf "LandVehicle")||
				(vehicle player isKindOf "Air")||
				(vehicle player isKindOf "Ship"))
				then
		{
							veh = vehicle player;
			act6 = player addAction ["		Load Dog",
			{
																
				if (veh isKindOf "LandVehicle") then
				{
					dogVeh attachto [veh,[0,-0.4,-1]];
				};
				if (veh isKindOf "Air") then
				{
					dogVeh attachto [veh,[0,2.6,1.9]];
				};
				dogveh switchmove "Dog_Sit_01";
				dogVeh disableAI "MOVE";
				dogVeh disableAI "ANIM";
				dogVeh disableAI "FSM";
				dogVeh disableAI "target";
				player removeAction act2;
				player removeAction act3;
				player removeAction act5;
				player removeAction act6;
				player removeAction act7;
				player removeAction act8;
				
				act7 = player addAction ["		Dog Out",
				{												
					player removeAction act7;
					detach dogVeh;
					if ((getPos dogVeh select 2) > 100) then
					{
						dogVeh allowDammage false;
						dogveh switchmove "Dog_Stop";
						sleep 3;
						_chute = createVehicle 
						[
							"NonSteerable_Parachute_F", 
							position dogVeh, [], 0, "CAN_COLLIDE"
						];
						_chute setPos getPos dogVeh;
						dogVeh attachTo [_chute,[0,-0.1,0.2]]; 
						if ((getPos dogVeh select 2) < 5) then
						{	detach _chute;
							dogVeh allowDammage true;
							dogVeh enableAI "MOVE";
							dogVeh enableAI "ANIM";
							dogVeh enableAI "FSM";
							dogVeh enableAI "target";
						}; 
					}
					else
					{
						dogVeh enableAI "MOVE";
						dogVeh enableAI "ANIM";
						dogVeh enableAI "FSM";
						dogVeh enableAI "target";
					};
				},"",0.02,false,false];	
																				
			},"",0.02,false,false];
		};

			act8 = player addAction ["<t color=""#ff3300"">" + ("Dog Menu (close)") + "</t>",
			{
				player removeAction act2;
				player removeAction act5;
				player removeAction act8;
			},"",0.01,false,false];};
	},"",0.04,false,false,"",""];
 

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

×