Jump to content
Sign in to follow this  
seedo81

Evil Dogs

Recommended Posts

Yeah, the west west.. just edit the blitzy.sqf I forgot to take out a test..

look for:

player sidechat format [... etc etc either place a // before it, or take out that line.

Share this post


Link to post
Share on other sites

Tested Blitzy all night in Domination West AI on our dedicated. Happy to report he looks to be working as intending with no issues.

One very minor glitch:

If you try to load Blitzy into a vehicle and he is out of range, it can take mutiple commands to get him to board. But for each time you command him to load, there will be an additional "unload" option. For every time you click one of the "unload K9", there will be that many "load K9" options appear. It's not a big deal (it just clutters up the actions menu a bit with redundant commands).

Share this post


Link to post
Share on other sites

Is it possible blitzy can move towards an object or marker in the same way hes scripted to move towards a enemy soldier?

If so that could be another option he has to sort of sniff out drugs or hidden weapons.

Share this post


Link to post
Share on other sites

the _victem is nothing more than an object. set whatever _victem is, and he'll go right to it.

Share this post


Link to post
Share on other sites

New version works great except for a little bug and I hate dogs with bugs! :)

When you have a group on patrol with dogs "attached" the dogs will attack AI on same side along the way (outside attached group) which ruins mission.

Anyway of making sure dogs attack only one side (west/east)

Thanks for your hardwork.

Share this post


Link to post
Share on other sites

Well, right now, it's better than that...

((side _dog)getFriend (side _x) <0.6)

Make sure your guarddogs.sqf has that in there..

As for east/west.. that's the problem. East/west arnt' the only things out there. For the longest time the dog's were civ's . so it would literally eat itself.

Share this post


Link to post
Share on other sites

Hey BD, thanks for the code. I have tried it by inserting that line in guarddogs.sqf but still dogs are attacking everyone near their group on same side :confused:

Any possible other fixes?

Thanks for your help and great script.

Share this post


Link to post
Share on other sites

uhmm. that line should have allready been in there...

My current guarddogs.sqf

if (Isserver) then {
_leader = _this select 0;
_leader2 = objNull;
_leader2 = _this select 3;
if (!isnull (_leader2 select 0)) then {
	_leader = _leader2 select 0;
};

if (isnil "RE") then {[] execVM "\ca\Modules\MP\data\scripts\MPframework.sqf"};



_side = side _leader;
_grp = creategroup _side;	

_random = round(random 4) +3;

for "_i" from 1 to _random do {
_type = round(random 1);
_breed = "Pastor";
switch (_type) do {
	case 0:
{
	_breed = "Pastor";
};
	case 1:
{
	_breed = "Fin";
};
};	

		//_dog = _grp createUnit [_breed, getpos _leader,[],20,"none"];
		_dogname = format ["k9%1",round (random 1000)];
		call compile format ['"%2" createUnit [getpos _leader, _grp,"%1=this; this setSpeedMode ""full"";this disableAI ""AUTOTARGET"" ; this disableAI ""TARGET"" ; this setCombatMode ""BLUE"";this setbehaviour ""aware""",1]',_dogname,_breed];
		_dog = call compile format ["%1",_dogname];

		_dog setVariable ["_sound1", "dog_01"];
		_dog setVariable ["_sound2", "dog_02"];

		[_dog,_leader] spawn {
		_dog = _this select 0;
		_leader = _this select 1;

		while {alive _dog} do
		{	
				_near_humans = [];
				_alive_humans = [];
				_distance = 1000;
				_neareast = objNull;
				_near_humans = position _dog nearEntities ["man",100];
					//{if ((side _x != side _leader) && (side _x != side _dog)) then {_alive_humans = _alive_humans + [_x];_dog knowsabout _x;}}forEach _near_humans;
					{if ((side _dog)getFriend (side _x) <0.6) then {_alive_humans = _alive_humans + [_x];_dog knowsabout _x;}}forEach _near_humans;
						if (count _alive_humans >0)  then {
						_nearest = _alive_humans select 0;
						_distance = (position _dog) distance (_nearest);
						if ((_distance > 75) && (_distance < 100)) then {
						_nic = [objNull, _dog, rSAY, "dog_02"] call RE;
						_dog dowatch _nearest;
					};
						if ((_distance > 50) && (_distance < 75)) then {
						_nic = [objNull, _dog, rSAY, "dog_01"] call RE;
						_dog domove position _nearest;
						_dog setspeedmode "FULL";
					};
						if ((_distance > 15) && (_distance < 50)) then {
						_nic = [objNull, _dog, rSAY, "dog_01"] call RE;
						_dog domove position _nearest;
						_dog setspeedmode "FULL";
					};
						if ((_distance > 10) && (_distance < 15)) then {
						_dog domove position _nearest;
						_dog setspeedmode "FULL";
					};
						if (_distance < 10) then {
						_nic = [objNull, _dog, rSAY, "dog_maul01"] call RE;
						_dog domove position _nearest;
						_dog setspeedmode "FULL";
						[_nearest, _dog] execvm "scripts\dogattack.sqf";
					};	
				};
			sleep 2;
			//_dog domove position _leader
			_dog domove [(getpos _leader select 0) - ((random(10)+30)*sin(getdir _leader - 180)), (getpos _leader select 1) - ((random(10)+30)*cos(getdir _leader - 180))];
			_dog setspeedmode "FULL";
		};
	};
};

};	

Share this post


Link to post
Share on other sites

I'm trying to get the dog to follow a collection an object that is dropped along the way.

I tried to change in the blitzy script

_near_humans = position _dog nearEntities ["box",150];

