Jump to content
johnnyboy

JBOY Dog [v1.5 - updated 12/21/2018]

Recommended Posts

5 hours ago, Malcain said:

Great mod. Trying to integrate it in multiplayer mod, will keep you posted on the progress if I manage to.
And btw, feral dog packs are amazing. Was looking for something natural to fill the game with more threat which is not about monsters/zombies stuff.

Thanks man!  Good luck.  Let me know how it goes.  I'm about to release another mission with JBOY Dog in it, and that mission has a lot of small improvements on the dog scripts.  You might want to copy the JBOY_Dog folder out of that mission to get latest and greatest code.  Will be out within a week.

  • Like 5
  • Thanks 1

Share this post


Link to post
Share on other sites
26 minutes ago, johnnyboy said:

I'm about to release another mission with JBOY Dog in it

:icon_dj:

  • Like 2

Share this post


Link to post
Share on other sites

I just released Last Tango in Tanoa: Episode 2 Razing Cane featuring JBOY Dog.   The latest JBOY Dog scripts are in this mission.  There have been many small improvements since the last release of JBOY Dog.  So if you are using JBOY Dog scripts, you may want to unPBO this mission and take the JBOY_Dog folder from it, and replace the JBOY_Dog folder in any mission where you are using the script.  I know I need to release a new version of JBOY_Dog with all the new stuff in it, but I don't know when that will happen.

 

And try my new mission and rate it on Steam to show your support for JBOY_Dog!  Thanks.

  • Like 5
  • Thanks 3

Share this post


Link to post
Share on other sites

Using this to avoid feral dogs to endlessly chase the player, but you may end up with a better solution:
_dogTgt = _nearTargets select 0;
waituntil {sleep .5; ({alive _x} count _packMembers == 0 )|| ({alive _x} count _nearTargets) == 0 ||(_pack getVariable "vMovementType") == "roam"  || _packLeader distance _dogTgt > 150 };


Trying feral dogs on dedicated. The only critical issue I'm having a hard time with - feral dogs will run forever directly where they are faced.. the dog will aggro and attack the player only if the player comes within attack range of the dog, but won't chase the player.
Something is broken within their path loops, no matter if roaming or attack, tried both so far :C

  • Like 1

Share this post


Link to post
Share on other sites
14 hours ago, Malcain said:

Using this to avoid feral dogs to endlessly chase the player, but you may end up with a better solution:
_dogTgt = _nearTargets select 0;
waituntil {sleep .5; ({alive _x} count _packMembers == 0 )|| ({alive _x} count _nearTargets) == 0 ||(_pack getVariable "vMovementType") == "roam"  || _packLeader distance _dogTgt > 150 };

I like it.   Good idea.  BTW, its a shame the run speed of dog is slower than mans though.  setAnimCoeff doesn't work on animals, so can't make them faster that way.    Edit:  Another idea for ending the chase would be a time out.  I remember seeing in @Vandeanson's bandit camp video he climbed up onto the roof of a shack and the dogs all circled around below him (which is great), but maybe they should get bored after 5 minutes or so and leave.

 

14 hours ago, Malcain said:

Trying feral dogs on dedicated. The only critical issue I'm having a hard time with - feral dogs will run forever directly where they are faced.. the dog will aggro and attack the player only if the player comes within attack range of the dog, but won't chase the player.
Something is broken within their path loops, no matter if roaming or attack, tried both so far :C

Just a guess, but perhaps multiple command loops are running for a dog (server + n clients), so each dog is getting multiple animations executed without time for their path AI (which is BIS code) to turn them?

 

Thanks for taking this on dude!

  • Like 2

Share this post


Link to post
Share on other sites

@Vandeanson if you want to control dogs via script, all the commands that are available to a player handler are available to a scripter (sort of an API).  For example, in the opening scene of Last Tango in Tanoa 2:  Razing Cane, the dog is in the back of the truck and the player is interacting with AI.  Later an AI attacks player, and I script the dog acting on his own to defend player without player commanding the dog via dog menu.  This is how its done:

 

dog1 setVariable ["vSilentCommand",true,true]; // Controls whether says the command out load.  When false it looks like dog does action on his own.
dog1 setVariable ["vCommand", 'getout', true]; // Dog exits vehicle
sleep 2;
dog1 setVariable ["vTarget", someDude, true];      // give dog a target ai object
dog1 setVariable ["vCommand", 'attack', true];     // command dog to attack
sleep 2;
dog1 setVariable ["vSilentCommand",false,true]; // turn on voice command

