Jump to content
Sign in to follow this  
seedo81

Evil Dogs

Recommended Posts

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. ;)

1. First of all, the weapon. It's strange, when I did my testing, he worked just fine with a weapon. But I ended up removing it because it didn't ADD anything. When you DO tell him to attack someone, he doesn't run in and go for the throat. He just doesn't reply Negative. So it MAY be a moot point.

2. The dreaded radio trigger. Yes, I have the same issue. As with Radio Triggers, you cannot determine who made the call. The radio trigger runs once for EVERYONE. You'll have to make it an add action, and change up the script a little. If you want everyone to have a dog, you'll have to make the script look a little more like the dogs.sqf script in my updated demo. with the embeded spawns.

CB - You'd have to update the script for that. Change East - West depending on what side, etc. make the Dog part of the AI group. etc And yes, when the dog barks, it does get louder to you. (say command - MP compatible)

Share this post


Link to post
Share on other sites

Thanks.

1) Rgr on the "attack" bit. It would be nice if there was a way to command him to attack a target, but I (somewhat) understand the limitations faced by scripting.

2) I tossed and turned in bed last night thinking that I'd have to locate the script that recruits AI squad in Domination. It was the last thing I had been looking for last night. I've asked about it in one of Xeno's threads before, but I don't think he ever saw the question.

I think my first task will be to add a "K9 handler" slot in the mission and give them the ability via an addAction. See what results that brings and maybe expand from there. I'll also look for that recruit script that Xeno has hidden in there somewhere (I've looked for it for months...wanted to add an AI pilot recruit....it's escaped me for months).

Thanks again, BigDaddy

Share this post


Link to post
Share on other sites

Well, again, you don't have to do a k9 handler, you could add the action to everyone. or just place it at a dog house :) You'd just have to change the script to where it was closer to the dogs.sqf format. (dogs.sqf I removed blitzy and gave it the ability to have many)

With the "dog house" just remember, dog's cannot get into a vehicle. (we could try attachto for some National Lampoon Vacation action)

The problem is that it joins the "Players Group" so if your not the squad leader, you can't control it. Hmm.. Does somebody know about 'formation' leader? I think you can still be in a squad, and control your 'formation'?

Share this post


Link to post
Share on other sites

Rgr all.

I like the dog house concept, but it wouldn't lend itself to our mission types (unless I could figure out how to get the dog to use fast travel/vehicles/etc). We have to be able to summon the K9 in the field.

I have seen the use of attachTo in another K9 project (but they had a dedicated vehicle assigned to transport the beast)

qRJudUu6OfM

I'll stick with the addAction for now and give it to everybody. It should work just fine (all of our slots are leader positions). And I'll keep sifting thru Xeno's scripts in hopes of one day finding the recruit barracks code.

Share this post


Link to post
Share on other sites

Don't know what your looking for.. but a simple search in files for __AI__ will tell you everything that he adds in his AI map..

Here's the addactions for the AI Hut.. what specifically are you looking for?

#ifdef __AI__
[] spawn {
waitUntil {!isNil "AI_HUT"};
AI_HUT allowDamage false;
player reveal AI_HUT;
if (!(isNil "AI_HUT")) then {
	if (!(__ACEVer)) then {
		AI_HUT addAction["Recruit Soldier","x_scripts\x_addsoldier.sqf","%1_Soldier"];
		AI_HUT addAction["Recruit AT Soldier","x_scripts\x_addsoldier.sqf","%1_Soldier_AT"];
		AI_HUT addAction["Recruit Medic","x_scripts\x_addsoldier.sqf","%1_Soldier_Medic"];
		AI_HUT addAction["Recruit MG Gunner","x_scripts\x_addsoldier.sqf","%1_Soldier_MG"];
		if (d_own_side in ["WEST","GUER"]) then {
			AI_HUT addAction["Recruit Sniper","x_scripts\x_addsoldier.sqf","%1_SoldierS_Sniper"];
		} else {
			AI_HUT addAction["Recruit Sniper","x_scripts\x_addsoldier.sqf","%1_Soldier_Sniper"];
		};
		AI_HUT addAction["Recruit AA Soldier","x_scripts\x_addsoldier.sqf","%1_Soldier_AA"];
		AI_HUT addAction["Recruit Specop","x_scripts\x_addsoldier.sqf","Specop"];     
		AI_HUT addAction["Dismiss AI","x_scripts\x_dismissai.sqf"];
	} else {
		AI_HUT addAction["Recruit Soldier","x_scripts\x_addsoldier.sqf","ACE_Soldier%1B"];
		AI_HUT addAction["Recruit AT Soldier","x_scripts\x_addsoldier.sqf","ACE_Soldier%1AT"];
		AI_HUT addAction["Recruit Medic","x_scripts\x_addsoldier.sqf","ACE_Soldier%1Medic"];
		AI_HUT addAction["Recruit MG Gunner","x_scripts\x_addsoldier.sqf","ACE_Soldier%1MG"];
		AI_HUT addAction["Recruit Sniper","x_scripts\x_addsoldier.sqf","ACE_Soldier%1Sniper"];
		AI_HUT addAction["Recruit AA Soldier","x_scripts\x_addsoldier.sqf","ACE_Soldier%1AA"];
		AI_HUT addAction["Recruit Specop","x_scripts\x_addsoldier.sqf","Specop"];
		AI_HUT addAction["Dismiss AI","x_scripts\x_dismissai.sqf"];
	};
	_marker_name = "Recruit_x";
	[_marker_name, position AI_HUT,"ICON","ColorYellow",[0.5,0.5],"Recruit Barracks",0,"mil_dot"] call XfCreateMarkerLocal;
};
};

