Home   Help Search Login Register  

Author Topic: Animals scriptable ?  (Read 7368 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.