You can use logic similar to the above for an AI dog handler to command his dog to attack an enemy that it has sensed.  Spawn a loop on the dog that looks for this variable:

dog1 getVariable "vTarget";  // if not objNull, then dog has sensed an enemy, or handler has ordered dog to detain or attack this obj

That variable is = objNull if no enemy sensed.  If dog sensed an enemy that variable is set to the object (AI or player) that the dog detected.  Once it changes to a real unit, you can have the Handler issue an attack command via code posted above (probably without setting vSilent as you want to hear the command issued).

 

You could do this with your own code executing, or you can modify this script to do the above.  I would only auto-command dog to attack if the handler <> player. 

JBOY_DogEnemyDetectionLoop.sqf

If you take it on, I'll incorporate it in official JBOY_Dog version and credit you of course.  Good luck man.

 

Edit:  Here is the variable that controls how close an enemy must be for the dog to detect it.

_dog setVariable ["vEnemyDetectDistance", 70, true]; // Distance at which dog can detect an ememy 

The default is 70 when dog is created.  I set up trigger areas in my missions to reduce this distance when in jungles or cane fields.  You might want to do something similar if camp is created in a forest or jungle (I reduced to 45 in jungle).

  • Like 2

Share this post


Link to post
Share on other sites
On 06.11.2018 at 6:31 PM, johnnyboy said:

I like it.   Good idea.  BTW, its a shame the run speed of dog is slower than mans though.  setAnimCoeff doesn't work on animals, so can't make them faster that way.    Edit:  Another idea for ending the chase would be a time out.  I remember seeing in @Vandeanson's bandit camp video he climbed up onto the roof of a shack and the dogs all circled around below him (which is great), but maybe they should get bored after 5 minutes or so and leave.


Exactly. It really is a shame, and a shame on BIS part for not fixing their own content for years.
Any ideas on a workaround? Timer could be useful, but I don't see any reason for making it, as you can simply outrun the dogs if you want, atm.

Share this post


Link to post
Share on other sites
41 minutes ago, Malcain said:

Any ideas on a workaround? Timer could be useful, but I don't see any reason for making it, as you can simply outrun the dogs if you want, atm.

If there's lots of dogs in the pack, and you are trapped on top of shack, timer might still be useful.  Also, not all players know you can outrun dogs, and if you are carrying a heavy pack, maybe you can't outrun dogs.

 

It would be possible to setVelocityModelSpace dogs faster I guess, but might cause weird physics issues, and might look weird.

Share this post


Link to post
Share on other sites

In Shadow Fall you can only outrun dogs while all out sprinting, but when you get tired they start catching up. I released that one night video a couple years back, I had to run upstairs into a building to survive the pack. It was quite a rush. That's just using your script, I didn't modify dog speed.

  • Like 3

Share this post


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

 

You can use logic similar to the above for an AI dog handler to command his dog to attack an enemy that it has sensed.  Spawn a loop on the dog that looks for this variable:


dog1 getVariable "vTarget";  // if not objNull, then dog has sensed an enemy, or handler has ordered dog to detain or attack this obj

That variable is = objNull if no enemy sensed.  If dog sensed an enemy that variable is set to the object (AI or player) that the dog detected.  Once it changes to a real unit, you can have the Handler issue an attack command via code posted above (probably without setting vSilent as you want to hear the command issued).

 

You could do this with your own code executing, or you can modify this script to do the above.  I would only auto-command dog to attack if the handler <> player. 

If you take it on, I'll incorporate it in official JBOY_Dog version and credit you of course.  Good luck man.

  I decided to make these changes and release new version of JBoy Dog that includes this change and all incremental changes I've made since last update.  Should be done tomorrow.  Working on it now.

  • Like 3
  • Thanks 2

Share this post


Link to post
Share on other sites

looking forward to it, thanks!;)

im updating the AI equipper function of my scripts and will then start to work on additional features of the bandit camp (possibility to claim it, raids by bandits, build or move defensive structures, and some other stuff i announced on my thread) would be cool to also implement the chicken alarm, and guard dogs then as well. keeping you posted.

looking for a doghouse structure now:))

Share this post


Link to post
Share on other sites

Version 1.4 of JBOY Dog released!

