Home   Help Search Login Register  

Author Topic: Animals scriptable ?  (Read 7535 times)

0 Members and 1 Guest are viewing this topic.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Animals scriptable ?
« on: 23 Jun 2009, 12:42:24 »
Hi all,

Does anyone know if there is any way of controlling the animals?
The Alsatian would be good for a tracking party script, but the move and doMove command don't work on it.

Laggy
« Last Edit: 25 Jun 2009, 01:19:43 by laggy »
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Trexian

  • Members
  • *
Re: Animals scriptable ?
« Reply #1 on: 23 Jun 2009, 15:53:14 »
I'm still waiting for the USian release, but if you set waypoints for the dog, does that work?

I had a similar idea. :D
Sic semper tyrannosauro.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: Animals scriptable ?
« Reply #2 on: 23 Jun 2009, 16:31:56 »
Of course I've tried WP  :blink:

You can play the dog but it doesn't work as AI with/as:

waypoints
doMove
move
group member

 :weeping: :weeping: :weeping:
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Animals scriptable ?
« Reply #3 on: 23 Jun 2009, 17:37:45 »
 Have you tried to place a unit of man class give him waypoints and then create some animals and group them to him ?
 
 for instance  "cow04"" createUnit [getpos myman, group myman] ; i have tried it with Player and the animals foollow my orders , i wanted a cow to drive my ammo cart and it worked ok, i guess the problem is if you want to script it you will need to give the createdunit a  variable name or name so the cow can enter the scripts as a known entity ?

 anyway good luck .
 p.s a video of a civilised animal ;)
 http://www.youtube.com/watch?v=td0g0_jGlIk

 DB

 
I love ofp

Offline Trexian

  • Members
  • *
Re: Animals scriptable ?
« Reply #4 on: 23 Jun 2009, 19:15:36 »
I apologize in advance for continuing to participate in this, since I don't have it yet :) but does doFollow work, at least?
Sic semper tyrannosauro.

Offline Kremator

  • Members
  • *
Re: Animals scriptable ?
« Reply #5 on: 24 Jun 2009, 00:12:53 »

 p.s a video of a civilised animal ;)
 http://www.youtube.com/watch?v=td0g0_jGlIk

 


Nearly fell off my seat listening to the radio broadcast through it !

Offline loki72

  • Former Staff
  • ****
    • Loki's Nightmare
Re: Animals scriptable ?
« Reply #6 on: 24 Jun 2009, 01:11:21 »
is it possible to get the demo mission sir deano? :whistle:

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: Animals scriptable ?
« Reply #7 on: 24 Jun 2009, 12:20:17 »
Thanks to DeanosBeano and others...

Code: [Select]
myDog = group myPlayer createUnit ["Pastor", position myPlayer, [], 0, "FORM"];
enableRadio false;

This creates an AI working dog that follows your commands like move and stuff.
The doMove command works to in a trigger, so should be OK in a local script even in MP.

The enableRadio false is useful if the dog is in your group, otherwise he replies "Roger" all the time, which increases the fun factor a bit too much in serious missions  :D  Haven't tried the Alsatian as my limo driver yet...
« Last Edit: 24 Jun 2009, 12:22:37 by laggy »
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Animals scriptable ? [SOLVED]
« Reply #8 on: 24 Jun 2009, 12:26:09 »
And can you create a script to order the dog (by action menu) to follow/track a fugitive man in the countryside?
Fix bayonet!

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: Animals scriptable ? [SOLVED]
« Reply #9 on: 24 Jun 2009, 12:49:26 »
Most certainly I believe, but I haven't tried it yet.
The dog is a little unpredictable and stops sometimes even when it should continue moving.
When ordered into a barn it got stuck in there and couldn't get out.
This is when you command the dog as its leader, doMove might be more reliable.
The good thing is that it refuses to board a car, so it can't drive  :) which adds to the realism   :cool2:
« Last Edit: 24 Jun 2009, 12:51:20 by laggy »
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Re: Animals scriptable ?
« Reply #10 on: 24 Jun 2009, 14:14:30 »
Thanks to DeanosBeano and others...

Code: [Select]
myDog = group myPlayer createUnit ["Pastor", position myPlayer, [], 0, "FORM"];
enableRadio false;

This creates an AI working dog that follows your commands like move and stuff.
The doMove command works to in a trigger, so should be OK in a local script even in MP.

