Jump to content
johnnyboy

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

Recommended Posts

6 hours ago, johnnyboy said:

@LSValmont  Hey buddy, woke up early so took a look.  In your while loop you are executing a playMove on the dog on every iteration.  Animals work funny, so you only want to execute the playMove one time and the dog repeats that move forever until you playMove a different move.  So if you want the dog to follow you playMove Run animation only once, and give him new moveTo position commands.  He will keep running and move to each new position.  When you finally want him to stop you playMove Stop animation once and he stops.  Then playMove Run again to get him to run.  Your current code is giving him a million playMoves so he's going  crazy.   Here's how to fix that:

Thank you so much Johnny!

 

It mostly works now... the only remaining issue is that the dog starts to circle around its target when he gets close to them instead of going straight for them. Eventually they reach their target but it takes a lot of time.

 

Also, after dealing with their targets they sometimes return to their owner (as the code suggests) but sometimes they just continue circling around their target.

 

PS: The AI doesn't seem to see dogs as enemies... how did you get around that?

Share this post


Link to post
Share on other sites
8 minutes ago, LSValmont said:

PS: The AI doesn't seem to see dogs as enemies... how did you get around that?

I attached invisible targets to dogs, and reveal the targets to the near AI (which make them target it) and run loops forcing them to fire with useWeapon command.  You can look at JBOY Dog scripts.  I know that is daunting as there is a ton of code, and not all of it is easy to read.  But I don't have time to isolate exact code to work for you, so if you want it, you will have to work for it a bit.

 

10 minutes ago, LSValmont said:

It mostly works now... the only remaining issue is that the dog starts to circle around its target when he gets close to them instead of going straight for them. Eventually they reach their target but it takes a lot of time.

Look at my script JBOY_dogCommand.  Its a monster, but if you just focus on the code in the FOLLOW/HEEL command section you should be able to understand it.  Just ignore stuff you don't care about (like If "swimming", etc.).  Previously I used the doMoves like you are for making dog follow unit.  But I discovered later that doFollow worked, and dog stayed much closer to unit.  So you may be able to use doFollow for the heel case.  And you still use your "distance from unit" checks to modify the dog's animations (Sprint when far away, then Run when closer, then Walk when closest, and maybe Stop if close and unit being followed is stopped).

 

Here's the banner/header for the section of code you want to look at in JBOY_DogCommand.  Just the code under this IF IN HEEL MODE if statement:

while {(alive _dog)} do
{ //main loop
   _handler = _dog getVariable "vHandler";
   //*******************************************************************************************************************
   //********** FOLLOW/HEEL *********** FOLLOW/HEEL ************** FOLLOW/HEEL ************** FOLLOW/HEEL *************
   //*******************************************************************************************************************
   if ((_dog getVariable "vCommand") == "follow" or (_dog getVariable "vCommand") == "heel" and (alive _handler)) then
   {

 

11 minutes ago, LSValmont said:

By the way, I don't claim ownership of the script so if you wan't to release it as a simple MP alternative to JBOY dog, something like "JBOY dog Patrol" or "JBOY dog MP lite" it is fine by me and would fill a nitche that is constantly bothering you with MP compatibility!

Thanks man, but I have too many projects going, so doubt I'll take that on.

 

11 minutes ago, LSValmont said:

I feel like all I am not getting exactly right is perhaps the sleeps?

Look at heel code and use doFollow like suggested above.  Also maybe adjust your sleeps to match how JBOY_DocCommand does sleeps.

  • Thanks 1

Share this post


Link to post
Share on other sites

So I took a look at your approach using the doFollow command and peeked inside your JBOY_dogCommand script and also the useWeapon command and oh boy that was some complex but cleaver use of code.

 

Sadly I am aiming at using a far simpler approach and believe it or not I fixed most of the problems with the behavior of the Dogs with the disableAI "ALL"; command. With that the dogs suddenly started obeying the script's commands.

 

Of course even if I will not be using your most complex snippets of code that doesn't mean your input wasn't KEY to making the whole script work like it should.

 

I will be releasing the script here on the forums after a few more testing.

 

Thank you again Johnny.

  • Like 1

Share this post


Link to post
Share on other sites

Johnny, just wanted update you about the script we were working on today:

 

It is released today thanks to you!

  • Like 3

Share this post


Link to post
Share on other sites

Hi, first im sorry, i know that this question was answered to Zagor but  for using Feral Dog Packs only (i dont want to start my mission with a dog ) , how exactly the .init file must be edit.  I have to put only this code bellow and delete all the codes of the .init or i have to add this at some parts of the .init (what parts should i kept)

 

 

// ************************** // Create game logic used by JBOY_AIFightsDogs.sqf to force AI to fire weapon **************************************************************************

JBOYDogLogicCenter = createCenter sideLogic;

JBOYDogLogicGroup = createGroup JBOYDogLogicCenter;

JBOYDogGameLogic = JBOYDogLogicGroup createUnit ["Logic", [0,0,0], [], 0, "NONE"];

 

 

Thanks.

Share this post


Link to post
Share on other sites
20 hours ago, Argmax said:

Hi, first im sorry, i know that this question was answered to Zagor but  for using Feral Dog Packs only (i dont want to start my mission with a dog ) , how exactly the .init file must be edit.  I have to put only this code bellow and delete all the codes of the .init or i have to add this at some parts of the .init (what parts should i kept)

 

 

// ************************** // Create game logic used by JBOY_AIFightsDogs.sqf to force AI to fire weapon **************************************************************************

JBOYDogLogicCenter = createCenter sideLogic;

JBOYDogLogicGroup = createGroup JBOYDogLogicCenter;

JBOYDogGameLogic = JBOYDogLogicGroup createUnit ["Logic", [0,0,0], [], 0, "NONE"];

 

 

Thanks.

 

Is your mission Multiplayer or Singleplayer?

Share this post


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

 

Is your mission Multiplayer or Singleplayer?

Hi thanks for reply, my mission is Single Player and i solved it with vDog Feral Scripts by Valmont (this was made for MP but works in SP). My idea is make a mission start like Days Gone 1st Game Trailer when the player ride his motorcycle to a ruined base camp and found roaming wolfs.  

  • Like 1

Share this post


Link to post
Share on other sites
3 minutes ago, Argmax said:

Hi thanks for reply, my mission is Single Player and i solved it with vDog Feral Scripts by Valmont (this was made for MP but works in SP). My idea is make a mission start like Days Gone 1st Game Trailer when the player ride his motorcycle to a ruined base camp and found roaming wolfs.  

 

That is good to know Argmax, I was going to recommend vDog Feral if it was multiplayer but the script works just fine in SP too.

 

Looking forward to your mission! 

Share this post


Link to post
Share on other sites
2 hours ago, Argmax said:

Hi thanks for reply, my mission is Single Player and i solved it with vDog Feral Scripts by Valmont (this was made for MP but works in SP). My idea is make a mission start like Days Gone 1st Game Trailer when the player ride his motorcycle to a ruined base camp and found roaming wolfs.  

Sry I didn't respond (was out for a few days).  I'm glad you found a solution.

  • Like 1

Share this post


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

Sry I didn't respond (was out for a few days).  I'm glad you found a solution.

Sorry too.... just noted the post, and if I had dig into my old missions files I could have helped.😜

Share this post


Link to post
Share on other sites

Hi there. I have been doing quite a lot of scripting lately and would like to take a shot at maybe slimming this down for my own mission and modifying it so atleast the basics are MP compatible. Would anyone happen to have a clear idea on what exactly the MP compatibility issues have been? I have seen things about feral dogs and AI patrols not working as intended, but my intention is to cut out anything not regarding the player's dog. I also do not plan to run this on Dedi so that eliminates more problems. I will take a look myself and try to convert it to my needs, but I just wanted to see if I could get a clearer idea of any issues I may face. Don't want to bother anyone ·3·

Edited by PortalGunner

Share this post


Link to post
Share on other sites

Hi @johnnyboy, wanted to let you know I've used the feral dog pack script in one of my missions here: https://steamcommunity.com/sharedfiles/filedetails/?id=1155398137

 

If I've done anything wrong in regards to attribution or usage or referenced things incorrectly, let me know and I'll fix it ASAP.

Edited by ContheJon
  • Like 2

Share this post


Link to post
Share on other sites
4 hours ago, ContheJon said:

Hi @johnnyboy, wanted to let you know I've used the feral dog pack script in one of my missions here: https://steamcommunity.com/sharedfiles/filedetails/?id=1155398137

That's great news ConthJon.  Thanks for letting me know (I will have to check it out).  I'm just happy you are using it, you did everything beautifully!

 

Based on the screenshots, I can tell a lot of care and work went into building the locations.  

  • Thanks 1

Share this post


Link to post
Share on other sites

Thank you very much. I like writing, and being able to write stories, even bad ones, in Arma 3 and have players actually play them as well as read them is such a cool thing. I'm also thankful to the Arma community as a whole, I wouldn't have been able to do a little of what I've done without all the help I've received and the scripts I've been able to use.

  • Like 1

Share this post


Link to post
Share on other sites

Hey, this script looks really interesting and i cant wait to use it in my missions. I just have a question, are you guys planning on updating the mod and adding the MP features? 

  • Like 1

Share this post


Link to post
Share on other sites

 

4 hours ago, DJ Mart said:

Hey, this script looks really interesting and i cant wait to use it in my missions. I just have a question, are you guys planning on updating the mod and adding the MP features? 

Hey DJ, thanks for the interest.  JBOY Dog will likely  never be MP compatible, so if you need MP I recommend @LSValmont's excellent vDog scripts.  He supports patrol dogs and feral dog packs in MP.

 

  • Like 2

Share this post


Link to post
Share on other sites

In my new SOG AI mod, some VC trackers will be randomly assigned jboy dogs.  The dogs follow the trackers, and will sense enemy and alert their trackers to the enemy presence.  The trackers will then order the dogs to attack (in Chinese voice) and blow a whistle.  Dogs then attack.

 

  • Like 2

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

×