The video features AI patrols with dogs that detect, warn and attack enemies.

 

Change Log:

  • Added saveLoad eventhandler to init.sqf so menu restored when player loads from saved game
  • Added red paw icon to display on dog when SITREP command issued.
  • Allow naming dog if default Boomer dog is not used
  • Added some advanced hints (you will need to include the .hpp in your description.ext as shown in example mission description.ext).
  • Improved AI control of dogs.  Dogs follow AI in Heel mode through waypoints.  When dogs detect enemies, the AI Handlers goes into combat mode and commands dog to attack.  After all known enemeies killed, AI Handler resumes  following waypoints and commands dog back into Heel mode. This is great for sentries walking a base perimeter for example.
  • Better following of handler when in Heel mode
  • Tons of small bug fixes and small improvements I can't remember.

 

Support JBOY Dog by subscribing, commenting, and rating this JBOY Dog Mission: Last Tango in Tanoa 2: Razing Cane.

 

  • Like 6

Share this post


Link to post
Share on other sites
19 minutes ago, johnnyboy said:

Version 1.4 of JBOY Dog released!

 

Change Log:

  • Added saveLoad eventhandler to init.sqf so menu restored when player loads from saved game
  • Added red paw icon to display on dog when SITREP command issued.
  • Allow naming dog if default Boomer dog is not used
  • Added some advanced hints (you will need to include the .hpp in your description.ext as shown in example mission description.ext).
  • Improved AI control of dogs.  Dogs follow AI in Heel mode through waypoints.  When dogs detect enemies, the AI Handlers goes into combat mode and commands dog to attack.  After all known enemeies killed, AI Handler resumes  following waypoints and commands dog back into Heel mode. This is great for sentries walking a base perimeter for example.
  • Better following of handler when in Heel mode
  • Tons of small bug fixes and small improvements I can't remember.

 

Support JBOY Dog by subscribing, commenting, and rating this JBOY Dog Mission: Last Tango in Tanoa 2: Razing Cane.

 

:icon_dj:..BTW...wzz up with those patrol dogs names in the demo video?  "zagor" and " grumpy old dog" ?  HAHAHAHAHAHAHAHAHAHAHAHAHA....dunno about @Grumpy Old Man...but I'm flattered bro!!

 

Ps: ceck your PM man.

  • Haha 1

Share this post


Link to post
Share on other sites
16 minutes ago, zagor64bz said:

:icon_dj:..BTW...wzz up with those patrol dogs names in the demo video?  "zagor" and " grumpy old dog" ?  HAHAHAHAHAHAHAHAHAHAHAHAHA....dunno about @Grumpy Old Man...but I'm flattered bro!!

Haha.  I was going to name one @froggyluv , but I already have a sheep rustler character with that name in my next mission.  :)

  • Thanks 1
  • Haha 2

Share this post


Link to post
Share on other sites

that was very quick turnaround:) did you skip sleep?? to honor that, i will try to implement it ASAP!

  • Haha 1

Share this post


Link to post
Share on other sites
1 hour ago, zagor64bz said:

:icon_dj:..BTW...wzz up with those patrol dogs names in the demo video?  "zagor" and " grumpy old dog" ?  HAHAHAHAHAHAHAHAHAHAHAHAHA....dunno about @Grumpy Old Man...but I'm flattered bro!!

 

Ps: ceck your PM man.

Now I have to see this video, added to my watch later list, want to see it on the big screen after work.

  • Like 2
  • Haha 1

Share this post


Link to post
Share on other sites

Alright its in, thanks a lot ;)

 

AI + Guarddog start their patrol

zEG50oF.jpg

 

fnGZtAU.jpg

 

hnaKf0F.jpg

 

You see the duos waypoint - they AI would pass me as I am out of LOS

 

But not with Wattebäusche - Wattebäusche is a good dog - hes going to wreck me! Also the tree exploded.

 

Nx7QFtu.jpg

 

So yeah, awesome, it is working and I ll do some more testing and then release it ;)

 

one question regarding the command menu:

 

I am doing something wrong , I do not see any commands

NAiTkIc.jpg

 

 I have copied the description.ext content as well as the init - i only changed the player name to player1 - any idea what could cause this?

Share this post


Link to post
Share on other sites
1 minute ago, Vandeanson said:

So yeah, awesome, it is working and I ll do some more testing and then release it ;)