Btw "box" is a custom object.

How exactly your script works so the dog zeros in the target, i dont know enough to further alter it to make it work.

So i tried to do a little test with something different, but i've never used nearestobjects before.



if (!alive tintin) exitwith 
{
hint "Dog has been killed!";
};

hint "Dog Track script running";

waituntil {sleep 1;_trkA=nearestobjects [tintin, ["box"],200]; tintin domove getpos rbox1; (tintin distance _trkA <= 5)}; 

dostop tintin;

hint "TrakA script finished";

I get two errors, but funnily enough it still works, the dog does follow the trail of objects.

The errors are:

Error type object, expected number, (null)

Error 4 elements provided, 3 expected. And it points to line 11 which is the waituntil line.

However it works. So just wondering what i need to do in order to correct the errors?

Also i would like to somehow have it the dog spots an enemy, the blitzy script that has the dog zero in on the enemy will be activated. That will be my next bit to work on.

Edited by Daza

Share this post


Link to post
Share on other sites

Blitzy script cracking stuff!

Question. would like to change from pack of dogs to 1 dog per AI, as in Airfield guard or a Police dog handler

Don't want to mess with one .sqf script in case it screws up another. (new at scripts:butbut:)

Edited by jgaz-uk

Share this post


Link to post
Share on other sites

I thried to make the Evil Dogs a bit more variable, but am not sure if this works right. I tried to combine the two scripts from page two (Scars09 + Big Daddy):

this removeAllEventHandlers init; [this] exec "humanattack.sqs" 

_agent = _this select 0;
_near_humans = [];
_alive_humans = [];
_humanattackdistance = 100;
_bitedistance = 2;
_neareast = objNull;
while {alive _agent} do
{
#loop
~2
_agent setbehaviour "safe"
_near_humans = position _agent nearEntities ["man", _humanattackdistance];
   {if (side _x == West) then {_alive_humans = _alive_humans + [_x];_agent knowsabout _x;}}forEach _near_humans;
   if (count _alive_humans >1) then {
           _nearest = _alive_humans select 0;
? (_nearest distance _agent) < _bitedistance : goto "bitehuman"
? (_nearest distance _agent) < _humanattackdistance : goto "attackhuman"
? ! (alive _agent) : exit
goto "loop"

#bitehuman
_agent dowatch _nearest
;_agent playMoveNow "Dog_StopV2"
~.5
_nearest setdammage (getdammage _nearest) + 0.1
~.5
#attackhuman

_attackPosition = [getpos _nearest select 0, getpos _nearest select 1,0]

_agent moveto _attackPosition

~3
? ! (alive _agent) : exit
goto "loop"

I'm not that good at scripting and i'm sure there is a mistake in there somewhere.

Could someone fix it for me, so it would also work if there are other Players/west units around??

Edited by Egosa-U

Share this post


Link to post
Share on other sites

I've got the hang of it! Put this in AI init _nul = [this] execvm "scripts\blitzy.sqf";

(You need the Blitzy script folder in the mission folder)

U can do Player or AI single dog. Its a bit of a coward! will run away at times! The only bug is "talking dogs" lol

Share this post


Link to post
Share on other sites

I've got this script to work in SP/co-op mode but on a dedicated server the dogs don't spawn. :(

Here is the error message in the dedicated server log

Error in expression <0;

_leader2 = objNull;

_leader2 = _this select 3;

if (!isnull (_leader2 select 0>

Error position: <select 3;

if (!isnull (_leader2 select 0>

Error Zero divisor

File mpmissions\__cur_mp.zargabad\scripts\guarddogs.sqf, line 4

And the first part of guarddogs.sqf

if (Isserver) then {

_leader = _this select 0;

_leader2 = objNull;

_leader2 = _this select 3;

if (!isnull (_leader2 select 0)) then {

_leader = _leader2 select 0;

};

if (isnil "RE") then {[] execVM "\ca\Modules\MP\data\scripts\MPframework.sqf"};

etc

etc

That is the only bit that references _leader2, which I'm assuming is the problem.

I'm beginning to know what I'm doing in hosted mode but this dedicated thing blows my mind. :(

Share this post


Link to post
Share on other sites

I don´t have read all Pages, maybe it is written before:

In the animals2.pbo is a "dogAttack.rtm". Will test it later. Would be the animation from the A2 Trailer or so. With the Animation-Viewer there is no attack-thing shown.

Edit: i tryed to add the animation to the animations.cpp but i have no idea how to do it right. Pretty sure a lot of guys here do this in less than 10 minutes so i won´t break my head for 2-3 days. Maybe the missing barking can also be add to the bark-animation.

A MP-Dog like this will be nice to. A simple textur change may be enough.

alan-military-dog.jpg

Edited by Baraka

Share this post


Link to post
Share on other sites
and the dogs when they get near the just tele-port to human ...

I just love having these dogs, and it would be even better if some day that part about teleporting could be fixed.

So far I've been able to add an enemy guard who is patrolling with dogs. I could not get the trigger activated 'wild dogs' to work yet. And I haven't tested the part where I call my own dog.

Thanks for the script! Hope it get's continued with further updates, 'cause it's way cool.

Share this post


Link to post
Share on other sites

:(Sadly :( with version 1.54.72888 of ArmA2OA with BAF Dogs have stopped working any chance of an update

Thats a no then is it?

Edited by jgaz-uk

Share this post


Link to post
Share on other sites

Update since 1.55 the Blitzy Dogs works again!:yay: But if you are running " -showScriptErrors" in your target line it says blitzy.sqf error in line 4. no idea what that is at the moment.:confused:

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  

×