The enableRadio false is useful if the dog is in your group, otherwise he replies "Roger" all the time, which increases the fun factor a bit too much in serious missions  :D  Haven't tried the Alsatian as my limo driver yet...

Of wow, thanks for that info :) I was spending hours last night trying to get a dog into my team so that I could control it.
« Last Edit: 24 Jun 2009, 14:21:58 by DMarkwick »

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: Animals scriptable ?
« Reply #11 on: 25 Jun 2009, 01:29:19 »
Word of caution,

I've tried this createUnit dog quite thoroughly now and it works somewhat OK.

However it is quite unreliable in terms of AI commands. It works similar to a group member (human unit) but not always. It sometimes stops for no reason and falls behind in the formation. Seems like AI path or something isn't really working.

On the BI forums someone said that the animal models are controlled by FSM scripts and thus have no real AI. I don't really know what that means, but I can see the differences in behaviour.
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: Animals scriptable ?
« Reply #12 on: 25 Jun 2009, 12:31:35 »
Unless I am misstakin FSM scripting has to do with controlling the exact behaviour of units. It looks quite complicated from a beginners point of view. I have attached an example of an FSM script from one of the official missions for your perusal and study. It can be read with a normal text editor.

Maybe someone wiser than myself can explain what it means and how the script is initiated/called???
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Animals scriptable ?
« Reply #13 on: 25 Jun 2009, 13:39:09 »
Quote
On the BI forums someone said that the animal models are controlled by FSM scripts and thus have no real AI. I don't really know what that means, but I can see the differences in behaviour.
They are indeed but if you create a little script that shows what FSM the dog is running when it becomes idle or stops you can counteract it.
 Unfortunately its very hard to see how the fsms are working to a decent degree without bis`s FSM editor, although people have released custom FSM`s using fleas and crashdomes fsm editors, i cant find much documentations so its trial and error.now that they are heavily used in cutscenes we may get some more docmentation.

 Also Spooner and others have suggested that these created entities maybe better with createagent rather than createunit.
  i will try the addon route i think.
 
I love ofp

Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Re: Animals scriptable ?
« Reply #14 on: 25 Jun 2009, 15:52:34 »
I've got a dog that can indeed be used as a "slot" (thanks to the config info posted up earlier), but there's problems in having a team member who is a dog. For one, the dog doesn't always follow the group, and sometimes will not follow an order (like "move there" etc). Also the dog will report enemy units and will try to talk to you.

Thinking about it, dogs are not team members, the dog handler is the team member, and he has a dog as a "tool" that he uses. To this end, I think I'm going to implement it this way, have the dog as a tool the handler uses, but the handler is the team member.

Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Re: Animals scriptable ?
« Reply #15 on: 13 Jul 2009, 15:07:01 »
Hey DeanosBeano - is there a particular reason you chose "USMC_LHD_Crew_Blue" class to slot the animal into? I notice using the soldier base class makes the dog sink into the ground, so I was wondering what was going on there.

While we're at it, when using a dog in this fashion the rpt file fills up with error messages like
"Bad action name HMMWV_Cargo01 - not found in DogActions"
every time the dog gets close to a vehicle. Is there a way to lose all these errors? By rediefining something in the config?

Also, how can I ensure that the dog is a non-groupable entity, even though it is on side West? I can possibly ungroup any grouped dog in script, but I was wondering if it's also a config entry.

Just a couple of questions ;)

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Animals scriptable ?
« Reply #16 on: 15 Jul 2009, 12:33:13 »

 Well the reaason i picked that class was
1. he had a camo hidden texture so i could change his outfit with setobject texture
2. he didnt have any weapons sol ess problems with anim errors/

  I noticed that the rpt gave erros if the unit was ordered into a vehicle , i dint know the unit would try to get in a vehicle itself or the mere proximity would provoke ther errors.
 I guess the easiest way to obtain what you need is seek the playable dog inherit from that and i think i am correct in saying that these are not groupable , if they are then i guess you wil need a small script as you say checking and then making it join grpnull maybe.

  In essence this was all a quick ecperiment and i have not put more than 20 mins into it , i think alot more is achievable with time especially with fsms and this idle and straight distance etc command seems to be what makes the dog pause after 40meters and start another Fsm .
 anyway i f i get a chance i will try to look into it deeper.
 good luck .