Its a THOB (thing of beauty) to see my dogs patrolling those uber cool camps!   Awesome.

 

2 minutes ago, Vandeanson said:

one question regarding the command menu:

I am doing something wrong , I do not see any commands

Does your player character also have a dog?  You should only be running the create menu script from init.sqf if you create a dog for the player.   Player should not have a dog menu if he doesn't have a dog.  If player is supposed to have a dog, send me your init.sqf, and description.ext and I will take a look.

 

7 minutes ago, Vandeanson said:

Wattebäusche is a good dog - hes going to wreck me! Also the tree exploded.

"Wattebäusche",  lol.   What's that mean in English...cotton swab?   Also, I forgot to warn you that JBOY Dogs can, and often do, explode trees.

 

Share this post


Link to post
Share on other sites

Explode trees? Do I dare ask why/how? Yes.

@Vandeanson / @johnnyboy - You messed up base defines for UI? Scrollbar is uh, f*cked.

Share this post


Link to post
Share on other sites
10 minutes ago, johnnyboy said:

Its a THOB (thing of beauty) to see my dogs patrolling those uber cool camps!   Awesome.

 

Does your player character also have a dog?  You should only be running the create menu script from init.sqf if you create a dog for the player.   Player should not have a dog menu if he doesn't have a dog.  If player is supposed to have a dog, send me your init.sqf, and description.ext and I will take a look.

 

"Wattebäusche",  lol.   What's that mean in English...cotton swab?   Also, I forgot to warn you that JBOY Dogs can, and often do, explode trees.

 

 

Very cool combination of scripts indeed - thanks again! I have drafted up these AI and AI group spawners that i will use for my script.

- task defend guys that would be spawned at a camp or site to guard + 1 stationary AI+ dog

- Task  patrol guys that patrol an area + a patrol dog

- simple AI + dog patrol

- simple AI + dog guard. AI has ambient animations on

- and also a simple AI spawner

 

PS: my code needs some clean up but works.

I like the guard dog version with sit - as he will really guard the camp, i tried sneaking up on a hideout from behind the AI but the doggy notice me =D

the patrol one is cool too ofc;)

 

Spoiler

VD_AI_Spawner ={
// call with: [CenterForposFinder,minDistance,MaxDistance] call VD_AI_Spawner;
                  _SpawnPos = [_this select 0, _this select 1, _this select 2, 0.9, 0, 0.9, 0] call BIS_fnc_findSafePos;
                  _Group = createGroup east;
                  _Unit1 = _Group createUnit ["O_G_Survivor_F", _SpawnPos, [], 1, "NONE"];
                  {[_x] call VD_equipper} foreach units _Group;
                  _Group enableDynamicSimulation true;
                [_Group, _SpawnPos] call BIS_fnc_taskDefend;
                };

VD_AI_DoghandlerPatr ={
// call with: [CenterForposFinder,minDistance,MaxDistance] call VD_AI_DoghandlerPatr;
                  _SpawnPos = [_this select 0, _this select 1, _this select 2, 0.9, 0, 0.9, 0] call BIS_fnc_findSafePos;
                  _Group = createGroup east;
                  _Unit1 = _Group createUnit ["O_G_Survivor_F", _SpawnPos, [], 1, "NONE"];
                  {[_x] call VD_equipper} foreach units _Group;
                  _Group enableDynamicSimulation true;
                  [_Group,_SpawnPos,5] call BIS_fnc_taskPatrol;

                  _dmy= [_Unit1] spawn
                        {
                            params["_handler"];
                            [_handler, speaker _handler] remoteExecCall ["setSpeaker", 0];
                            sleep 1;
                            _dog = [_handler, "Fin_blackwhite_F", (_handler modelToWorld [3,4,0]), false] call JBOY_dog_create;
                            _dog setVariable ["vEnemyDetectDistance", 40, true];
                            _dmy = [_dog, _handler, 2.5] execVM "JBOY_Dog\JBOY_dogCommand.sqf";
                            sleep 1;
                            _dog setVariable ["vCommand", 'heel', true];
                        };
                };