x_addsoldier.sqf

// by Xeno
private ["_type_soldier","_units","_ai_counter","_ai_side_char","_ai_side_unit"];
#include "x_setup.sqf"

_type_soldier = _this select 3;

d_grp_caller = group player;
if (player != leader d_group_caller) exitWith {
"You are currently not a group leader, no AI available. Create a new group" call XfHQChat;
};
_units = units d_grp_caller;

#ifdef __RANKED__
_rank = rank player;
if (_rank == "PRIVATE") exitWith {
(format ["You current rank is private. You can't recruit soldiers!", max_ai]) call XfHQChat;
};

if (score player < ((d_points_needed select 0) + (d_ranked_a select 3))) exitWith {
(format ["You can't recruit an AI soldier, costs %2 points, your current score (%1) will drop below 10!", score player,d_ranked_a select 3]) call XfHQChat;
};

_max_rank_ai = (
switch (_rank) do {
	case "CORPORAL": {3};
	case "SERGEANT": {4};
	case "LIEUTENANT": {5};
	case "CAPTAIN": {6};
	case "MAJOR": {7};
	case "COLONEL": {8};
}
);
_ai_counter = 0;
{
if (!isPlayer _x && alive _x) then {_ai_counter = _ai_counter + 1};
} forEach _units;
if (_ai_counter == _max_rank_ai) exitWith {
(format ["You allready have %1 AI soldiers under your control, it is not possible to recruit more with your current rank...", _max_rank_ai]) call XfHQChat;
};
// each AI soldier costs score points
["d_pas", player, (d_ranked_a select 3) * -1] call XSendNetStartScriptServer;
#else
_ai_counter = 0;
{
if (!isPlayer _x && alive _x) then {_ai_counter = _ai_counter + 1};
} forEach _units;
if (_ai_counter == max_ai) exitWith {
(format ["You allready have %1 AI soldiers under your control...", max_ai]) call XfHQChat;
};
#endif

_ai_side_char = (
switch (d_own_side) do {
	case "GUER": {"GUE"};
	case "WEST": {"USMC"};
	case "EAST": {"RU"};
}
);

#ifndef __ACE__
_ai_side_unit = (
if (_type_soldier == "Specop") then {
	switch (d_own_side) do {
		case "GUER": {"GUE_Soldier_Sab"};
		case "WEST": {"FR_Sapper"};
		case "EAST": {"RUS_Soldier_Sab"};
	}
} else {
	format [_type_soldier, _ai_side_char]
}
);
#else
_ai_side_unit = (
if (_type_soldier == "Specop") then {
	switch (d_own_side) do {
		case "GUER": {"ACE_SoldierB_INS"};
		case "WEST": {"ACE_SoldierWDemo_A"};
		case "EAST": {"ACE_SoldierEDemo_SNR"};
	}
} else {
	format [_type_soldier, _ai_side_char]
}
);
#endif