DB
I love ofp

Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Re: Animals scriptable ?
« Reply #17 on: 15 Jul 2009, 13:46:12 »
I do have a version that uses as it's base the playable dog, which as you say is not groupable and also does not report thousands of errors every time it gets near a vehicle. However, I cannot get that dog to move via any command at all, only doMove and doStop seem to work on the LHD dog, but even this does not work on the playable dog. It's very annoying, as in all other ways the playable dog is much preferable.

With the LHD dog I can call it to me, have it return to the handler, and have it "stay". But, it fills up the RPT with thousands of errors each time it gets near a vehicle (and, I presume, anything else for which there is no action for). The Playable dog gives no errors, but will run off toward it's initial editor placed position every time it's unused, and cannot be called or told to stay.

As part of the addon is that the dog can travel in the back of a car (HMMWV only) this becomes a problem. Also added to that the likely scenarios involving tracking people through urban areas, abandoned cars etc and the errors become prohibitive.

I get the depressing feeling it's all best solved with a sufficiently massaged config, but I am notoriously poor at dealing with configs :)
« Last Edit: 15 Jul 2009, 13:49:50 by DMarkwick »

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Animals scriptable ?
« Reply #18 on: 15 Jul 2009, 14:07:21 »
hmm, i recall when i left the dog cfg , there was a problem with gestures and some sprint . i dont recall the dog having problems though with being near empty cars unless it was ordered inside one.

 this was the last config i used , further development would be to find some acceptable definitons for the gestures , tailwag etc and maybe you could replace cfgdogmocves with your wone, this is just the sinple fsms that the dog use , mayeb you can again redefine the actions that it wil lrequire and give it simple actions.  the best way to do this of course is to spot the errors in the rpt match them in the dog or human cfgmoves , apply them to your new cfgmoves and allshould be good.
 anyway if this is ot the same try it and see if it reduces ther errors , it is groupable unfortunately but it keeps a tight formation.

Code: [Select]
class CfgPatches
{
class dbo_man
{
units[] =
{
"dbo_doghandler"
};
weapons[] = {};
requiredVersion = 0.10;
requiredAddons[] = {


};
};
};



class CfgVehicleClasses
{
class dbo_handler
{
displayName = "dbo_Dog";
};
};

class CfgVehicles
{
  class USMC_LHD_Crew_Blue;
  class DBO_doghandler :USMC_LHD_Crew_Blue
    {
      scope = 2;
      displayName = "dbo_dog";
       model = "\ca\animals2\Dogs\Pastor\Pastor";
       moves = "CfgMovesDog";
       icon = "\Ca\animals2\data\mapicon_animals_ca.paa";
       gestures = "";
      faction ="USMC";
      boneHead = "head";
      bonePrimaryWeapon = "head";
   
       memoryPointHeadAxis = "head_axis";
      formationX = -1;
      formationZ = -2;
      formationTime = 2.5;
              weaponSlots = "1 + 4 + 12* 256 + 2* 4096 + 2 + 8* 16  + 12*131072";
      fsmFormation = "Formation";
      triggerAnim = "\CA\animals2\dogs\data\Anim\dogStop";
     // fsmFormation = "ca\characters\scripts\formationC.fsm";
      fsmDanger = "ca\characters\scripts\formationCDanger.fsm";
      woman = 0;
       gestureNo = "";
      gestureYes = "";
      gestureFollow = "";
      gestureAdvance = "";
      faceType = "Default";
      boneLEye = "l_eye";
      boneREye = "r_eye";
      boneLEyelidUp = "eye_upl";
      boneREyelidUp = "eye_upr";
      boneLEyelidDown = "eye_lwl";
      boneREyelidDown = "eye_lwr";
      boneLPupil = "l_pupila";
      boneRPupil = "r_pupila";
      memoryPointAim = "aimPoint";
      memoryPointCameraTarget = "camera";
      extCameraPosition[] = {
        0,
        0.5,
        -2.5
      };
      side =1;
      vehicleclass= "dbo_handler";
      accuracy = 1000;
   
         class VariablesScalar
      {
        _runDistanceMax = 111230;
        _maxIdleTime = 5;
        _movePrefer = 0.5;
        _threatMaxRadius = 350;
        _formationPrefer = 0.1;
        _scareLimit = 0.1;
        _dangerLimit = 1;
      };
     

    };
   
};

 I havent touched them for a time but i am sure it wont need much to  fix 90% of your problems.

 
I love ofp

Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Re: Animals scriptable ?
« Reply #19 on: 15 Jul 2009, 14:59:05 »
Thanks for the info DB, that looks like the template from which I made one of my dogs.