VD_AI_DoghandlerNoMove ={
// call with: [CenterForposFinder,minDistance,MaxDistance] call VD_AI_DoghandlerNoMove;
                  _SpawnPos = [_this select 0, _this select 1, _this select 2, 0.9, 0, 0.9, 0] call BIS_fnc_findSafePos;
                  _Group = createGroup east;
                  _Unit1 = _Group createUnit ["O_G_Survivor_F", _SpawnPos, [], 1, "NONE"];
                  {[_x] call VD_equipper} foreach units _Group;
                  [_Unit1,selectrandom ["STAND","STAND_IA","SIT_LOW","KNEEL","LEAN","WATCH","WATCH1","WATCH2"]] call BIS_fnc_ambientAnimCombat;
                  _Group enableDynamicSimulation true;
                  _dmy= [_Unit1] spawn
                        {
                            params["_handler"];
                            [_handler, speaker _handler] remoteExecCall ["setSpeaker", 0];
                            sleep 1;
                            _dog = [_handler, "Fin_blackwhite_F", (_handler modelToWorld [3,4,0]), false] call JBOY_dog_create;
                            _dog setVariable ["vEnemyDetectDistance", 40, true];
                            _dmy = [_dog, _handler, 2.5] execVM "JBOY_Dog\JBOY_dogCommand.sqf";
                            sleep 1;
                            _dog setVariable ["vCommand", 'stay', true];
                        };
                };



  VD_AI_SpawnerGroupTaskDef = {
// call with: [CenterForposFinder,minDistance,MaxDistance] call VD_AI_SpawnerGroupTaskDef;
        _AISpawn = [_this select 0, _this select 1, _this select 2, 0.9, 0, 0.9, 0] call BIS_fnc_findSafePos;
          _bandits1 = createGroup east;
          _bandit1 = _bandits1 createUnit ["O_G_Survivor_F", _AISpawn, [], 1, "NONE"];
          if (100 >= (random 100)) then {_bandit2 = _bandits1 createUnit ["O_G_Survivor_F", _AISpawn, [], 1, "NONE"];};
          if (100 >= (random 100)) then {_bandit3 = _bandits1 createUnit ["O_G_Survivor_F", _AISpawn, [], 1, "NONE"];};
          if (50 >= (random 100)) then {_bandit4 = _bandits1 createUnit ["O_G_Survivor_F", _AISpawn, [], 1, "NONE"];};
          if (50 >= (random 100)) then {_bandit5 = _bandits1 createUnit ["O_G_Survivor_F", _AISpawn, [], 1, "NONE"];};
          if (50 >= (random 100)) then {_bandit6 = _bandits1 createUnit ["O_G_Survivor_F", _AISpawn, [], 1, "NONE"];};

          [_bandits1, _AISpawn] call BIS_fnc_taskDefend;
          {[_x] call VD_equipper} foreach units _bandits1;

          _Group = createGroup east;
          _Unit1 = _Group createUnit ["O_G_Survivor_F", _AISpawn, [], 1, "NONE"];
          {[_x] call VD_equipper} foreach units _Group;
          [_Unit1,selectrandom ["STAND","STAND_IA","SIT_LOW","KNEEL","LEAN","WATCH","WATCH1","WATCH2"]] call BIS_fnc_ambientAnimCombat;
          _Group enableDynamicSimulation true;
          _dmy= [_Unit1] spawn
                {
                    params["_handler"];
                    [_handler, speaker _handler] remoteExecCall ["setSpeaker", 0];
                    sleep 1;
                    _dog = [_handler, "Fin_blackwhite_F", (_handler modelToWorld [3,4,0]), false] call JBOY_dog_create;
                    _dog setVariable ["vEnemyDetectDistance", 40, true];
                    _dmy = [_dog, _handler, 2.5] execVM "JBOY_Dog\JBOY_dogCommand.sqf";
                    sleep 1;
                    _dog setVariable ["vCommand", 'stay', true];
                };

        };