_unit = d_grp_caller createUnit [_ai_side_unit, position AISPAWN, [], 0, "FORM"];
[_unit] join d_grp_caller;
_unit setSkill 1;
_unit setRank "PRIVATE";
_unit addEventHandler ["killed", {[_this select 0] execVM "x_scripts\x_deleteai.sqf";}];

if (true) exitWith {};

Edited by Big_Daddy

Share this post


Link to post
Share on other sites

Thanks! I had found the code int the x_addsoldier.sqf but couldn't find what was calling it. AI_hut appears to be exactly was looking for.

Basically, I *was* going to recruit Blitzy as one of the eight available AI squadmembers in Domination. But thinking about it this morning, that won't work (since Blitzy won't teleport/HALO/or ride in vehicles). Spawning him at base isn't a good solution (he needs to be spawned in the field).

So just to keep it simple, I think I'll do as you suggested and cal him via addAction.

*note: I have also been looking to add AI pilots to our mission and you've shown me where I need to do that. Thanks again!

Share this post


Link to post
Share on other sites

And as far as adding the ability to getinto vechicles. They basically created an addon (not script) that completed the dog's actions (get into vehicle for example) Since I've just started scripting, I'm not to that point yet.

By creating a new "dog" (using the in game textures if you like) and rewriting the dog's FSM's you could create a fully functional k-9 unit. Again, above my pay scale at the moment..

Share this post


Link to post
Share on other sites

Rgr that. Anything I do to the missions that my group runs has to be limited to scripting. We have a "no mods" rule on our dedicated server (long story). So anytime I can pick up something cool like this, it means alot.

I figure there might be some way to stuff him into the back of a Humvee (via attachTo) but it still limits his transport to a specific vehicle. I'm no coder (my programming skills are limited to "scroll, cut, paste"). ;)

Just spawning Blitzy in the field is the better solution for my situation, anyway.

Share this post


Link to post
Share on other sites

Somebody on the server last night asked last night about why Blitzy won't attack a specific target. Today I keep starting to type out an explaination, and then get sidetracked pondering what I *think* I know about it....

How does one script a fur-covered Maverick missle (without the use of a mod)? I watch BigDaddy's script execute and I think there has to be a way to do it via scripting.

I know the existing FMS file likely would need to be re-done (thus making it a mod). I was never very good at the whole "there is no spoon" thing...... ;)

Edited by Thirdup

Share this post


Link to post
Share on other sites

without a mod?

We'd have to a bunch of scripting (luckily i've already done it in a Tomahawk script I've made..

You'd have to use an addaction, since the attack function tries to read the dog's config. Which isn't complete. Possibly, if somebody came up with a knife mod?

So you'd add an action Attack target whatever.

use screentoworld to find the nearest enemy "MAN" and set that as the dog's move to target. and wala.

This is how I get a screentoworld object..

_worldpos = screentoworld [0.5,0.5];
_cone = "RoadCone" createVehicle _worldpos;
_obj= position _cone nearEntities ["man",10];
deletevehicle _cone;
_mtarget = objnull; 
_mtarget = _obj select 0;

With _mtarget you now have the targets name, by changing the code, you can have blitzy hone into _mtarget instead of the closest person, and eventually, he'll get to the target.

Share this post


Link to post
Share on other sites

Just tried it .. EXCELLENT! I Love those wild killer dogs!! And the scream is orginal! :)

The only question I have and I hope there is answer .. how do you get a pack of these wild dogs attached to an enemy group that is hunting you?? Any tips to achieve that are highly appreciated!

Great work!

Share this post


Link to post
Share on other sites
Just tried it .. EXCELLENT! I Love those wild killer dogs!! And the scream is orginal! :)

The only question I have and I hope there is answer .. how do you get a pack of these wild dogs attached to an enemy group that is hunting you?? Any tips to achieve that are highly appreciated!

Great work!

cant u group them to a unit?:o i dont know

and guys really great work specially big daddy good job man

now for a noob like me what i will do to add the evil dogs to my map editor?

Share this post


Link to post
Share on other sites

In case I didn't give credit.. The scream was added to Norrin's killer bunny script by Karmichael

heh.. sure. once the dog/dogs (using modified dogs.sqf) is created you can attach it to any group.Only problem with using an AI "dog" with an AI "leader" is the leader will issue commands to the dog to flank, stop, use ammo, etc etc. which will circumvent any move commands the script issues it.

