seedo81 10 Posted September 22, 2009 hi i was wondering if there is a way to make dogs evil and attack anything even me:) that would give a realistic scary feeling specially at night;) thank u Share this post Link to post Share on other sites
seedo81 10 Posted September 23, 2009 no one knows?:confused: Share this post Link to post Share on other sites
Bon 12 Posted September 23, 2009 I guess we all thought about something like this already. But I think it is not possible, since I even don't know how an animal can cause damage to a unit. Share this post Link to post Share on other sites
bardosy 158 Posted September 23, 2009 cause damage is not a problem... if (player distance dog <2) then {player setDamage (getDammage palyer)-0.1}; Share this post Link to post Share on other sites
Master gamawa 0 Posted September 23, 2009 Yeah you also need a script so the dogs chase you if you enter a certain area near them. And an attack animation/sound effect. Share this post Link to post Share on other sites
seedo81 10 Posted September 23, 2009 (edited) i think it will be a great thing if some one find out a way to do that :) imagine how cool it will be Edited September 23, 2009 by seedo81 Share this post Link to post Share on other sites
ProfTournesol 956 Posted September 23, 2009 cause damage is not a problem...if (player distance dog <2) then {player setDamage (getDammage palyer)-0.1}; Funny, what you've written actually heals the player instead of hurting him. Nice dog ;) Share this post Link to post Share on other sites
tractorking 10 Posted September 23, 2009 I thought one of the movie/preview/cutscenes showed a dog attacking you. Share this post Link to post Share on other sites
seedo81 10 Posted September 23, 2009 guys please we need evil dogs:confused: Share this post Link to post Share on other sites
bardosy 158 Posted September 24, 2009 Funny, what you've written actually heals the player instead of hurting him. Nice dog ;) :D Yes, you're right! Of course we have to add 0.1. Thanks for the note! Share this post Link to post Share on other sites
scars09 9 Posted September 24, 2009 the dogs run a script that makes them fear humans and gunfire, if this is disabled via the init eventhandlers you can let them move to player position. Problem is they still seem to run fsm files which makes their attack behaviour less predictable. _agent = _this select 0;_humanattackdistance = 30; _bitedistance = 2; #loop ~2 _agent setbehaviour "safe" ? (player distance _agent) < _bitedistance : goto "bitehuman" ? (player distance _agent) < _humanattackdistance : goto "attackhuman" ? ! (alive _agent) : exit goto "loop" #bitehuman _agent dowatch player ;_agent playMoveNow "Dog_StopV2" ~.5 player setdammage (getdammage player) + 0.1 ~.5 #attackhuman _attackPosition = [getpos player select 0, getpos player select 1,0] _agent moveto _attackPosition ~3 ? ! (alive _agent) : exit goto "loop" that was a quick testing i did, dog need this removeAllEventHandlers init; [this] exec "humanattack.sqs" in init field. Best method would be a new fsm file and a new dog config to completly get around the bis fsm´s i guess. But im no scripter and i just took a short look into the configs, maybe someone with a talent in scripting get the job done Share this post Link to post Share on other sites
Thirdup 0 Posted September 24, 2009 I'd love to see this work (not so much the "evil" bit, but...). I've been asking around for a way to have a K9 join a patrol as a squad member. I remember seeing a clip of a rabbit swack a guy, so the attack part is obviously doable. Share this post Link to post Share on other sites
bardosy 158 Posted September 24, 2009 This is a very interesting topic/study about dogs: http://www.ofpec.com/forum/index.php?topic=33559.0 Share this post Link to post Share on other sites
Big_Daddy 10 Posted September 24, 2009 (edited) Guys, I created a script to spawn a dog, have it join your squad, follow you around, allow you to order it to a location. And within a certain distance, the dog starts chasing and attacking enemy.. It was for a buddy of mine who was a K9 cop for many years. His unit was named blitzy hence the name used in the script. You of course can change it to do your bidding as well. I got inspiration from Norrin's killer bunny script.. Maybe somebody can clean it up, make it "more" MP friendly. Right now it works. but since I call it from a radio trigger. it runs once for every player. For evil dogs you can always take out the group settings, take out the _x side == east, randomize the spawn location, and let a pack of em go.. :) course, you'd want to remove the allowdammage, and setcaptive true statements. :) if (player == player) then { deletevehicle blitzy; "Pastor" createUnit [getPos player,group player,'blitzy=this;this setSpeedMode "FULL";this allowFleeing 0;this setBehaviour "aware";this setskill 1;this setcaptive true;this allowDamage false;',1,'PRIVATE']; blitzy setIdentity "blitzk9"; if (leader player == player) then { [blitzy] joinsilent player; } else { blitzy dofollow player; }; blitzy setVariable ["_sound1", "dog_01"]; blitzy setVariable ["_sound2", "dog_02"]; publicVariable "blitzy"; //end while {alive blitzy} do { _near_humans = []; _alive_humans = []; _distance = 1000; _neareast = objNull; _near_humans = position blitzy nearEntities ["man",100]; {if (side _x == east) then {_alive_humans = _alive_humans + [_x];blitzy knowsabout _x;}}forEach _near_humans; if (count _alive_humans >1) then { _nearest = _alive_humans select 0; _distance = (position blitzy) distance (_nearest); if ((_distance > 75) && (_distance < 100)) then { _nic = [objNull, blitzy, rSAY, "dog_02"] call RE; blitzy dowatch _nearest; }; if ((_distance > 50) && (_distance < 75)) then { _nic = [objNull, blitzy, rSAY, "dog_01"] call RE; blitzy domove position _nearest; }; if ((_distance > 15) && (_distance < 50)) then { _nic = [objNull, blitzy, rSAY, "dog_01"] call RE; blitzy domove position _nearest; }; if ((_distance > 10) && (_distance < 15)) then { blitzy domove position _nearest; }; if (_distance < 10) then { _nic = [objNull, blitzy, rSAY, "dog_maul01"] call RE; blitzy domove position _nearest; [_nearest, player] execvm "blitzy\blitzyattack.sqf"; }; } else { blitzy dofollow player; }; sleep 10; }; }; blitzyattack.sqf _victim = _this select 0; _lead = _this select 1; _nic = [objNull, _victim, rSAY, "scream"] call RE; blitzy attachTo [_victim,[0,.8,0], "lholen"]; blitzy setDir 180; sleep 1; blitzy setDir 175; sleep 1; blitzy setDir 180; sleep 1; blitzy setDir 185; _victim setdamage 1; detach blitzy; blitzy dofollow _lead; if (true) exitWith {}; description.ext class CfgIdentities { class blitzk9 { name="Blitzy"; face = "Face16"; glasses = "None"; speaker="Male01EN"; pitch=1.1; }; }; Edited September 24, 2009 by Big_Daddy Share this post Link to post Share on other sites
seedo81 10 Posted September 24, 2009 ok but am a noob how i apply the script can anyone make a video tutorial? Share this post Link to post Share on other sites
Thirdup 0 Posted September 25, 2009 (edited) Guys, I created a script to spawn a dog, have it join your squad, follow you around, allow you to order it to a location. And within a certain distance, the dog starts chasing and attacking enemy.. Finally got to tinker with this for a few minutes this morning. I've got something messed up, but it's a start. I used a radio trigger and I can call the pup. He joins up and follows me around. He'll also take movement and formation commands. He won't seem to attack an enemy if I send him in (if commanded to attack he just says "negative"...and if he walks by an enemy he just ignores them). But if I spawn him within is coded attack range of an enemy, he spawns (at their position) right on their throat and drops them. I'm also not hearing any of his barking fx. Going to be a great addition, though. ok but am a noob how i apply the script can anyone make a video tutorial? Seedo, if I get it sorted out I'll be happy to email you a copy of my little test mission. Edited September 25, 2009 by Thirdup Share this post Link to post Share on other sites
Big_Daddy 10 Posted September 25, 2009 (edited) Ok.. The reason he says negative is because he has no weapons. Give him a pistol, and some ammo. (of course, the dog doesn't use it) then he won't "bark" back? :) this addmagazine "15Rnd_9x19_M9SD";this addWeapon "M9SD"; As far as the sound, I've fixed that. Its cause I'm using the MP framework to handle the say command. You can either just change the SAY, or add this line: if (isnil "RE") then {[] execVM "\ca\Modules\MP\data\scripts\MPframework.sqf"}; As far as a Demo Mission look HERE. Edited September 25, 2009 by Big_Daddy Share this post Link to post Share on other sites
seedo81 10 Posted September 25, 2009 ok man i will pm my email ---------- Post added at 07:54 PM ---------- Previous post was at 07:41 PM ---------- Ok..The reason he says negative is because he has no weapons. Give him a pistol, and some ammo. (of course, the dog doesn't use it) then he won't "bark" back? :) this addmagazine "15Rnd_9x19_M9SD";this addWeapon "M9SD"; As far as the sound, I've fixed that. Its cause I'm using the MP framework to handle the say command. You can either just change the SAY, or add this line: if (isnil "RE") then {[] execVM "\ca\Modules\MP\data\scripts\MPframework.sqf"}; As far as a Demo Mission look HERE. i tried it its cool but sadly the dog is a chicken if we just find a way to make the dog chase after anything even me:D Share this post Link to post Share on other sites
scars09 9 Posted September 25, 2009 the missing barking is cause of the deleted eventhandler i think. the non attacking is cause dogs simply dont have a config entry for this command as for most other commands. bis didnt planned to let the dogs be part of a formation thats why they didnt have most of the entries a human have. barks could be added in the script, no lip sync possible i think. to get the dog to respond to an attack command would need a complete new config, means a new addon, a formation fsm and other stuff, lot of work, but would be possible to create a real killer then. at least thats how i understand what i saw so far in the config of the dog. maybe i give it a try Share this post Link to post Share on other sites
Big_Daddy 10 Posted September 25, 2009 ok man i will pm my email---------- Post added at 07:54 PM ---------- Previous post was at 07:41 PM ---------- i tried it its cool but sadly the dog is a chicken if we just find a way to make the dog chase after anything even me:D The dog is a chicken? heh. uh.. that' hasn't ever happend to me.. And if you want it to chase after everyone, we can do that.. only problem is that you don't want it spawning anywhere near you... Share this post Link to post Share on other sites
seedo81 10 Posted September 25, 2009 the missing barking is cause of the deleted eventhandler i think.the non attacking is cause dogs simply dont have a config entry for this command as for most other commands. bis didnt planned to let the dogs be part of a formation thats why they didnt have most of the entries a human have. barks could be added in the script, no lip sync possible i think. to get the dog to respond to an attack command would need a complete new config, means a new addon, a formation fsm and other stuff, lot of work, but would be possible to create a real killer then. at least thats how i understand what i saw so far in the config of the dog. maybe i give it a try 100% agree with you hopefully someone will make an Add-one to make that dog Evil:D Share this post Link to post Share on other sites
Big_Daddy 10 Posted September 25, 2009 Ok, updated the file if you want to redownload. Created a marker on the map, and made the dogs spawn there. Here is the link again Added a random amount of dogs of both Pastor, and Fin (German Shepard, and Mutt), etc. they will attack you, so don't get close. :) Blitzy is the same. Share this post Link to post Share on other sites
seedo81 10 Posted September 25, 2009 ok thats so good what u did but how i will apply this code in another misiion? and the dogs when they get near the just tele-port to human so it doesnt look real but its so great i still say:) Share this post Link to post Share on other sites
Thirdup 0 Posted September 28, 2009 (edited) More "K9" related than "evil dogs" but..... Ran into some minor issues with Big Daddy's script. Maybe somebody can help get me back on track. I plugged all this into a MP mission (a Domination build that we've bastardized for very small clan play). It actully worked for the most part but I've got two problems (the first of which seems to be a carry-over from the demo mission posted up thread): 1) When Blitzy is "armed" he just stands in the spot he spawns. "Pastor" createUnit [getPos player,group player,'blitzy=this;this setSpeedMode "FULL";this addmagazine "15Rnd_9x19_M9SD";this addWeapon "M9SD";this allowFleeing 0;this setBehaviour "aware";this setskill 1;this setcaptive true;this allowDamage false;',1,'PRIVATE']; He will not move nor follow commands. When I remove the addmagazine and addweapon sections, he moves and follows commands (he just can not attack on command). This is occuring both offline (demo mission) and online missions (I never could get BigDaddy's later/armed version of his demo dog to move, either). If I can figure out how to resolve this offline, I'm sure it will work online. 2) The second issue might be a bit more tricky. I don't really want to just have one slot designated as "K9 Handler" (all of the players in my group kind of like to multi-role). I allowed any player to call up a trigger that spawns the dog. But anytime a player calls up a dog, we *all* get one (or additional ones). Once a dog is in a player's squad, the "8 AI cap" within Domination is ignored. We quickly ended up with several hundred dogs (literally dozens each) at somepoint before the server puked. ;) Edited September 28, 2009 by Thirdup Share this post Link to post Share on other sites
CaptainBravo 0 Posted September 28, 2009 Sounds like a great script (I have been searching for something like this for a while! Will try this eve. A couple of quick questions: Will it allow for a dog to join and run with an enemy group hunting you? Will the dog bark (gets louder as it gets closer to hunted? Thanks. Share this post Link to post Share on other sites