VD_AI_SpawnerGroupTaskPatr= {
// call with: [CenterForposFinder,minDistance,MaxDistance,DistBetwWaypoints] call VD_AI_SpawnerGroupTaskPatr;
      _AISpawn = [_this select 0, _this select 1, _this select 2, 0.9, 0, 0.9, 0] call BIS_fnc_findSafePos;
        _bandits1 = createGroup east;
        _bandit1 = _bandits1 createUnit ["O_G_Survivor_F", _AISpawn, [], 1, "NONE"];
        if (50 >= (random 100)) then {_bandit2 = _bandits1 createUnit ["O_G_Survivor_F", _AISpawn, [], 1, "NONE"];};
        if (50 >= (random 100)) then {_bandit3 = _bandits1 createUnit ["O_G_Survivor_F", _AISpawn, [], 1, "NONE"];};
        if (5 >= (random 100)) then {_bandit4 = _bandits1 createUnit ["O_G_Survivor_F", _AISpawn, [], 1, "NONE"];};
        if (5 >= (random 100)) then {_bandit5 = _bandits1 createUnit ["O_G_Survivor_F", _AISpawn, [], 1, "NONE"];};
        if (5 >= (random 100)) then {_bandit6 = _bandits1 createUnit ["O_G_Survivor_F", _AISpawn, [], 1, "NONE"];};


        {[_x] call VD_equipper} foreach units _bandits1;
        [_bandits1, _this select 0, _this select 3] call BIS_fnc_taskPatrol;
        _dmy= [_bandit1] spawn
              {
                  params["_handler"];
                  [_handler, speaker _handler] remoteExecCall ["setSpeaker", 0];
                  sleep 1;
                  _dog = [_handler, "Fin_blackwhite_F", (_handler modelToWorld [3,4,0]), false] call JBOY_dog_create;
                  _dog setVariable ["vEnemyDetectDistance", 40, true];
                  _dmy = [_dog, _handler, 2.5] execVM "JBOY_Dog\JBOY_dogCommand.sqf";
                  sleep 1;
                  _dog setVariable ["vCommand", 'heel', true];
              };
      };

 

 

 

An yeah, its something like that cotton swab.... pretty brutal right?!

ah damn, we need tree armor now.

 

Yeah i assigned him a variable name and passed that to the script - the dog spawns as "unknown"

here are the two files (my player is called player1)

init:

Spoiler

if (!isserver) exitWith {};

execVM "VD_Settings.sqf";
//if(!isServer) then {waitUntil{!isNull player}};
// **************************************************************************
// BEGIN OF JBOY DOG INIT.SQF CODE
// *************************************************************************// **************************************************************************
// Compiles all JBOY Dog scripts and initializes some settings
// **************************************************************************
call compile preprocessFileLineNumbers "JBOY_Dog\JBOY_DogInit.sqf";

//if jip player and not server then exit
//_JIPplayer = not isServer && isNull player;
//if (_JIPplayer) exitwith {};

// **************************************************************************
// Add dog menu to player.  In this example mission, the player unit is named player1 in the editor.
// **************************************************************************
_dogMenu = [player1] spawn {params["_handler"];sleep 2; _d=[_handler] call JBOY_fnc_DogDisplayEH;};
saveLoad = addMissionEventHandler ["Loaded",{
[player1] spawn {params["_handler"];sleep 2; _d=[_handler] call JBOY_fnc_DogDisplayEH;}
}];

// **************************************************************************
// Create a dog, assign a named handler unit to him, and place the dog next to handler.
// The var _dog now references this newly created dog.
// If 4th parameter=true, then voice commands will use my voice commanding Boomer.
// If 4th parameter=false, then voice commnads will use generic ARMA voice commands to command dog.
// **************************************************************************
_dog = [player1, "Fin_tricolour_F", (player1 modelToWorld [2,2,0]), true] call JBOY_dog_create;  // Create dog. 4th parameter true means use Johnnyboy voice for commands.

// **************************************************************************
// Start command listener for the dog and handler pair.
// **************************************************************************
nul = [_dog, player1, 2.5] execVM "JBOY_Dog\JBOY_dogCommand.sqf";
// **************************************************************************
// Set variable to allow other units to take control of dog if dog's handler is killed.  Remove this line if you do not want that.
// **************************************************************************
sleep 1; // allow time for some dog variables to get set before doing next few calls
_dog setVariable ["vOtherHandlers",(units group player1) - [player1],true];  // Define array of potential handlers who may take control of dog when current handler killed

//* **************************************************************************
// If you want dogs to track units then do this:
// =============================================
// 1. In the Editor, create a unit to be tracked, and give the unit waypoints to move through.
// 2. Put this line in Unit's init line in the editor (or call it from somewhere else):
//  _dmy = [this] spawn {params["_fugitive"]; sleep 2; _dmy=[_fugitive] call JBOY_dogPreyInit;};
// Note: The tanoan thug near the flag pole in this mission has this statement in his init, and he will make a trail

// **************************************************************************
// Start loop for dog to detect scent trails
// **************************************************************************
_dmy = [_dog] spawn {params["_dog"]; sleep 1; _d=[_dog] call JBOY_DogScentDetectionLoop;};