About the cfgmoves stuff, where would I find all this? I cannot find them defined in Animals(2) or Characters(2) etc. Also I don't know where the DogActions are defined, which makes up all the dog errors in the RPT.

I don't mean to suck up your time like this, I can usually get what I want in code myself, but as far as configs go, I don't really have much of a clue I'm afraid. This tracker dog thing is working REALLY well, and just about the only thing stopping us releasing it is the errors in the RPT vs controllability of the dog.

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Animals scriptable ?
« Reply #20 on: 15 Jul 2009, 16:19:26 »
well if you use worldeaters tool you can get the full cfg then your looking for

 
Code: [Select]
class CfgMovesDog : CfgMovesAnimalsBase
  {
    primaryActionMaps[] = {
      "DogActions",
      "NoActions"
    };

within which is

Code: [Select]
  class DogActions : NoActions
      {
        Stop = "Dog_Stop";

I love ofp

Offline Trexian

  • Members
  • *
Re: Animals scriptable ?
« Reply #21 on: 15 Jul 2009, 17:31:02 »
Where can I find worldeater's tool?  It sounds like his tool can fill the void in terms of what I need, too.  No matter how deep I get into this, it seems like I still have difficulty figuring out where to put the bits of stuff.

Thanks for all your help!
Sic semper tyrannosauro.

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Animals scriptable ?
« Reply #22 on: 15 Jul 2009, 17:35:17 »
worldeaters dumpconfig can be found here

 http://www.ofpec.com/forum/index.php?topic=33539.0

 good luck i look forward to the dogs
I love ofp

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Animals scriptable ?
« Reply #23 on: 15 Jul 2009, 19:42:44 »
Relevant config from animals2.pbo - animconfig folder attached.


Planck
I know a little about a lot, and a lot about a little.

Offline Trexian

  • Members
  • *
Re: Animals scriptable ?
« Reply #24 on: 15 Jul 2009, 19:54:29 »
Excellent!  :clap:

The errors reported in the rpt are in the nature of:
Code: [Select]
Bad action name HMMWV_Driver - not found in DogActions
Bad action name HMMWV_Cargo01 - not found in DogActions
Bad action name HMMWV_Cargo01 - not found in DogActions
Bad action name HMMWV_Cargo01 - not found in DogActions
Bad action name UAZ_Cargo01 - not found in DogActions

(Repeated hundreds of times.)

It appears as though a cfg entry in the addon dog that defined, perhaps as a new class or added to class DogActions: NoActions, either null values - so that it does nothing - or the sitting action - so it just sits there - for HMMWV_Driver, etc. - might work.

Edited.  That is still a terrible one-sentence paragraph, but I hope it is still understandable...
« Last Edit: 15 Jul 2009, 20:01:44 by Trexian »
Sic semper tyrannosauro.

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Animals scriptable ?
« Reply #25 on: 15 Jul 2009, 21:33:06 »
 hmm,
 Again i dont undertsand why you are getting them errors , unlees your suing some kinda movein commands, i have put a dog with the above congfig i posted earlier near 20 empty vehicle types and i dont get those errors.
 could you describe the scenario that creates those errors ?

I love ofp

Offline Trexian

  • Members
  • *
Re: Animals scriptable ?
« Reply #26 on: 15 Jul 2009, 21:52:46 »
I will give it my best attempt. :)  I don't think I have a copy of the config - DM's got it.

The dog and handler are not grouped together.  There are scripted commands for the handler to do certain things with the dog.

The "errors" - or "alerts" - happen when the player is the dog and moves near a vehicle (at this point, Humvees and sedans).  It seems like the sim looks at each vehicle, figures out that the dog can't get in, then sends that alert to the rpt.  The result is simply that the dog can't get in, which we already know.

I am not sure if it happens when the player is the handler - I haven't followed the changes to the rpt close enough.

The goal is to just prevent those alerts from being sent to the rpt.
Sic semper tyrannosauro.

Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Re: Animals scriptable ?
« Reply #27 on: 15 Jul 2009, 23:23:12 »
hmm,
 Again i dont undertsand why you are getting them errors , unlees your suing some kinda movein commands, i have put a dog with the above congfig i posted earlier near 20 empty vehicle types and i dont get those errors.
 could you describe the scenario that creates those errors ?



Hey DB, would there be any value in me sending you the addon as it currently is? It's a JTD_TrackerDog.pbo and a mission with all the addon files in it, ready to be moved into the pbo itself.

Basically when the player "moves" into the dog role, he runs around the vehicle, generating errors. The errors do not occur when the dog is "attachTo"d the handler.

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Re: Animals scriptable ?
« Reply #28 on: 16 Jul 2009, 00:13:07 »
when the player "moves" into the dog role
Great, one step closer to have a dream come true...

SCNR
try { return true; } finally { return false; }

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Animals scriptable ?
« Reply #29 on: 16 Jul 2009, 00:41:29 »

Hey DB, would there be any value in me sending you the addon as it currently is? It's a JTD_TrackerDog.pbo and a mission with all the addon files in it, ready to be moved into the pbo itself.

Basically when the player "moves" into the dog role, he runs around the vehicle, generating errors. The errors do not occur when the dog is "attachTo"d the handler.

 sure mate send me a link in PM, i will be online about 6-7 pm GMT tomorrow i will take a look no problem, hopefully i can try to eliminate some of those errors for ya and you can get that Dog out there
I love ofp

Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Re: Animals scriptable ?
« Reply #30 on: 16 Jul 2009, 02:19:54 »
PM sent :)