A person issues the dog a move command, and if the dog "sniffs" out something to attack, you don't tell it to stop, get back into formation etc. Well the AI does that. And does it frequently. (every have an AI squad leader? they tell you everything, like rearm at dead soldier, use mounted machine gun, etc)

You could decrease the sleep time from 10 seconds to say 2, still leaving plenty of cpu cycles open. and every time the AI leader issues a return to formation command, the script will 'belay' that order.

Share this post


Link to post
Share on other sites

now for a noob like me what i will do to add the evil dogs to my map editor?

Share this post


Link to post
Share on other sites

technically, you can't. it has to be in a script. You can add the dogs, but they are the kind that just walk around. and run when you get close to it.

You have to script them in.

I'm working on the request to add the dogs to a group, which works. but like I said, they don't track you down. The AI leader keeps them exactly where they are. So no roaming. Just nice little lines of doggies..

Share this post


Link to post
Share on other sites

Couldn't you add the "killer dogs" on a radial trigger in designated areas?

ie: some poor bastard enters an area and he is basically screwed if he's not firing blindly?

Share this post


Link to post
Share on other sites

Instead of joining dogs to AI group you can make dogs follow AI group leader? (run 10 meters infront and if enemy is within 50 meters then attack) This should resolve issue with AI issue commands?

I remember there was an old arma formation script where you controlled who went where. So a dog will follow (lead) infront of group leader which will make it look realistic.

Just an idea.

Update:

Here is the mission (by General Baron) that I was refering to with custom formation. It is an OFP mission so you will have to convert. http://www.filefront.com/14622721/formations_test_v1-5.zip

Edited by CaptainBravo

Share this post


Link to post
Share on other sites

Hey BigDaddy,

The setDamage thread reminded me of something else I was pondering the other day.

Would it be possible to have Blitzy make multiple strikes doing incremental damage instead of one big insta-kill/hit (ie: 0.3 repeated)?

In other words, an enemy player (or AI) might have a chance to fend him off with only wounds (assuming Blitzy himself is set to take damage/be killed).

Share this post


Link to post
Share on other sites

sure, just add the setdamage lines into the kill.sqf script.

setdammage 0.3

setdammage 0.6

setdammage 0.9

setdammage 1

etc...

Share this post


Link to post
Share on other sites

could you guys post an example mission of where dogs are running with AI group to hunt player?

This will benefit those who have limited scripting ability (lik me!) :o

Share this post


Link to post
Share on other sites
could you guys post an example mission of where dogs are running with AI group to hunt player?

This will benefit those who have limited scripting ability (lik me!) :o

great idea

Share this post


Link to post
Share on other sites

I don't really have anything along those lines (beyond what BigDaddy already posted as a demo for the scripts).

All that I have completed so far was to apply DB's scripts to a "highly" modified version of Xeno's "Domination West AI" that my clan tinkers with. Certain player slots can call up a K9 to run with their squad. The K9 will eventually hunt for enemy within a certain range of his handler.

What I've done would be of little value to anyone looking to see how the script works. I've dissected what BD put together and moved the scripts to the missions's "scripts" folder, the description was inserted into the existing mission's "description" file, altered the activations within the player slots in the "missions" file (all in keeping with the format of Xeno's design).

could you guys post an example mission of where dogs are running with AI group to hunt player?

I'm not sure how to go about getting an AI squad to call up a dog. It would be easy to set up dogs to hunt in PvP (where each player summons one), but I'm not sure about getting the AI to call one up.

I had a major fail trying to get the "evil dog" pack to spawn via a proximity trigger (some sort of array error).

Share this post


Link to post
Share on other sites

heh, Third.. I also highly modify Xeno's Dom map (no AI)

I can post the map where I added the pack of dogs to follow an AI group. (called the script via the init of the squad leader) And the dogs spawn just fine. But like I said, the AI squad leader doesn't let them Roam. You can even run right up to the dog (removed all ammo from the enemy AI squad) and the dog's don't attack. The AI commanding AI is too strong (or quick). This is why I haven't posted the map, it doesn't work.

I can possibly script it to where the dogs just follow the squad leader, but not actually join the squad. But I'm not good enough to script them moving forward of the squad leader.

Maybe somebody watching this tread can offer suggestions.

getdir of squad leader

get position 30 meters ahead of squad leaders direction

move dogs to that position

check to see if enemy is within "smelling" distance (no issues there)

rinse, repeat

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  

×