/* **************************************************************************
How to have a dog follow an AI handler:
THIS V1.4 SAMPLE MISSION NOW HAS A SENTRY AI NAMED sentry1 DOING EXACTLY THIS, AND WALKING WAYPOINTS UNTIL DOG SENSES ENEMY.
======================================
1. Create an AI unit, name him, and give him move waypoints.  Speed set to Limited works best for keeping dog close to handler.
2. Paste the code below into the unit's init field.  In this case I am giving him 2 dogs. (one named Zagor, and one named GrumpyOldDog).
3. This example reduces enemy detection distance down to 40 meters instead of default of 70 meters
4. Also in code below you see I named the dog "Zagor".  For non-boomer dogs, you can now name the dog to another name.
5. I also decided to make this handler french, so he commands his two dogs in French

_dmy= [this] spawn
{
    params["_handler"];
 [_handler, "Male04FRE"] remoteExecCall ["setSpeaker", 0];
    sleep 1;
    _dog = [_handler, "Fin_blackwhite_F", (_handler modelToWorld [3,4,0]), false] call JBOY_dog_create;
 _dog setVariable ["vEnemyDetectDistance", 40, true];
    _dmy = [_dog, _handler, 2.5] execVM "JBOY_Dog\JBOY_dogCommand.sqf";
 _dog setVariable ["vDogName", "Zagor", true];
 sleep 1;
    _dog setVariable ["vCommand", 'heel', true];
};

_dmy= [this] spawn
{
    params["_handler"];
 [_handler, "Male04FRE"] remoteExecCall ["setSpeaker", 0];
    sleep 1;
    _dog = [_handler, "Alsatian_Sandblack_F", (_handler modelToWorld [3,4,0]), false] call JBOY_dog_create;
 _dog setVariable ["vEnemyDetectDistance", 40, true];
    _dmy = [_dog, _handler, 2.5] execVM "JBOY_Dog\JBOY_dogCommand.sqf";
 _dog setVariable ["vDogName", "GrumpyOldDog", true];
 sleep 1;
    _dog setVariable ["vCommand", 'heel', true];
};

*****************************************************************************/

// **************************************************************************
// Uncomment the following lines to create some animals for dog to attack and fetch.
// **************************************************************************
/*
R1 = createAgent ['Rabbit_F', player modelToWorld [0,30,0], [], 0, "NONE"];
R2 = createAgent ['Rabbit_F', player modelToWorld [2,30,0], [], 0, "NONE"];
R3 = createAgent ['Rabbit_F', player modelToWorld [-2,30,0], [], 0, "NONE"];
C1 = createAgent ['Cock_random_F', player modelToWorld [3, 20, 0], [], 0, "NONE"];
C2 = createAgent ['Cock_white_F', player modelToWorld [0, 20,0], [], 0, "NONE"];
{[_x] execVM "JBOY\addBirdDamageEH.sqf";}   foreach [R1,R2,R3]; // add feather effect to chickens when shot
{nul = [_x,true] execVM "JBOY\JBOY_animalScatter.sqf";} foreach [R1,R2,R3,C1,C2]; // rabbits will scatter when dog or man near.
S1 = createAgent ['Snake_random_F', player modelToWorld [3, 10, 0], [], 0, "NONE"];
S2 = createAgent ['Snake_random_F', player modelToWorld [1, 12, 0], [], 0, "NONE"];
*/

// **************************************************************************
// To spawn a feral dog pack, place a trigger on the map, and name it dogPackTrigger1.
// Then paste the code below into that trigger.
// Make trigger radius 400 x 400 (or larger...you don't want player to see pack spawn)
// Make trigger activated by anybody present
// **************************************************************************
/*
_dmy=[] spawn
{
    _pos = getpos dogPackTrigger1;
    _followerDogTypes = ["Fin_blackwhite_F","Fin_ocherwhite_F","Fin_tricolour_F","Alsatian_Black_F","Alsatian_Sandblack_F"];
    _pack = [_pos, 7, "Alsatian_Sand_F", _followerDogTypes, 50] call JBOY_dogPackCreate;
};
*/
hint "Use T key to see dog command menu.  Move towards red flag pole if you want dog to detect a scent trail.  In the editor, look at the unit init of the unit by the flag pole for the code that stars dropping a scent trail.
To spawn a dog pack walk on to the runway.  Look at the code in trigger covering runway to see how to spawn the dog pack.";
// **************************************************************************
// END OF JBOY DOG INIT.SQF CODE
// **************************************************************************