*edit*
Incidentally, an equally useful alternative would be a dog based off the Pastor class (as opposed to a dog crowbarred into a soldier class) but which has the ability to accept move commands. I don't know which way around is easiest, but I suspect that last one would be the most appropriate gamewise.
« Last Edit: 16 Jul 2009, 20:09:49 by DMarkwick »

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Animals scriptable ?
« Reply #31 on: 16 Jul 2009, 20:31:43 »
 well , to be honest i am confused with the animal class , the playable animals the non groupable class etc. i believe we are at a disadvantage being pioneers ( but is that not the fun).

 Anyway good news i fixed the problem .
 Bad news the fooker can actually get in the thing (and drive if he choses lol).
 
 i have this problem when i run the mission , is it something i am doing or do you get it ?

 I am using an english language patc on the latest patch 1.02 + last beta.

 
Code: [Select]
Error: cannot load sound 'ca\dubbing\global\radio\female03\ru\report\movementto.wss', header cannot be loaded.

 
I love ofp

Offline loki72

  • Former Staff
  • ****
    • Loki's Nightmare
Re: Animals scriptable ?
« Reply #32 on: 16 Jul 2009, 20:34:18 »
LOL.. i want to see a cow driving a tractor....

 :D


Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Re: Animals scriptable ?
« Reply #33 on: 16 Jul 2009, 20:42:20 »
Anyway good news i fixed the problem .
 Bad news the fooker can actually get in the thing (and drive if he choses lol).

Heh, well I guess it will be easy enough to kick the dog out of the driver's seat etc :D good job there.
 
 
Quote
i have this problem when i run the mission , is it something i am doing or do you get it ?

I sometimes get those, I think it's when something else is doing something wrong but is not the sort of error that is flagged directly. It's a sort of indirect effect I think. It comes & goes with me. When everything else works fine, they go away. It might be a consequence of developing in a mission that has a civilian module loaded up.
« Last Edit: 16 Jul 2009, 21:49:37 by DMarkwick »

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Animals scriptable ?
« Reply #34 on: 16 Jul 2009, 20:59:10 »
Pm sent with the changes mate , hope you can make something from if you want i could spend some time so it is like an actual unit and more commandable so you wont need to attach it.
 good luck
DB
 I will post the config in the appropriate section when you have fully ttested it so others can learn from it if they wish.

 
I love ofp

Offline mathias_eichinger

  • Missions Depot
  • Administrator
  • *****
  • I'm a llama!
Re: Animals scriptable ?
« Reply #35 on: 17 Aug 2009, 22:50:40 »
Hello gentlemen!

I am curious if you had any progress on the scriptable dogs... because what I would like to do is a mission where the player has to defend a village against packs of rabid dogs.
So the dogs should be able to move together in formation, follow waypoints and get close to soldier units while damaging them.

Do you think there is any solution for this setting?

Cheers

Mathias

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: Animals scriptable ?
« Reply #36 on: 18 Aug 2009, 08:22:59 »
Laggy has workinging dogs in the Behind Enemy Lines mission. They are used as tracker dogs. No attacks. The mision is pending in the Missions Depot (MP section).
OFPEC | Intel Depot
RETARDED Ooops... Retired!