description

Spoiler




respawn = 3;				  // 0 = none. 1 = bird. 2 = instant where died. 3 = base or respawn_INDEPENDENT marker. 4 = respawn with team, or bird. 5 = into AI or bird.
respawndelay = 3;            // Delay prior to respawn
respawnVehicleDelay = 0;      // Delay prior to respawn
respawnDialog = 0;            // default = 1. show respawn timer and scoreboard when killed.
respawnOnStart = 1;
respawnButton = -1;
enableDebugConsole = 1;	      // 0 = disabled. 1 = admins, 2 = everybody. 0 is recommended in MP.
allowFunctionsLog = 1;
disabledAI=1;				  // No AI in playable units
respawnTemplates[] = {"MenuPosition"};
//____________________________________________________

corpseManagerMode = 1;
corpseLimit = 60;
corpseRemovalMinTime = 900;
corpseRemovalMaxTime = 1500;

wreckManagerMode = 1;
wreckLimit = 30;
wreckRemovalMinTime = 900;
wreckRemovalMaxTime = 1500;

//____________________________________________________

author = "    V A N D E A N S O N";
OnLoadName = "Dynamic Script Pack";
onLoadMission = "V e r s i o n    2 . 2 Enjoy";
loadScreen =  "VD.jpg";


class Header
{
 gameType = COOP;
 minPlayers = 1;
 maxPlayers = 7;
};

	#include "JBOY_Dog\Dialog\Common.hpp"
	#include "JBOY_Dog\Dialog\JBOY_gui_Dog.hpp"

class RscTitles
{
	#include "JBOY_Dog\Dialog\Common.hpp"
	#include "JBOY_Dog\Dialog\JBOY_gui_Dog.hpp"
};

class CfgHints
{
   #include "JBOY_Dog\JBOY_Dog_Hints.hpp"
};

class CfgSounds
{
    #include "JBOY_Dog\Sounds\JBOY_Dog_Sounds.hpp"
};

 

 

 

Share this post


Link to post
Share on other sites
1 hour ago, johnnyboy said:

Its a THOB (thing of beauty) to see my dogs patrolling those uber cool camps!   Awesome.

you should see them guard hideouts.... so chilled=D

 

 

RDc0e8F.jpg

 

  • Like 1

Share this post


Link to post
Share on other sites
9 minutes ago, Vandeanson said:

Yeah i assigned him a variable name and passed that to the script - the dog spawns as "unknown"

here are the two files (my player is called player1)

Those 2 files look clean to me.  No idea what's wrong.  Maybe you can zip your whole editor mission directory for me, and I can take a look at it.  I'm taking off for the evening, so may not look at it until tomorrow.

 

3 minutes ago, Vandeanson said:

you should see them guard hideouts.... so chilled=D

Very cool.

 

14 minutes ago, HazJ said:

Explode trees? Do I dare ask why/how? Yes.

Just joking brother.  I haven't coded the explosive dog urine script yet.

  • Haha 3

Share this post


Link to post
Share on other sites
3 hours ago, johnnyboy said:

 

Just joking brother.  I haven't coded the explosive dog urine script yet.

 

Is that for breaching barriers / doors?

  • Haha 1

Share this post


Link to post
Share on other sites
9 hours ago, johnnyboy said:

Those 2 files look clean to me.  No idea what's wrong.  Maybe you can zip your whole editor mission directory for me, and I can take a look at it.  I'm taking off for the evening, so may not look at it until tomorrow.

no worries, will have a detailed look later on and get back if i continue to fail.

for now  ill focus on the feral dog pack and guard/patrol dog Implementation.

Share this post


Link to post
Share on other sites

@Vandeanson I keep seeing the black and white dog.  I'm guessing you want random dog types for your spawns.  Here's how to do it:

    _randomDog = selectRandom ["Fin_blackwhite_F","Fin_ocherwhite_F","Fin_tricolour_F","Alsatian_Sand_F","Alsatian_Black_F","Alsatian_Sandblack_F"];
    _dog = [_handler, _randomDog, (_handler modelToWorld [3,4,0]), false] call JBOY_dog_create; 

 

  • Like 1

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

×